1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. MapleStory Europe has migrated to MapleStory Global! This section is readonly now.
    Dismiss Notice

Europe I need to ask some question regarding asm.

Discussion in 'Discussion' started by fre024, Aug 3, 2010.

  1. fre024

    fre024 Banned Banned

    Hello everybody,
    I have some questions about asm.
    I would like to talk someone on msn who have some knowledge about this.
    So if u would like to help me, pm me, then i pm u my email adress.
    In the meanwhile i post my questions here.

    My first questions ares about the "cmp" (compare) code.

    Code (Text):
    1.  
    2. cmp eax,ebx
    3. jge dothis
    4.  
    I have read some tutorial so i know this means:
    when the contents of eax are greater or equal to the contents of ebx then dothis

    So far so good, i understand it till here.
    But what kinda confuses me is that i found this code on this forum.

    Code (Text):
    1.  
    2. Tele:
    3. push eax
    4. mov eax, [00ADBF90]
    5. mov eax, [eax+28]
    6. cmp eax, 01 // item value of when to loot
    7. pop eax
    8. jl TeleRet
    9. pushad
    10. mov ecx, [ItemPosX]
    11. mov eax, [ItemPosY]
    12. mov ebx,[00ADA538]
    13. mov [ebx+2a68],ecx
    14. mov [ebx+2a6c],eax
    15. mov [ebx+2a60],01
    16. popad
    17. jmp TeleRet
    18.  
    But after the cmp command there is a pop command.
    Which moves the 4 bytes (stored because of push i guess) to eax register/memory location.

    Here comes my questions :
    So after the cmp there is nothing that makes a comparision.
    How does it compares the contents ?
    Does it returns true if it is greater, less, or equal then the other content.

    Or do i need to see to the first jmp command after the cmp command?
    In this case "jl TeleRet".

    This would make most sense to me.

    The main thing is i would like to understand scripts.
    And i have managed to understand quiet a few easy scripts.
    Now i want to understand this script.
    Code (Text):
    1.  
    2. [enable]
    3. alloc(ItemXY, 70)
    4. alloc(ItemPosX, 8)
    5. alloc(ItemPosY, 8)
    6. alloc(Tele, 50)
    7. label(TeleRet)
    8.  
    9. 0083FEAF://39 ?? ?? ?? ?? ?? 8d 8e ?? ?? ?? ?? 74 ?? ?? e8 ?? ?? ?? ?? 39 ?? ?? ?? ?? ?? 8d ?? ?? ?? ?? ?? 74 02
    10. jmp Tele
    11. db 90
    12. TeleRet:
    13.  
    14. Tele:
    15. push eax
    16. mov eax, [00ADBF90]
    17. mov eax, [eax+28]
    18. cmp eax, 01
    19. pop eax
    20. jl TeleRet
    21. pushad
    22. mov ecx, [ItemPosX]
    23. mov eax, [ItemPosY]
    24. mov ebx,[00ADA538]
    25. mov [ebx+2a68],ecx
    26. mov [ebx+2a6c],eax
    27. mov [ebx+2a60],01
    28. popad
    29. jmp TeleRet
    30.  
    31.  
    32. //------------------------------------------------
    33. 00ADE6F4: //de ?? ?? ?? ?? ?? f8 74 76 0f
    34. dd ItemXY
    35.  
    36. ItemXY:
    37. cmp [esp],004F6133 //85 c0 75 ?? 83 4d ?? ?? 39 45 ?? 74 ?? 50
    38. jne PtInRect
    39. push eax
    40. mov eax,[esp+0C]
    41. mov [ItemPosX],eax
    42. mov eax,[esp+10]
    43. mov [ItemPosY],eax
    44. pop eax
    45. jmp PtInRect
    46.  
    47. [disable]
    48. 0083FEAF:
    49. cmp [esi+00000cd0],ebx
    50.  
    51. 00ADE6F4:
    52. dd PtInRect
    53.  
    54. dealloc(ItemXY)
    55. dealloc(ItemPosX)
    56. dealloc(ItemPosY)
    57. dealloc(Tele)
    58.  
    Thx for the answers.
     
  2. Lollage

    Lollage Well-Known Member

    Code (Text):
    1.  
    2. [enable]
    3. alloc(ItemXY, 70)
    4. alloc(ItemPosX, 8)
    5. alloc(ItemPosY, 8)
    6. alloc(Tele, 50)
    7. label(TeleRet)
    8.  
    9. 0083FEAF://39 ?? ?? ?? ?? ?? 8d 8e ?? ?? ?? ?? 74 ?? ?? e8 ?? ?? ?? ?? 39 ?? ?? ?? ?? ?? 8d ?? ?? ?? ?? ?? 74 02
    10. jmp Tele //
    11. db 90
    12. TeleRet:
    13.  
    14. Tele:
    15. push eax
    16. mov eax, [00ADBF90] // Move 00ADBF90 in EAX,
    17. mov eax, [eax+28] // Move 00ADBF90 + 28 into the eax } Item pointer+ offset
    18. cmp eax, 01  //This 01 means that it starts teleing when there are more then 1 items in the map, so basicly it compares the EAX )<< The pointer+offset, which results in the counter)  with that value and then it does what is has to do :)
    19. pop eax // you already understand these
    20. jl TeleRet // Jump if lower then TeleRet
    21. pushad
    22. mov ecx, [ItemPosX] // Move the ItemPosX [the x position of the item] onto ECX
    23. mov eax, [ItemPosY] // Move the ItemPosY [the y position of the item] onto EAX
    24. mov ebx,[00ADA538] // And move the char pID (00ADA538 onto EBX
    25. mov [ebx+2a68],ecx // This moves this teleportpointer onto EBX, where the Char pID is stored, which means the Char pID get's in the "same place" as the telepointers which means the Char will tele to EAX /\
    26. mov [ebx+2a6c],eax // Moves EAX onto the [EBx+2a6c]
    27. mov [ebx+2a60],01 // Moves the value 01 onto the [EBX+2a60
    28.  
    29. popad
    30. jmp TeleRet
    31.  
    32.  
    33.  
    34. //------------------------------------------------
    35. 00ADE6F4: //de ?? ?? ?? ?? ?? f8 74 76 0f
    36. dd ItemXY
    37.  
    38. ItemXY:
    39. cmp [esp],004F6133 //85 c0 75 ?? 83 4d ?? ?? 39 45 ?? 74 ?? 50 // Compare 004F6133 with [esp]?
    40. jne PtInRect // If 004F6133 isn't equal to [esp] then>>"Jump if not equal" to PtInrect
    41. push eax
    42. mov eax,[esp+0C] // Move [esp (which you just compared)+0c] onto the EAX /\ look at what you stored in to EAX
    43. mov [ItemPosX],eax // Move the EAX ( item pointer+offset etc..) onto ItemPosX
    44. mov eax,[esp+10] // Move [esp+10] onto eax
    45. mov [ItemPosY],eax //Move the EAX ( item pointer+offset etc..) onto ItemPosY
    46. pop eax
    47. jmp PtInRect //then jump to PtInrect
    48.  
    49. [disable]
    50. 0083FEAF:
    51. cmp [esi+00000cd0],ebx
    52.  
    53. 00ADE6F4:
    54. dd PtInRect
    55.  
    56. dealloc(ItemXY)
    57. dealloc(ItemPosX)
    58. dealloc(ItemPosY)
    59. dealloc(Tele)
    60.  
    So basicly you store the values/addys in to the registers/storages and after all you put them all together
    Excuse me if I'm wrong on some places in this script , I'm still a beginner to.
     
  3. fre024

    fre024 Banned Banned

    W0WZ0R,
    This answer is exactly what i hoped for.
    Thx so much.
     

Share This Page