Advertisement
GK-Chubbz

Hookless Kami

May 16th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.32 KB | None | 0 0
  1. #define Padding(x) struct { unsigned char __padding##x[(x)]; };
  2.  
  3. #define MaxEnts 100
  4.  
  5. struct CUserLocal
  6. {
  7.     Padding(0x5E5C); //char vector offset/char pid
  8.     void* lpvPID;
  9.     Padding(0x7EE8); //char x - vector offset/pid - 4
  10.     int x;           //0xDD48
  11.     int y;           //0xDD4C
  12. };
  13.  
  14. struct CMob_LoopDistance
  15. {
  16.     Padding(0x4);
  17.     CMob_LoopDistance* i;
  18.     Padding(0x10);  //0x18
  19.     CMob_Next_2* pCMob_Next_2;
  20. };
  21.  
  22. struct CMob_Next_2
  23. {
  24.     Padding(0x1D8); //mob 3 offset
  25.     CMob_3* pCMob_3;
  26. };
  27.  
  28. struct CMob_Next_1
  29. {
  30.     Padding(0x4);
  31.     CMob_LoopDistance* i;
  32.     Padding(0x10);  //0x18 - 4 - 4
  33.     CMob_Next_2* pCMob_Next_2;
  34. };
  35.  
  36. struct CMob_4
  37. {
  38.     Padding(0x60);  //mob x
  39.     int x;          //0x60
  40.     int y;          //0x64
  41.     int inv_x;      //0x68
  42.     int inv_y;      //0x6C
  43. };
  44.  
  45. struct CMob_3
  46. {
  47.     Padding(0x24);  //mob 4 offset
  48.     CMob_4* pCMob_4;
  49. };
  50.  
  51. struct CMob_2
  52. {
  53.     Padding(0x1D8); //mob 3 offset
  54.     CMob_3* pCMob_3;
  55. };
  56.  
  57. struct CMob_1
  58. {
  59.     Padding(0x4);
  60.     CMob_2* pCMob_2;
  61.     Padding(0x7FFFFFE8);
  62.     Padding(0x7FFFFFFF);
  63.     CMob_Next_1* pCMobNext_1;
  64. };
  65.  
  66. CUserLocal*(__cdecl* TSingleton_CUserLocal_GetInstance)() = NULL;
  67. CMobPool*(__cdecl* TSingleton_CMobPool_GetInstance)() = NULL;
  68. void(__fastcall* CUserLocal_IsTeleportSkillAvailable)(void* lpvEcx, void* lpvEdx, void* lpvPID, int x, int y) = NULL;
  69.  
  70. namespace MapleStory
  71. {
  72.     namespace Function
  73.     {
  74.         void Teleport(int x, int y)
  75.         {
  76.             void* PID = TSingleton_CUserLocal_GetInstance()->lpvPID;
  77.            
  78.             return CUserLocal_IsTeleportSkillAvailable(0, 0, PID, x, y);
  79.         }
  80.  
  81.         void Do_Kami()
  82.         {
  83.             int MobCount = TSingleton_CMobPool_GetInstance()->iCount;
  84.             int Mob_x[MaxEnts], Mob_y[MaxEnts], Mob_invx[MaxEnts], Mob_invy[MaxEnts];
  85.  
  86.             //TSingleton_CMobPool_GetInstance -> 0x28 [pMob_1_1]
  87.             CMob_1* pMob_1_1 = reinterpret_cast<CMob_1*>(reinterpret_cast<PBYTE*>(TSingleton_CMobPool_GetInstance()->pCMob_1));
  88.  
  89.             //pMob_1_1 -> 0x4 -> 0x1D8 -> 0x24 [pMob_1_4]
  90.             CMob_4* pMob_1_4 = reinterpret_cast<CMob_4*>(reinterpret_cast<PBYTE*>(pMob_1_1->pCMob_2->pCMob_3->pCMob_4));
  91.             Mob_x[0] = pMob_1_4->x; // pMob_1_4 -> 0x60;
  92.             Mob_y[0] = pMob_1_4->y; // pMob_1_4 -> 0x64;
  93.             Mob_invx[0] = pMob_1_4->inv_x;
  94.             Mob_invy[0] = pMob_1_4->inv_y;
  95.  
  96.             //pMob_1_1 -> -0x10 -> 0x18 -> 0x1D8 -> 0x24 [pMob_2_4]
  97.             CMob_4* pMob_2_4 = reinterpret_cast<CMob_4*>(reinterpret_cast<PBYTE*>(pMob_1_1->pCMobNext_1->pCMob_Next_2->pCMob_3->pCMob_4));
  98.             Mob_x[1] = pMob_2_4->x; // pMob_2_4 -> 0x60;
  99.             Mob_y[1] = pMob_2_4->y; // pMob_1_4 -> 0x64;
  100.             Mob_invx[1] = pMob_2_4->inv_x;
  101.             Mob_invx[1] = pMob_2_4->inv_y;
  102.  
  103.             CMob_LoopDistance *MobList = reinterpret_cast<CMob_LoopDistance*>(reinterpret_cast<PBYTE*>(pMob_1_1->pCMobNext_1->i));
  104.             CMob_4 *Mob;
  105.  
  106.             for (size_t i = 2; i <= MobCount; i++)
  107.             {
  108.                 Mob = MobList->pCMob_Next_2->pCMob_3->pCMob_4;
  109.  
  110.                 Mob_x[i] = Mob->x;
  111.                 Mob_y[i] = Mob->y;
  112.                 Mob_invx[i] = Mob->inv_x;
  113.                 Mob_invy[i] = Mob->inv_y;
  114.  
  115.                 MobList = MobList->i;
  116.  
  117.             //  if (Mob_invx[i] > 0 || Mob_invy[i] > 0)
  118.             //      continue;
  119.  
  120.                 while (Mob_x[i] && Mob_y[i])
  121.                 {
  122.                     Teleport(Mob_x[i], Mob_y[i]);
  123.                 }
  124.             }
  125.            
  126.             return;
  127.         }
  128.     }
  129. }
  130.  
  131. void GetData()
  132. {
  133.     *(void**)&TSingleton_CMobPool_GetInstance = reinterpret_cast<void*>(0x004C17D0); //
  134.     *(void**)&TSingleton_CUserLocal_GetInstance = reinterpret_cast<void*>(0x004AEDB0); //
  135.     *(void**)&CUserLocal_IsTeleportSkillAvailable = reinterpret_cast<void*>(0x01763BE0); //
  136. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement