Advertisement
Riremito

Portal Master

Feb 20th, 2015
592
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [Enable]
  2. Alloc(PortalTeleport, 512)
  3. Label(GP_Ending)
  4. Label(GP_Loop)
  5. Label(GP_GoodPortal)
  6. Label(GP_ExitLoop)
  7. Label(GP_Reset)
  8.  
  9. Alloc(CurrentPortalID, 4)
  10. Alloc(KeyHook, 256)
  11. Label(Return)
  12. Label(KeyCheck)
  13. Label(KC_Ending)
  14. Label(KeyHack)
  15. Label(KH_Ending)
  16.  
  17. CurrentPortalID:
  18. dd 0
  19.  
  20. PortalTeleport:
  21. pushad
  22. mov edx,[01CD0918]
  23. test edx,edx
  24. je GP_Ending
  25. mov edx,[edx+165C]//MapID
  26. test edx,edx
  27. je GP_Ending
  28. xor ebx,ebx
  29. xor eax,eax
  30. mov ecx,[01CD87B8]
  31. test ecx,ecx
  32. je GP_Ending
  33. mov ecx,[ecx+4]
  34. test ecx,ecx
  35. je GP_Ending
  36. GP_Loop:
  37. mov esi,[ecx+eax*8+04]
  38. cmp [ecx-4],eax
  39. jbe GP_Reset
  40. inc eax
  41. cmp [esi+1C],#0
  42. je GP_Loop
  43. cmp [esi+1C],edx//InMap
  44. je GP_Loop
  45. cmp [esi+1C],#999999999
  46. jne GP_GoodPortal
  47. cmp [esi+8],7//portal type
  48. jne GP_Loop
  49. GP_GoodPortal:
  50. cmp [esi+8],3//auto portal?
  51. je GP_Loop
  52. cmp [CurrentPortalID],ebx
  53. je GP_ExitLoop
  54. inc ebx
  55. cmp [ecx-4],eax
  56. ja GP_Loop
  57. GP_Reset:
  58. mov [CurrentPortalID],0
  59. xor eax,eax
  60. xor ebx,ebx
  61. jmp GP_Ending
  62. GP_ExitLoop:
  63. push ecx
  64. push eax
  65. mov ecx,[01CCBC74]
  66. mov eax,[esi+C]//X
  67. mov [ecx+AABC],eax
  68. mov eax,[esi+10]//Y
  69. sub eax,1E
  70. mov [ecx+AAB0],eax
  71. mov [ecx+AA98],1
  72. pop eax
  73. pop ecx
  74. inc [CurrentPortalID]
  75. GP_Ending:
  76. popad
  77. xor eax,eax
  78. ret
  79.  
  80. KeyHook:
  81. push [esp+8]
  82. call KeyCheck
  83. cmp eax,07
  84. je KeyHack
  85. push -01
  86. push 018554C2
  87. jmp Return
  88.  
  89. KeyCheck:
  90. push ecx
  91. xor eax,eax
  92. movzx ecx,byte ptr [esp+B]
  93. cmp ecx,80//key up event
  94. jne KC_Ending
  95. movzx eax,byte ptr [esp+A]
  96. KC_Ending:
  97. pop ecx
  98. ret 0004
  99.  
  100. KeyHack:
  101. call PortalTeleport
  102. KH_Ending:
  103. xor eax,eax
  104. ret 0008
  105.  
  106. 01412D40:
  107. jmp KeyHook
  108. db 90 90
  109. Return:
  110.  
  111. [Disable]
  112. 01412D40:
  113. push -01
  114. push 018554C2
  115.  
  116.  
  117. DeAlloc(PortalTeleport)
  118. DeAlloc(KeyHook)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement