1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Item Filter ASM Phail by me v2.0

Discussion in 'Programming' started by DarkSpace, Aug 17, 2010.

  1. DarkSpace

    DarkSpace Well-Known Member Coder

    shyt wrong section. Mods move it to Programming please!

    i need to convert this to c++ asm but i keep failing bad.
    does anyone know a way to get it working?

    this is the AA code
    Code (Text):
    1. [enable]
    2. Alloc(filter,124)
    3. label(ifreject)
    4. label(end)
    5. label(skip)
    6. Alloc(iftable,512)
    7. label(ifexit)
    8.  
    9. filter:
    10. push ebx
    11. push esi
    12. xor ebx, ebx
    13. mov esi,iftable
    14.  
    15. ifreject:
    16. cmp eax,[esi]
    17. je skip
    18. cmp [esi],ebx
    19. je end
    20. add esi,4
    21. jmp ifreject
    22.  
    23. skip:
    24. mov eax,00
    25.  
    26. end:
    27. pop esi
    28. pop ebx
    29. mov [edi+34], eax
    30. mov edi, [ebp-14]
    31. jmp ifexit
    32.  
    33. iftable:
    34. dd C350
    35. dd a
    36. //Snowboards
    37. dd 1600DC //Sky Snowboard
    38. dd 1600DD //Aqua Snowboard
    39. dd 1600DE //Silver Snowboard
    40. dd 1600DF //Golden Snowboard
    41. dd 1600E0 //Dark Snowboard
    42. dd 1600E1 //Blood Snowboard
    43. dd 1600EE //Maple Snowboard
    44.  
    45. //Usable Items
    46. dd 1F6EE0 //Arrow for Bow
    47. dd 1F72C8 //Arrow for Crossbow
    48. dd 1F6EE1 //Bronze Arrow for Bow
    49. dd 1F72C9 //Bronze Arrow for Crossbow
    50.  
    51. //Potions
    52. dd 1E8480 //Red Potion
    53. dd 1E8481 //Orange Potion
    54. dd 1E8482 //White Potion
    55. dd 1E8483 //Blue Potion
    56.  
    57. dd 1E8487 //Red Pill
    58. dd 1E8488 //Orange Pill
    59. dd 1E8489 //White Pill
    60. dd 1E848A //Blue Pill
    61. dd 1E848B //Mana Elixer Pill
    62.  
    63. dd 1F47D0 //Antidote
    64. dd 1F47D1 //Eye Drop
    65. dd 1F47D3 //Holy Water
    66. dd 1F47D2 //Tonic
    67.  
    68. dd 1E8C59 //Dexterity Pill
    69. dd 1E8C57 //Magic Pill
    70. dd 1E8C56 //Warrior Pill
    71.  
    72. dd 1EAB93 //Orange
    73. dd 1EAB94 //Lemon
    74.  
    75. //ETC items
    76.  
    77. dd 3d0900
    78. dd 3d0901
    79. dd 00
    80.  
    81.  
    82. 004F7338: //89 47 34 8B 7D EC 8B CE E8 ?? ?? F? FF 89 47 24
    83. jmp filter
    84. nop
    85. ifexit:
    86.  
    87. [disable]
    88. 004F7338:
    89. mov [edi+34], eax
    90. mov edi, [ebp-14]
    91. dealloc(filter,124)
    92. dealloc(iftable,512)
    93.  
    i got the asm part done, im having problems with iftable

    Code (Text):
    1.  
    2. void __declspec(naked) __stdcall ItemFilterHook()
    3. {
    4.     __asm
    5.     {
    6.         push ebx
    7.         push esi
    8.         xor ebx, ebx
    9.         mov esi, iftable
    10.  
    11.         ifreject:
    12.         cmp eax,[esi]
    13.         je skip
    14.         cmp [esi],ebx
    15.         je end
    16.         add esi,0x04
    17.         jmp ifreject
    18.  
    19.         skip:
    20.         mov eax, 0x00
    21.  
    22.         end:
    23.         pop esi
    24.         pop ebx
    25.         mov [edi+0x34], eax
    26.         mov edi, [ebp-0x14]
    27.         jmp ifReturn
    28.     }
    29. }
    30.  
    31. void enableFilter()
    32. {
    33.     *(BYTE*)itemFilterPointer = 0xe9;
    34.     *(DWORD*)(itemFilterPointer + 1) = jmp(itemFilterPointer, ItemFilterHook);
    35.     *(BYTE*)(itemFilterPointer + 5) = 0x90;
    36. }
    37.  
    now how do i add items that i want to filter to this c++ script?
     
  2. [D.R.T]

    [D.R.T] (҂ `з´ ).︻╦̵̵̿╤── Coder Donor

    accurate, if you want to make a single item dynamic filter, use loops and arrays
     
  3. DarkSpace

    DarkSpace Well-Known Member Coder

    the game keeps crashing when enable the script and drop any time.

    using
    DWORD iftable[] = { 0xC350, 0xA, 0x1600DC, 0x1600DD , 0x00};

    and i tried both the
    Code (Text):
    1.  
    2. mov esi, dword ptr ds:[iftable]
    3.  
    and

    Code (Text):
    1.  
    2. mov esi, iftable
    3.  
    still keeps crashing when i try and drop the item, even the one thats not being listed in the iftable

    what could be wrong?
     
  4. Siobhan

    Siobhan New Member

    Code (Text):
    1. __declspec(naked) void __stdcall ItemFilter()
    2. {
    3.     __asm {
    4.         push ebx
    5.         push esi
    6.         xor ebx, ebx
    7.         mov esi, offset iftable
    8.         //lea esi, iftable
    9.  
    10. ifreject:
    11.         cmp eax,[esi]
    12.         je skip
    13.         cmp [esi],ebx
    14.         je end
    15.         add esi,4
    16.         jmp ifreject
    17.  
    18. skip:
    19.         mov eax,00
    20.  
    21. end:
    22.         pop esi
    23.         pop ebx
    24.         mov [edi+0x34], eax
    25.         mov edi, [ebp-0x14]
    26.         jmp [ItemReturn]
    27.     }
    28.  
    29. }
    Is what I use. And yeah, I know I don't have to use __stdcall here.
     
  5. DarkSpace

    DarkSpace Well-Known Member Coder

    I effing love you!

    my code had few miss-conversion-errors-like-things. =D

    changed the following things to make it work

    mov esi, iftable to mov esi, offset iftable
    add esi,0x04 to add esi,4
    mov eax,0x00 to mov eax,00

    now it works great. thank you =D
     
  6. Siobhan

    Siobhan New Member

  7. DarkSpace

    DarkSpace Well-Known Member Coder

    ah, dun be a meanie!

    im still new to this codecave thing. but im starting to understand it more and more with every script i convert.
    and if i phail, i make a thread like this, then some pro (like you) helps out.
    and then i learn yet another thing.

    so when some other noobie (other than my self) makes a thread asking about something similar like this
    i help him out, untill every single person in the world becomes as pro as you and maybe i? hehe =P

    and that is my story of how the perfect world should be

    yeeaaaaaaa.
    well thanks again for the script, helped alot ^^
     

Share This Page