Welcome to HBH V2 ! If you had an account on hellboundhacker.org you will need to reset your password using the Lost Password system before you will be able to login.

ASM Print - Assembly Code Bank

ASM Print
Just a program that prints out the first argument
                section .text:
        global mystrlen ; int mystrlen(char* buf);
        global myprint   ; void myprint(char* buf);
        global _start      ; int _start(int argc, char* argv[])

; esp+4 = buf
        xor eax,eax
        dec eax
        mov ebx,[esp+4]
                inc eax
                cmp [ebx+eax],byte 0
                jne strloop
; esp+4 = buf
        mov ecx,[esp+4]
        push ecx
        call mystrlen
        mov edx,eax
        mov eax,4
        mov ebx,1
        int 80h
        pop ecx
        pop eax ; argc
        cmp eax,2 ; if(argc != 2) { end(); }
        jne end
        pop eax ; argv[0] - program name
        pop eax ; argv[1] - first argument
        push eax
        call myprint ; myprint(argv[1]);
                mov eax,1
                mov  ebx,0
                int 80h ; return 0
binary_man's avatar
binary_man 9 years ago