ScriptzMoDz

MW2 RPC

Aug 25th, 2014
464
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 8.50 KB | None | 0 0
  1. public static class MW2RPC
  2.         {
  3.             //Fixed MW2 RPC for 1.14 by Vezah, i know SC58 released an RPC but it didnt return anything so i fixed it :PP
  4.             //This is to use the Functions that seb released !
  5.             public static uint function_address;
  6.  
  7.             public static int Init()
  8.             {
  9.                 function_address = Get_func_address();
  10.                 if (function_address == 0) return -1;
  11.                 Enable_RPC();
  12.                 return 0;
  13.             }
  14.  
  15.             public static uint Get_func_address()
  16.             {
  17.                 for (uint i = 0x10A24; i < 0x1000000; i += 4)
  18.                 {
  19.                     byte[] bytes = PS3.ReadBytes(i, 8);
  20.                     if (((bytes[0] == 0xec) && (bytes[1] == 0x21) && (bytes[2] == 0x00) && (bytes[3] == 0x32) && (bytes[4] == 0x4e) && (bytes[5] == 0x80) && (bytes[6] == 0x00) && (bytes[7] == 0x20)))
  21.                     {
  22.                         return i + 0xC;
  23.                     }
  24.  
  25.                 }
  26.                 return 0;
  27.             }
  28.  
  29.             public static int CallFunc(uint uint_1, params object[] object_0)
  30.             {
  31.                 int length = object_0.Length;
  32.                 uint num2 = 0;
  33.                 for (uint i = 0; i < length; i++)
  34.                 {
  35.                     byte[] buffer;
  36.                     if (object_0[i] is int)
  37.                     {
  38.                         buffer = BitConverter.GetBytes((int)object_0[i]);
  39.                         Array.Reverse(buffer);
  40.                         PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer);
  41.                     }
  42.                     else if (object_0[i] is uint)
  43.                     {
  44.                         buffer = BitConverter.GetBytes((uint)object_0[i]);
  45.                         Array.Reverse(buffer);
  46.                         PS3.SetMemory(0x10050000 + ((i + num2) * 4), buffer);
  47.                     }
  48.                     else if (object_0[i] is string)
  49.                     {
  50.                         byte[] buffer2 = Encoding.UTF8.GetBytes(Convert.ToString(object_0[i]) + "\0");
  51.                         PS3.SetMemory(0x10050054 + (i * 0x400), buffer2);
  52.                         uint num4 = 0x10050054 + (i * 0x400);
  53.                         byte[] array = BitConverter.GetBytes(num4);
  54.                         Array.Reverse(array);
  55.                         PS3.SetMemory(0x10050000 + ((i + num2) * 4), array);
  56.                     }
  57.                     else if (object_0[i] is float)
  58.                     {
  59.                         num2++;
  60.                         buffer = BitConverter.GetBytes((float)object_0[i]);
  61.                         Array.Reverse(buffer);
  62.                         PS3.SetMemory(0x10050024 + ((num2 - 1) * 4), buffer);
  63.                     }
  64.                 }
  65.                 byte[] bytes = BitConverter.GetBytes(uint_1);
  66.                 Array.Reverse(bytes);
  67.                 PS3.SetMemory(0x1005004c, bytes);
  68.                 Thread.Sleep(20);
  69.                 byte[] buffer5 = new byte[4];
  70.                 PS3.GetMemory(0x10050050, buffer5);
  71.                 Array.Reverse(buffer5);
  72.                 return BitConverter.ToInt32(buffer5, 0);
  73.             }
  74.  
  75.             public static void Enable_RPC()
  76.             {
  77.                 PS3.SetMemory(function_address, new byte[] { 0x4e, 0x80, 0, 0x20 });
  78.                 Thread.Sleep(20);
  79.                 byte[] buffer = new byte[] {
  80.                 0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c,
  81.                 0x2c, 12, 0, 0, 0x41, 130, 0, 100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
  82.                 0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
  83.                 0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40,
  84.                 0xc0, 0x63, 0, 0x2c, 0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
  85.                 0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0,
  86.                 0x7d, 0x89, 3, 0xa6, 0x4e, 0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
  87.                 0x90, 0xa4, 0, 0x4c, 0x90, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6,
  88.                 0x38, 0x21, 0, 0x70, 0x4e, 0x80, 0, 0x20
  89.              };
  90.                 PS3.SetMemory(function_address + 4, buffer);
  91.                 PS3.SetMemory(0x10050000, new byte[0x2854]);
  92.                 PS3.SetMemory(function_address, new byte[] { 0xf8, 0x21, 0xff, 0x91 });
  93.                 PS3.SetMemory(0x2100000, new byte[0x20]);
  94.                 PS3.SetMemory(0x2105000, new byte[0x20]);
  95.  
  96.             }
  97.         }
  98.  
  99. { PS3 MW2 1.14 Address & Functions } //Credit - SC58
  100.  
  101.  
  102. 0x002189D8 - Sv_Addtestclient(void)
  103. 0x001ACBE8 - GScr_AddTestClient
  104. 0x00211D98 - SV_AddOperatorCommands(void)
  105. 0x0021F1B0 - SV_AddServerCommand(client_s *client, svscmd_type type, const char *cmd)
  106. 0x002131A8 - SV_MapRestart(int fast_restart)
  107. 0x0021F6A8 - SV_SendServerCommand(client_s *cl, svscmd_type type, const char *fmt)
  108. 0x00212C40 - SV_KickClient(client_s *cl, char *playerName, int maxPlayerNameLen)
  109. 0x0017B830 - ClientCommand(int clientNum)
  110. 0x00215310 - SV_ExecuteClientCommand(client_s *cl, const char *s, int clientOK)
  111. 0x00217880 - SV_DirectConnect(netadr_t from)
  112. 0x001D9270 - SV_Cmd_EndTokenizedString(void)
  113. 0x001DB040 - SV_Cmd_TokenizeString(const char *text_in)
  114. 0x00183DD0 - G_RegisterWeapon(unsigned int weapIndex)
  115. 0x00172508 - PlayerCmd_SetViewmodel(scr_entref_t entref)
  116. 0x00032898 - BG_GetWeaponDef(unsigned int weaponIndex)
  117. 0x00032948 - BG_GetWeaponIndex(WeaponDef *weapDef) (Maybe?)
  118. 0x00032F90 - BG_GetWeaponIndexForName(const char *name, void (__cdecl *regWeap)(unsigned int))
  119. 0x00033140 - CG_GetWeaponIndexForName(const char *name)
  120. 0x0021A0A0 - SV_GameSendServerCommand(int clientNum, svscmd_type type, const char *text)
  121. 0x00168070 - ClientInactivityTimer(gclient_s *client)
  122. 0x001689D8 - ClientThink_real(gentity_s *ent, usercmd_s *ucmd)
  123. 0x0016CF90 - PlayerCmd_giveWeapon(scr_entref_t entref)
  124. 0x00179590 - CheatsOk(gentity_s *ent)
  125. 0x00020D70 - BG_GetPerkIndexForName(const char *perkName)
  126. 0x0021B818 - SV_SetConfigstring(int index, const char *val)
  127. 0x0027E0D0 - va(const char *format)
  128. 0x001D9EC0 - Cbuf_AddText(int localClientNum, const char *text)
  129. 0x001BE3F0 - G_SetModel(gentity_s *ent, const char *modelName)
  130. 0x00277068 - Dvar_GetFloat(const char *dvarName)
  131. 0x00276F60 - Dvar_GetString(const char *dvarName)
  132. 0x00277138 - Dvar_GetBool(const char *dvarName)
  133. 0x002770C8 - Dvar_GetInt(const char *dvarName)
  134. 0x0005EF68 - CG_BoldGameMessage(int localClientNum, const char *msg)
  135. 0x0005EFB0 - CG_GameMessage(int localClientNum, const char *msg)
  136. 0x001C0890 - G_GivePlayerWeapon(playerState_s *pPS, int iWeaponIndex, char altModelIndex)
  137. 0x001BF4A0 - G_GetWeaponIndexForName(const char *name)
  138. 0x0016C148 - ClientDisconnect(int clientNum)
  139. 0x00215310 - SV_ClientCommand(client_s *cl, msg_t *msg)
  140. 0x00215EB0 - SV_ExecuteClientMessage(client_s *cl, msg_t *msg)
  141. 0x00179F88 - G_Say(gentity_s *ent, gentity_s *target, int mode, const char *chatText)
  142. 0x01319780 - g_entity
  143. 0x00013460 - AimTarget_GetTagPos(int localClientNum, centity_s *cent, unsigned int tagName, float *pos)
  144. 0x000116B0 - AimAssist_RegisterDvars
  145. 0x001BCD10 - G_Spawn(void)
  146. 0x001B8310 - G_CallSpawnEntity(gentity_s *ent)
  147. 0x001BE0B8 - G_GetModelIndex
  148. 0x0017B830 - ClientCommand(int clientNum)
  149. 0x00186638 - Add_Ammo(gentity_s *ent, unsigned int weaponIndex, char weaponModel, int count, int fillClip)
  150. 0x00174BF8 - G_InitializeAmmo(gentity_s *pSelf, int weaponIndex, char weaponModel, int hadWeapon)
  151. 0x000329A8 - BG_FindWeaponIndexForName(const char *name)
  152. 0x0016C558 - ClientUserinfoChanged(int clientNum)
  153. 0x0016C450 - ClientCleanName(const char *in, char *out, int outSize)
  154. 0x001BE228 - G_EntAttach(gentity_s *ent, const char *modelName, unsigned int tagName, int ignoreCollision)
  155. 0x0017CBC0 - Player_Die(gentity_s* self, gentity_s* inflictor, gentity_s* attacker, int damage, int meansOfDeath, int WeaponIndex, const float *vDir, int hitLocation, int psTime)
  156.  
  157.  
  158.  
  159. set aim_autoaim_lerp 100
  160. set aim_autoaim_region_height 480
  161. set aim_autoaim_region_width 640
  162. set aim_aimAssistRangeScale 2
  163. set aim_autoAimRangeScale 2
  164. set aim_slowdown_debug 0
  165. set aim_slowdown_region_height 0
  166. set aim_slowdown_region_width 0
  167. set aim_lockon_enabled 1
  168. set aim_lockon_strength 1
  169. set aim_lockon_deflection 0
  170. set aim_autoaim_enabled 0
  171. set aim_slowdown_yaw_scale_ads 0
  172. set aim_slowdown_pitch_scale_ads 0
  173. set aim_slowdown_enabled 1
  174. bind button_rshldr vstr SingleFire
  175. set SingleFire "aim_autoaim_enabled 1;aim_lockon_enabled 1;wait 1;+attack;-attack;wait 1;aim_autoaim_enabled 0"
Add Comment
Please, Sign In to add comment