Advertisement
webmanix

Greenherb

Nov 8th, 2010
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. format pe dll
  2.  
  3. include '%fasmi%\win32ax.inc'
  4.  
  5. ;##################################################### MACROS
  6. macro iskey __key {
  7. invoke GetAsyncKeyState,__key
  8. test eax,eax
  9. }
  10.  
  11. macro findfunction __moduleh,[__fnam] {
  12. invoke GetProcAddress,__moduleh,__fnam
  13. }
  14.  
  15. ;importfunc Module_Handle,Handler_Position,Procedure_Name
  16. ;macro importfunc __mh,__base,__pos,[__procnam] {
  17. macro importfunc __mh,__pos,[__procnam] {
  18. push eax
  19. invoke GetProcAddress,__mh,__procnam
  20. mov dword [_address+(__pos*4)],eax
  21. pop eax
  22. }
  23.  
  24. ;writeretn Destination_Address,Number_Of_Arguments_of_the_function
  25. macro writeretn __destination,__retnval {
  26. push 0
  27. push 3
  28. call @f
  29. retn __retnval*4
  30. @@:
  31. push __destination
  32. push -1
  33. call [WriteProcessMemory]
  34. }
  35.  
  36. ;hook Source_Address,Destination_Address
  37. macro hook __source,__dest {
  38. pushad
  39. mov edx,__dest
  40. sub edx,__source
  41. sub edx,5
  42. mov ecx,@f
  43. sub ecx,4
  44. mov dword [ecx],edx
  45. push 0
  46. push 5
  47. call @f
  48. db 0e9h
  49. dd 0
  50. @@:
  51. push __source
  52. push -1
  53. call [WriteProcessMemory]
  54. popad
  55. }
  56.  
  57. ;ask FunctionToCall,'MyQuestion'
  58. macro ask __tokall,[__question] {
  59. invoke MessageBoxA,0,__question,'The Green Herb',MB_YESNO
  60. cmp eax,IDYES
  61. jne @f
  62. call __tokall
  63. @@:
  64. }
  65.  
  66. ;writexor Destination_Address
  67. macro writexor __dest {
  68. push 0
  69. push 2
  70. call @f
  71. xor eax,eax
  72. @@:
  73. push __dest
  74. push -1
  75. call [WriteProcessMemory]
  76. }
  77.  
  78. ;writeor Destination_Address
  79. macro writeor __dest {
  80. push 0
  81. push 2
  82. call @f
  83. or al,1
  84. @@:
  85. push __dest
  86. push -1
  87. call [WriteProcessMemory]
  88. }
  89.  
  90.  
  91.  
  92.  
  93. ;#####################################################
  94. ;#####################################################
  95. ;#####################################################
  96. ;#####################################################
  97.  
  98. section '_Root' code readable executable writeable
  99. __________TheHerb:
  100. or al,1
  101. mov eax,$
  102. mov byte [eax],0c3h
  103. invoke CreateThread,0,0,mainproc,0,0,0
  104. or al,1
  105. retn
  106.  
  107.  
  108. ;=======##################============#######################
  109. ;Procedures
  110.  
  111. mainproc:
  112.          call initializer
  113.          ask godmodehack,'Do you want to activate the God mode hack?'
  114.          ask blindcellshack,'Do you want to make cells blind?'
  115.          ask celllevel99,'Do you want to make all cells in the game lv. 99?'
  116.          ask celllevel1,'Do you want to make all cells in the game lv. 1?'
  117.          retn
  118.  
  119. initializer:
  120.           invoke LoadLibraryA,'entitiesmp.dll'
  121.           mov [entitiesmp],eax
  122.           invoke LoadLibraryA,'engine.dll'
  123.           mov [engine],eax
  124.           retn
  125.  
  126. godmodehack:
  127.           ;God mode hack procedure
  128.           findfunction [entitiesmp],'?ReceiveDamage@CPlayer@@UAEXPAVCEntity@@PBUDamageInfo@@@Z'
  129.           writeretn eax,2
  130.           findfunction [entitiesmp],'?ReceiveDamage@CPlayer@@UAEXPAVCEntity@@W4DamageType@@MABV?$Vector@M$02@@2@Z'
  131.           writeretn eax,5
  132.           findfunction [entitiesmp],'?ReceiveDamage_OnGuard@CPlayer@@QAEXPBUDamageInfo@@PAVCEntity@@@Z'
  133.           writeretn eax,2
  134.           retn
  135.  
  136. blindcellshack:
  137.           ;Blind cells hack
  138.           findfunction [entitiesmp],'?IsVisible@CNpcBase@@QAEHPAVCEntity@@@Z'
  139.           push eax
  140.           writexor eax
  141.           pop eax
  142.           add eax,2
  143.           writeretn eax,1
  144.           ;findfunction [entitiesmp],'?IsValidForEnemy@CNpcBase@@QAEHPAVCEntity@@@Z'
  145.           ;push eax
  146.           ;writeor eax
  147.           ;pop eax
  148.           ;add eax,2
  149.           ;writeretn eax,1
  150.           retn
  151.  
  152. celllevelhook:
  153.      mov eax,[esp+4]
  154.      mov dword [ecx+7c0h],99
  155.      retn 4
  156. celllevel99:
  157.           ;Cells will be lvl 99, not obvious?
  158.           findfunction [entitiesmp],'?SetLevel@CNpcBase@@QAEXJ@Z'
  159.           hook eax,celllevelhook
  160.           retn
  161.  
  162. celllevelhook2:
  163.      mov eax,[esp+4]
  164.      mov dword [ecx+7c0h],1
  165.      retn 4
  166. celllevel1:
  167.           ;Cells will be lvl 1, not obvious?
  168.           findfunction [entitiesmp],'?SetLevel@CNpcBase@@QAEXJ@Z'
  169.           hook eax,celllevelhook2
  170.           retn
  171.  
  172.  
  173. ;=======##################============#######################
  174. ;Junk
  175.  
  176. entitiesmp dd 0
  177. engine dd 0
  178.  
  179. _address rb 1;00*4 ;Cabe 100 procedimentos
  180.  
  181. .end __________TheHerb
  182.  
  183.  
  184.  
  185. db 13,11,0dh,0ah
  186. ___signature db 'The Green Herb; 11/2010; Brazil, Carlos',13,11,0dh,0ah
  187. db 'Put love in the things you do, belive in what you are, be what you want to be, thats the secret of life.'
  188. db 13,11,0dh,0ah
  189. section '_Leaf' fixups data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement