Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.47 KB | None | 0 0
  1. ;X86-assembly in Intel syntax with additional virtual registers (VR0 - VR9 and VMM) to ease programming
  2.  
  3. ;//Compiler settings:
  4. ;//<cfg=RandomPadding>true</cfg>
  5. ;//<cfg=RandomPaddingSize>128</cfg>
  6. ;//<cfg=SearchDlls>false</cfg>
  7. ;//<cfg=VirtualQuerySearch>true</cfg>
  8. ;//<cfg=PrintDebugOutput>false</cfg>
  9.  
  10. ;Virtual registers
  11. ;//VR9 => OFFSET_GlowObjectManager
  12. ;//VR8 => OFFSET_LocalPlayer
  13. ;//VR7 => OFFSET_EntityList
  14. ;//VR6 => OFFSET_FORCE_ATTACK
  15. ;//VR5 => OFFSET_CrosshairId
  16. ;//VR4 => OFFSET_TeamNum
  17. ;//VR3 => OFFSET_bSpotted
  18. ;//VR2 => random number
  19. ;//VR1 => random number
  20. ;//VR0 => GLOBAL_MinimumAddress
  21. ;//read only register:
  22. ;//VMM => VirtualAllocEx( hGame, 0, 0x2000, MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE );
  23.  
  24. ;//Initial value of the general-purpose register:
  25. ;//EAX => Original StackPointer (ESP)
  26.  
  27. ;//Virtual register usage in code below:
  28. ;//VR0 -> Local Team Id
  29. ;//VR1 -> Object Count
  30. ;//VR2 -> GlowObject / temporary GlowObjectManager
  31. ;//VR3 -> Entity
  32. ;//VR6 -> GLOBAL_MinimumAddress
  33.  
  34.  
  35. ;/////////////////////////////// Code Start ///////////////////////////////
  36. ;//VR6 => VR0
  37. mov eax, VR0
  38. mov VR6, eax;//OFFSET_FORCE_ATTACK is not needed and gets overwritten!
  39.  
  40. @l_Start:
  41. mov eax, VR8;//OFFSET_LocalPlayer
  42. mov eax, DWORD PTR[eax]
  43.  
  44. ;//if ( EBX < 0x10000 ) goto l_Start
  45. mov ebx, eax
  46. mov ecx, VR6;//0x10000
  47. sub eax, ecx;//COMPARE EAX, ECX
  48. xchg eax, ebx;//Restore EAX
  49. jc l_Start
  50.  
  51. mov ebx, VR4;//OFFSET_TeamNum
  52. add eax, ebx
  53. mov eax, DWORD PTR[eax]
  54. mov VR0, eax;//<-- VR0 -> Local TeamId
  55.  
  56. ;//if ( EAX > 64 ) goto l_Start
  57. xchg eax, ecx
  58. mov eax, 64
  59. sub eax, ecx;//COMPARE EAX, ECX
  60. js l_Start
  61.  
  62.  
  63. mov eax, VR9;//OFFSET_GlowObjectManager
  64. mov VR2, eax;//VR2 = GlowObjectManager
  65.  
  66. add eax, 0x4
  67. add eax, 0x4
  68. add eax, 0x4
  69.  
  70. mov eax, DWORD PTR[eax]
  71. mov VR1, eax;//VR1 = Object Count
  72. mov eax, VR2;//VR2 = GlowObjectManager
  73. mov eax, DWORD PTR[eax]
  74. mov VR2, eax;//VR2 = GlowObject
  75.  
  76. @l_Loop1:
  77. mov eax, VR2;//VR2 = GlowObject
  78. mov eax, DWORD PTR[eax] ;//eax = GlowObject->m_pEntity
  79. mov VR3, eax;//VR3 -> Entity
  80.  
  81. ;//if ( EAX < 0x10000 ) goto l_skip
  82. mov ebx, eax
  83. mov ecx, VR6;//0x10000
  84. sub eax, ecx;//COMPARE EAX, ECX
  85. xchg eax, ebx;//Restore EAX
  86. jc l_skip
  87.  
  88.  
  89. mov eax, VR3;//VR3 -> Entity
  90. jmp GetClassID
  91. @GetClassID_Ret:
  92.  
  93. ;//if ( ECX != 0x28 ) goto l_skip
  94. mov eax, 0x28
  95. sub eax, ecx;//COMPARE EAX, ECX
  96. jne l_skip
  97.  
  98. mov eax, VR3;//VR3 -> Entity
  99. mov ebx, VR4;//VR4 -> OFFSET_TeamNum
  100. add eax, ebx
  101. mov eax, DWORD PTR[eax];//eax = Entity->m_iTeamNum
  102. mov ecx, eax
  103.  
  104.  
  105. mov eax, VR2;//VR2 = GlowObject
  106. add eax, 0x4
  107. mov ebx, 0x3F800000
  108. mov DWORD PTR[eax], ebx;//GlowObject->m_flRed = 1.0f [1.0f => 0x3F800000]
  109. add eax, 0x4
  110. mov ebx, 0x0
  111. mov DWORD PTR[eax], ebx;//GlowObject->m_flGreen = 0.0f
  112. add eax, 0x4
  113. mov DWORD PTR[eax], ebx;//GlowObject->m_flBlue = 0.0f
  114. add eax, 0x4
  115. mov ebx, 0x3F800000
  116. mov DWORD PTR[eax], ebx;//GlowObject->m_flAlpha = 1.0f [1.0f => 0x3F800000]
  117.  
  118. add eax, 4
  119. add eax, 4
  120. add eax, 4
  121. add eax, 4
  122. add eax, 4
  123. ;GlowObject->m_bRenderWhenOccluded = 1
  124. ;GlowObject->m_bRenderWhenUnoccluded = 1
  125. ;GlowObject->m_bFullBloom = 0
  126. ;=> 0x00000101
  127. mov ebx, 0x00000101
  128. mov DWORD PTR[eax], ebx
  129.  
  130. @l_skip:
  131.  
  132. mov eax, VR2;//VR2 = GlowObject
  133. mov ebx, 0x38
  134. add eax, ebx ;//GlowObject = GlowObject+0x38
  135. mov VR2, eax;//VR2 = GlowObject
  136.  
  137. mov eax, VR1;//VR1 = Object Count
  138. dec eax
  139. mov VR1, eax;//VR1 = VR-1
  140.  
  141. ;//if ( EAX != 0 ) goto l_Loop1
  142. mov ecx, 0x00
  143. sub eax, ecx;//COMPARE EAX, ECX
  144. jne l_Loop1
  145.  
  146. jmp l_Start;//=> Jump back to start
  147.  
  148. ;//////////////////////////////////////////// GetClassId ////////////////////////////////////////////
  149. ;//Function GetClassId
  150. ;//EAX => Entity
  151. @GetClassID:
  152. mov ecx, eax
  153.  
  154. add eax, 0x4
  155. add eax, 0x4
  156.  
  157. mov eax, DWORD PTR[eax]
  158.  
  159. ;//if ( EBX < 0x10000 ) goto l_Fail
  160. mov ebx, eax
  161. mov ecx, VR6;//0x10000
  162. sub eax, ecx;//COMPARE EAX, ECX
  163. xchg eax, ebx;//Restore EAX
  164. jc l_Fail
  165.  
  166. add eax, 0x4
  167. add eax, 0x4
  168.  
  169. mov eax, DWORD PTR[eax]
  170.  
  171. ;//if ( EAX < 0x10000 ) goto l_Fail
  172. mov ebx, eax
  173. mov ecx, VR6;//0x10000
  174. sub eax, ecx;//COMPARE EAX, ECX
  175. xchg eax, ebx;//Restore EAX
  176. jc l_Fail
  177.  
  178. inc eax
  179. mov eax, DWORD PTR[eax]
  180.  
  181. ;//if ( EAX < 0x10000 ) goto l_Fail
  182. mov ebx, eax
  183. mov ecx, VR6;//0x10000
  184. sub eax, ecx;//COMPARE EAX, ECX
  185. xchg eax, ebx;//Restore EAX
  186. jc l_Fail
  187.  
  188.  
  189. add eax, 0x4
  190. add eax, 0x4
  191. add eax, 0x4
  192. add eax, 0x4
  193. add eax, 0x4
  194.  
  195.  
  196. mov eax, DWORD PTR[eax]
  197. mov ecx, eax
  198.  
  199. jmp GetClassID_Ret
  200.  
  201. @l_Fail:
  202. mov ecx, 0x0
  203. jmp GetClassID_Ret
  204. ;//////////////////////////////// Code End ////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement