Advertisement
PrimeNotorious

Ghosts IDC Script [1.12]

May 25th, 2014
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 7.76 KB | None | 0 0
  1. #include <idc.idc>
  2.  
  3. static Rename(name, binary, offset, length)
  4. {
  5. auto currentAddress, lastAddress;
  6.                 for(currentAddress=0; currentAddress != BADADDR; currentAddress=currentAddress+4)
  7.                         {              
  8.                                         currentAddress = FindBinary(currentAddress, SEARCH_DOWN, binary);
  9.                                         if(currentAddress == BADADDR)
  10.                                         {
  11.                                                         Message("%s not found!\n", name);
  12.                                                         break;
  13.                                         }
  14.                                         currentAddress = currentAddress - offset;
  15.                                         MakeUnknown(currentAddress, length, 0);
  16.                                         MakeCode(currentAddress);
  17.                                         MakeFunction(currentAddress, currentAddress + length);
  18.                                         if(MakeNameEx(currentAddress, name, SN_NOCHECK|SN_NOWARN) != 1)
  19.                                                         MakeNameEx(currentAddress, name, 0);
  20.                                         Message("\t%s offset: 0x%08X\n", name, currentAddress);
  21.                                         break;
  22.                         }
  23. }
  24.            
  25. static LabelFunctions()
  26. {
  27.     Rename("G_EffectIndex(char const *)", "E8 81 00 38 7C 63 07 B4 78 84 00 22 4B FF 1C CD", 0x60, 0x1B8);
  28.     Rename("Cbuf_AddText(localClientNum int, char * text)", "4C 40 23 42 41 82 00 30  33 FF 00 02 33 C5 FF D0", 0x48, 0x1B8);
  29.     Rename("SV_SendServerCommand (client_s * cl svscmd_type Typ const char * fmt)", "54 84 00 3E 80 84 00 00  7C 64 1A 14 E8 A2 2A E8", 0xB8, 0x1B8);
  30.     Rename("G_SetModel(gentity_s *,char const *)", "B0 7F 01 70 48 00 00 0C  4B DA 37 FD B0 7F 01 70", 0x28, 0x1B8);
  31.     Rename("G_GivePlayerWeapon(playerState_s *pPS, int iWeaponIndex, char altModelIndex)", "54 9E 15 BA 32 F7 BA F0 92 C1 00 30 3B E0 00 00", 0xB8, 0x1B8);
  32.     Rename("SV_AddTestClient(void)", "60 63 93 FC E8 82 21 18  90 7F 01 40 7C 83 23 78", 0x310, 0x1B8);
  33.     Rename("PlayerCmd_ClonePlayer(scr_entref_t entref)", "7B 5A 00 20 80 7A 01 58  2C 03 00 00 40 82 00 14", 0x58, 0x1B8);
  34.     Rename("PlayerCmd_GiveStartAmmo(scr_entref_t entref)", "7C C6 07 B4 2C 06 00 00  40 81 00 20 90 81 00 38", 0x3B8, 0x1B8);
  35.     Rename("PlayerCmd_GiveWeapon(scr_entref_t entref)", "7F 9C 18 2E 41 82 00 5C  63 A5 00 00 63 E7 00 00", 0x13C, 0x1B8);
  36.     Rename("PlayerCmd_GetAngles(scr_entref_t entref)", "54 84 02 10 2C 04 00 00  41 82 00 1C 3C 60 00 23", 0x19C, 0x1B8);
  37.     Rename("PlayerCmd_SetAngles(scr_entref_t entref)", "78 63 00 20 48 0B 33 71  E8 01 00 80 7C 08 03 A6", 0x138, 0x1B8);
  38.     Rename("PlayerCmd_Suicide(scr_entref_t entref)", "EC 23 08 BA D0 3D 00 08  30 79 01 38 78 65 00 20", 0x1614C, 0x1B8);
  39.     Rename("PlayerCmd_Spawn(scr_entref_t entref)", "FC 02 08 00 4C C0 13 82  41 86 00 08 D0 26 00 00", 0x28C, 0x1B8);
  40.     Rename("G_SetClientContents(gentity_s *)", "54 63 06 B4 2C 03 00 00  40 82 00 7C 80 84 00 B8", 0x50, 0x1B8);
  41.     Rename("G_SpawnPlayerClone(void)", "6B DE 00 02 41 82 00 0C  63 A3 00 00 4B FF FC 85", 0x68, 0x1B8);
  42.     Rename("G_SetAngle(gentity_s *ent, const float *angle)", "EF FF 01 32 C0 63 00 00  80 DE 01 7C FC 02 18 00", 0x2EC, 0x1B8);
  43.     Rename("G_SetOrigin(gentity_s *ent, const float *origin)", "7C C6 07 B4 4B E6 2C D5  3C 60 00 DB 30 63 58 84", 0x1FC, 0x1B8);
  44.     Rename("player_die(gentity_s *self, gentity_s *inflictor, gentity_s *attacker, int damage, int meansOfDeath, int iWeapon, cons t float *vDir, hitLocation_t hitLoc, int psTimeOffset)", "54 63 03 DE 2C 03 00 00  41 82 00 18 30 69 00 28", 0x94, 0x1B8);
  45.     Rename("G_InitGentitygentity_s * e)", "7C 84 18 10 7C 85 20 96  38 A0 00 00 38 C0 00 01", 0x10, 0x1B8);
  46.     Rename("G_InitializeAmmo(gentity_s *pSelf, int weaponIndex, char weaponModel, int hadWeapon) ", "54 E7 DF FE 38 A0 00 01  E8 81 00 38 78 84 00 22", 0xD8, 0x1B8);
  47.     Rename("G_LocalizedStringIndex(const char * string)", "7C 65 FE 76 63 C3 00 00  7C A5 20 38 38 80 02 17", 0x74, 0x1B8);
  48.     Rename("G_MaterialIndex(const char * name)", "7C 66 FE 76 7C A7 28 10  63 E3 00 00 7C C6 28 38", 0xC0, 0x1B8);
  49.     Rename("AllocEnity(unsigned int classnum, unsigned __int16 entnum)", "78 85 0F E0 68 A5 00 01  7F A5 E8 14 63 A6 00 00", 0x44, 0x1B8);
  50.     Rename("AngleDelta(angle1 const float, const float angle2)", " EC 3F 0F B8 C0 5F 00 08  EC 21 00 B2 E8 01 00 A0", 0x38, 0x1B8);
  51.     Rename("BG_FindWeaponIndexForName(const char *name)", "50 9D 06 3E 38 80 00 00  38 C0 04 00 93 A1 00 30", 0x70, 0x1B8);
  52.     Rename("BG_GetEntityTypeName(const int eType) ", "7C 63 20 2E 48 00 00 28  3C A0 00 A8 3C C0 00 83", 0x24, 0x1B8);
  53.     Rename("BG_GetNumWeapons(void)", "50 9D 06 3E 38 80 00 00  38 C0 04 00 93 A1 00 30", 0x84, 0x1B8);
  54.     Rename("BG_GetPerkIndexForName(const char *perkName)", "4E 9E 04 21 2C 03 00 00  41 80 00 10 3B C0 00 01", 0x6572F8, 0x1B8);
  55.     Rename("BG_GetShellshockParms(const int index)", " 54 63 06 F6 C0 44 04 2C  2C 03 00 00 EC 22 00 72", 0x124, 0x1B8);
  56.     Rename("BG_GetWeaponIndexForName(const char *name, void (__cdecl *regWeap)(unsigned int))", "53 FC 06 3E 54 84 DF FE  93 81 00 30 93 E3 B8 64", 0x11C, 0x1B8);
  57.     Rename("BG_GetViewModelWeaponIndex(playerState_s *ps)", "7C 84 FE 76 7C 84 30 38  7C 85 20 14 78 84 00 20", 0x24, 0x1B8);
  58.     Rename("BG_RunLerpFrameRate(int localClientNum, clientInfo_t * it, lerpFrame_t * lf, int newAnimation, entityState_s * n)", "54 86 01 4A 2C 06 00 00  40 82 00 0C C0 23 00 00", 0x30, 0x1B8);
  59.     Rename("BG_SetNewAnimation(int localClientNum, clientInfo_t * it, lerpFrame_t * lf, int newAnimation, entityState_s * n)", "60 65 00 40 81 0D 90 00  7D C3 00 34 F9 21 00 88", 0xD8, 0x1B8);
  60.     Rename("BG_SetShellShockParmsFromDvars(shellshock_parms_t *parms)", "FC 22 0F EE FB E1 00 98  FB C1 00 90 FB A1 00 88", 0x4C, 0x1B8);
  61.     Rename("BG_WeaponFireRecoil(playerState_s const * const float *, float const *) ", "FC 1E F8 00 40 82 00 38  63 64 00 00 2C 1C 00 00", 0x17C, 0x1B8);
  62.     Rename("BG_PlayerStateToEntityState(playerState_s *ps, entityState_s *s, int snap, char handler) ", "55 6B 07 7A 79 4A 00 20  2C 0B 00 00 41 82 00 28", 0xB0, 0x1B8);
  63.     Rename("BG_TakePlayerWeapon(playerState_s *ps, unsigned int weaponIndex, int takeAwayAmmo) ", "54 86 15 BA 90 81 00 AC  80 83 00 00 63 E3 00 00", 0x44, 0x1B8);
  64.     Rename("Key_IsDown(int localClientNum, int keynum)", "7F E3 26 70 39 20 00 09  30 E3 00 57 31 63 00 30", 0x398, 0x1B8);
  65.     Rename("Key_StringToKeynum(const char *str)", "4C 40 2B 82 41 82 00 0C  30 84 FF D0 48 00 00 20", 0x78, 0x1B8);
  66.     Rename("Key_IsValidGamePadChar(const char key) ", "54 63 06 F6 7C 83 28 10  30 67 E6 70 7C 84 00 34", 0x110, 0x1B8);
  67.     Rename("Key_KeynumToString(int keynum, int translate)", " 7B E4 17 64 30 63 5D C0  7C 84 07 B4 7C 63 20 2E", 0x7C, 0x1B8);
  68.     Rename("Key_KeynumToStringBuf(int keynum, char *buf, int buflen) ", "7B 7F 00 20 33 43 AF 80  63 C3 00 00 48 00 A5 11", 0xF0, 0x1B8);
  69.     Rename("Key_Unbind_f(void)", "54 A5 07 BC 83 C4 00 04  7C A5 38 10 7C A5 00 34", 0x1BC, 0x1B8);
  70.     Rename("Key_Bind_f(void)", "7C A5 00 34 78 A5 D1 46  7C A5 FE 76 7C BF 18 38", 0xB4, 0x1B8);
  71.     Rename("Key_ClearStates(int localClientNum)", "78 84 00 20 38 C0 00 01  7C 63 07 B4 48 00 38 09", 0xB8, 0x1B8);
  72.     Rename("Key_SetCatcher(int localClientNum, int catcher)", "7C C6 00 34 78 C6 D1 46  7C C6 FE 76 7C C4 20 38", 0x34, 0x1B8);
  73.     Rename("Key_RemoveCatcher(int localClientNum, int andMask)", "54 9A 50 3E 7D 8C CA 78  7C 9C 30 38 7D 08 C0 14", 0x5D24B8, 0x1B8);
  74.     Rename("Key_GetCommandAssignmentInternal(int localClientNum, const char *command, int *twokeys, int gamePadOnly) ", "54 63 10 3A 7C 63 07 B4  7C 64 18 2E 1C 83 0D 28", 0x27C, 0x1B8);
  75. }
  76.            
  77. static  main()
  78. {
  79.     LabelFunctions();
  80.     return 0;  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement