ASM CODE

30189004 8B4500 mov eax,[ebp]
30189007 8B4C2428 mov ecx,[esp+0x28]
3018900b 83C504 add ebp,0x4
3018900e 3BC1 cmp eax,ecx
30189010 896C2418 mov [esp+0x18],ebp
30189014 0F823F010000 jb 0x30189159
3018901a 3B442410 cmp eax,[esp+0x10]
3018901e 0F8335010000 jnb 0x30189159
30189024 8B9730010000 mov edx,[edi+0x130]
3018902a 8BB73C010000 mov esi,[edi+0x13C]
What does these above mentioned assembly codes do?Can anyone explain it to me in details please.Can anyone plz explain step-by- step meaning of all the above lines?
It may look easy to u guys but i'm new so i don't know how it really works please help.
And,what's "ebp"?
Any help would b greatly appreciated.Thanks in advance.

Comments

  • [code]
    : 30189004 8B4500 mov eax,[ebp]
    : 30189007 8B4C2428 mov ecx,[esp+0x28]
    : 3018900b 83C504 add ebp,0x4
    : 3018900e 3BC1 cmp eax,ecx
    : 30189010 896C2418 mov [esp+0x18],ebp
    : 30189014 0F823F010000 jb 0x30189159
    : 3018901a 3B442410 cmp eax,[esp+0x10]
    : 3018901e 0F8335010000 jnb 0x30189159
    : 30189024 8B9730010000 mov edx,[edi+0x130]
    : 3018902a 8BB73C010000 mov esi,[edi+0x13C]
    [/code]
    : What does these above mentioned assembly codes do?Can anyone explain
    : it to me in details please.Can anyone plz explain step-by- step
    : meaning of all the above lines?
    : It may look easy to u guys but i'm new so i don't know how it really
    : works please help.
    : And,what's "ebp"?
    : Any help would b greatly appreciated.Thanks in advance.
    :

    Use code tags when posting thing that need the format preserved.

    ebp is a register, just like eax and ebx. It's usually used as the base pointer of a stack.

    [ebp] means what ebp points to.
    ebx menas what ebx contains.
    mov ebx,[ebp] moves what ebp points to into ebx.
    add eax,ebx adds the second register to the first. eax = eax+ebx.
    cmp eax,ecx affects the flags as would have been done with the result of eax-ecx.
    jb dest (jump below) jumps to dest only if the zero flag and the above flag are zero.
    jnb dest (jump not below) jumps to dest if the zero flag and the above flag is set, which is the same as jump above and equal, jae.

    That's it.
    I can't make out the meaning of the code without contex.
    Also just search for assembly tutorial and you'll find a lot of good resources.

    Happy coding wishes
    the one and only
    [b]Niklas Ulvinge[/b] [white]aka [b]IDK[/b][/white]
  • Thank You.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories