Guest User

Untitled

a guest
Oct 24th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.05 KB | None | 0 0
  1. bool bGoodMonster = true;
  2. int iRangeX = 20, iRangeY = 0;
  3. int iOriginalX = 0, iOriginalY = 0;
  4. unsigned long ulEBX;
  5. HANDLE hKami;
  6.  
  7. int iItems = 50;
  8. int iItemX, iItemY;
  9. bool bLoot = false;
  10.  
  11. #define TeleORAddy 0x00889459
  12.  
  13. #define CharAddy 0x00B44CFC
  14. #define TimeAddy 0x00B452DC //a1 ? ? ? 00 8b 40 ? c3
  15. #define TimeOffset 0x1C //Below TimeAddy
  16. #define TeleOffset 0x000036DC
  17. #define NextTeleOffset 0x000036F0 //Main tele + 14
  18.  
  19. #define ItemsAddy 0x00B4719C
  20. #define ItemsOffset 0x00000028
  21.  
  22. #define ItemHookCmp 0x005002FF //took forever
  23. #define PtInRectAddy 0x00B49C84 //Search for PtInRect
  24.  
  25. #define MonsterAddy 0x00B44CF8
  26. #define MobStructOffset1 0x00000028
  27. #define MobStructOffset2 0x00000004
  28. #define MobStructOffset3 0x000000F0
  29. #define MobStructOffset4 0x00000028
  30. #define MobXOffset 0x00000060
  31. #define MobDeathOffset 0x00000404
  32.  
  33. #define WallAddy 0x00B44CF0
  34. #define LeftWallOffset 0x00000024
  35.  
  36. unsigned long ulPtInRect = (unsigned long)GetProcAddress(GetModuleHandle("user32.dll"), "PtInRect");
  37.  
  38. void __declspec(naked) _stdcall ItemHookAsm()
  39. {
  40. __asm
  41. {
  42. cmp [esp],ItemHookCmp
  43. jne End
  44. push eax
  45. mov eax,[esp+0x0C]
  46. mov [iItemX],eax
  47. mov eax,[esp+0x10]
  48. mov [iItemY],eax
  49. pop eax
  50.  
  51. End:
  52. jmp dword ptr [ulPtInRect]
  53. }
  54. }
  55.  
  56. bool LeftWall(int X)
  57. {
  58. return ((int)ReadPointer(WallAddy, LeftWallOffset) <= X);
  59. }
  60.  
  61. bool TopWall(int Y)
  62. {
  63. return ((int)ReadPointer(WallAddy, LeftWallOffset + 4) <= Y);
  64. }
  65.  
  66. bool RightWall(int X)
  67. {
  68. return ((int)ReadPointer(WallAddy, LeftWallOffset + 8) >= X);
  69. }
  70.  
  71. bool BottomWall(int Y)
  72. {
  73. return ((int)ReadPointer(WallAddy, LeftWallOffset + 12) >= Y);
  74. }
  75.  
  76. void Teleport(int X, int Y)
  77. {
  78. if (LeftWall(X) && RightWall(X) && TopWall(Y) && BottomWall(Y))
  79. {
  80. WritePointer(CharAddy, TeleOffset + 8, X);
  81. WritePointer(CharAddy, TeleOffset + 12, Y);
  82. WritePointer(CharAddy, TeleOffset, 1);
  83. }
  84. }
  85.  
  86. int GetTimeStamp()
  87. {
  88. return (int)ReadPointer(TimeAddy, TimeOffset);
  89. }
  90.  
  91. int GetAllowedTeleTime()
  92. {
  93. return (int)ReadPointer(CharAddy, NextTeleOffset);
  94. }
  95.  
  96. void Kami()
  97. {
  98. for (;; Sleep(10))
  99. {
  100. if(GetTimeStamp() <= GetAllowedTeleTime() || GetAllowedTeleTime() == 0)
  101. {
  102. if (bLoot && (int)ReadPointer(ItemsAddy, ItemsOffset) >= iItems)
  103. {
  104. for (unsigned char uc = 0; uc <= 200 && ReadPointer(ItemsAddy, ItemsOffset) >= 1; uc++, Sleep(25)) //loot for 5 seconds
  105. {
  106. Teleport(iItemX, iItemY);
  107. }
  108. }
  109. continue;
  110. }
  111.  
  112. ulEBX = ReadPointer(MonsterAddy, MobStructOffset1);
  113.  
  114. if (bGoodMonster)
  115. {
  116. ulEBX = GetValue(ulEBX, MobStructOffset2);
  117. }
  118. else
  119. {
  120. ulEBX = GetValue(ulEBX, -12);
  121. ulEBX = GetValue(ulEBX, 0x14);
  122. }
  123.  
  124. if (!GetValue(ulEBX, MobDeathOffset))
  125. {
  126. bGoodMonster ^= true;
  127. continue;
  128. }
  129.  
  130. ulEBX = GetValue(ulEBX, MobStructOffset3);
  131. ulEBX = GetValue(ulEBX, MobStructOffset4);
  132.  
  133. Teleport((int)GetValue(ulEBX, MobXOffset) - iRangeX, (int)GetValue(ulEBX, MobXOffset + 4) - iRangeY);
  134.  
  135. }
  136. }
  137.  
  138. ..
  139.  
  140. *(char*)(TeleORAddy + 6) = 0x01;
  141. hKami = CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)&Kami, NULL, NULL, NULL);
Add Comment
Please, Sign In to add comment