Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //ORIGINAL SOURCE: http://pastebin.com/2bWDX4E6#
- //Mw3 RPC Class
- public static class RPC
- {
- #region RPC
- public static uint func_address = 0x0277208; //FPS Address 1.24
- /*
- * MW3 FPS RPC by VezahMoDz!
- * This function get written at the FPS Offset!
- *
- lis r28, 0x1005
- lwz r12, 0x48(r28)
- cmpwi r12, 0
- beq loc_277290
- lwz r3, 0x00(r28)
- lwz r4, 0x04(r28)
- lwz r5, 0x08(r28)
- lwz r6, 0x0C(r28)
- lwz r7, 0x10(r28)
- lwz r8, 0x14(r28)
- lwz r9, 0x18(r28)
- lwz r10, 0x1C(r28)
- lwz r11, 0x20(r28)
- lfs f1, 0x24(r28)
- lfs f2, 0x28(r28)
- lfs f3, 0x2C(r28)
- lfs f4, 0x30(r28)
- lfs f5, 0x34(r28)
- lfs f6, 0x38(r28)
- lfs f7, 0x3C(r28)
- lfs f8, 0x40(r28)
- lfs f9, 0x44(r28)
- mtctr r12
- bctrl
- li r4, 0
- stw r4, 0x48(r28)
- stw r3, 0x4C(r28)
- stfs f1, 0x50(r28)
- b loc_277290
- */
- public static uint GetFuncReturn()
- {
- byte[] ret = new byte[4];
- GetMemoryR(0x114AE64, ref ret);
- Array.Reverse(ret);
- return BitConverter.ToUInt32(ret, 0);
- }
- private static void GetMemoryR(uint Address, ref byte[] Bytes)
- {
- PS3.GetMemory(Address, Bytes);
- }
- public static void Enable()
- {
- if (PS3.Extension.ReadByte(0x27720C) == 0x80)
- {
- byte[] WritePPC = new byte[] {0x3F,0x80,0x10,0x05,0x81,0x9C,0x00,0x48,0x2C,0x0C,0x00,0x00,0x41,0x82,0x00,0x78,
- 0x80,0x7C,0x00,0x00,0x80,0x9C,0x00,0x04,0x80,0xBC,0x00,0x08,0x80,0xDC,0x00,0x0C,
- 0x80,0xFC,0x00,0x10,0x81,0x1C,0x00,0x14,0x81,0x3C,0x00,0x18,0x81,0x5C,0x00,0x1C,
- 0x81,0x7C,0x00,0x20,0xC0,0x3C,0x00,0x24,0xC0,0x5C,0x00,0x28,0xC0,0x7C,0x00,0x2C,
- 0xC0,0x9C,0x00,0x30,0xC0,0xBC,0x00,0x34,0xC0,0xDC,0x00,0x38,0xC0,0xFC,0x00,0x3C,
- 0xC1,0x1C,0x00,0x40,0xC1,0x3C,0x00,0x44,0x7D,0x89,0x03,0xA6,0x4E,0x80,0x04,0x21,
- 0x38,0x80,0x00,0x00,0x90,0x9C,0x00,0x48,0x90,0x7C,0x00,0x4C,0xD0,0x3C,0x00,0x50,
- 0x48,0x00,0x00,0x14};
- PS3.SetMemory(func_address, new byte[] { 0x41 });
- PS3.SetMemory(func_address + 4, WritePPC);
- PS3.SetMemory(func_address, new byte[] { 0x40 });
- Thread.Sleep(10);
- RPC.DestroyAll();
- }
- else
- {
- }
- }
- public static Int32 Call(UInt32 address, params Object[] parameters)
- {
- Int32 length = parameters.Length;
- Int32 index = 0;
- UInt32 count = 0;
- UInt32 Strings = 0;
- UInt32 Single = 0;
- UInt32 Array = 0;
- while (index < length)
- {
- if (parameters[index] is Int32)
- {
- PS3.Extension.WriteInt32(0x10050000 + (count * 4), (Int32)parameters[index]);
- count++;
- }
- else if (parameters[index] is UInt32)
- {
- PS3.Extension.WriteUInt32(0x10050000 + (count * 4), (UInt32)parameters[index]);
- count++;
- }
- else if (parameters[index] is Int16)
- {
- PS3.Extension.WriteInt16(0x10050000 + (count * 4), (Int16)parameters[index]);
- count++;
- }
- else if (parameters[index] is UInt16)
- {
- PS3.Extension.WriteUInt16(0x10050000 + (count * 4), (UInt16)parameters[index]);
- count++;
- }
- else if (parameters[index] is Byte)
- {
- PS3.Extension.WriteByte(0x10050000 + (count * 4), (Byte)parameters[index]);
- count++;
- }
- else
- {
- UInt32 pointer;
- if (parameters[index] is String)
- {
- pointer = 0x10052000 + (Strings * 0x400);
- PS3.Extension.WriteString(pointer, Convert.ToString(parameters[index]));
- PS3.Extension.WriteUInt32(0x10050000 + (count * 4), pointer);
- count++;
- Strings++;
- }
- else if (parameters[index] is Single)
- {
- WriteSingle(0x10050024 + (Single * 4), (Single)parameters[index]);
- Single++;
- }
- else if (parameters[index] is Single[])
- {
- Single[] Args = (Single[])parameters[index];
- pointer = 0x10051000 + Array * 4;
- WriteSingle(pointer, Args);
- PS3.Extension.WriteUInt32(0x10050000 + count * 4, pointer);
- count++;
- Array += (UInt32)Args.Length;
- }
- }
- index++;
- }
- PS3.Extension.WriteUInt32(0x10050048, address);
- Thread.Sleep(20);
- return PS3.Extension.ReadInt32(0x1005004c);
- }
- public static void DestroyAll()
- {
- Byte[] clear = new Byte[0xB4 * 1024];
- PS3.SetMemory(0xF0E10C, clear);
- }
- #endregion
- #region WriteSingle & ReverseBytes [Needed For RPC]
- public static void WriteSingle(uint address, float[] input)
- {
- int length = input.Length;
- byte[] array = new byte[length * 4];
- for (int i = 0; i < length; i++)
- {
- ReverseBytes(BitConverter.GetBytes(input[i])).CopyTo(array, (int)(i * 4));
- }
- PS3.SetMemory(address, array);
- }
- public static void WriteSingle(uint address, float input)
- {
- byte[] numArray = new byte[4];
- BitConverter.GetBytes(input).CopyTo(numArray, 0);
- Array.Reverse(numArray, 0, 4);
- PS3.SetMemory(address, numArray);
- }
- private static byte[] ReverseBytes(byte[] inArray)
- {
- Array.Reverse(inArray);
- return inArray;
- }
- #endregion
- #region Clone Player
- public static void clonePlayer(Int32 client)
- {
- RPC.Call(0x180F48, new Object[] { client << 16 });
- }
- #endregion
- #region PlayerFX
- public static uint PlayFX(float[] Origin, int EffectIndex)
- {
- uint ent = (uint)RPC.Call(0x1C0B7C, Origin, 0x56); //G_Temp
- PS3.Extension.WriteInt32(ent + 0xA0, EffectIndex);
- PS3.Extension.WriteInt32(ent + 0xD8, 0);
- PS3.Extension.WriteFloat(ent + 0x40, 0f);
- PS3.Extension.WriteFloat(ent + 0x44, 0f);
- PS3.Extension.WriteFloat(ent + 0x3C, 270f);
- return ent;
- }
- #endregion
- #region Cbuf_AddText
- public static void CBuf_AddText(int client, string command)
- {
- Call(Addresses.CBuf_AddText, (uint) client,command);
- }
- #endregion
- #region SV_GameSendServerCommand
- public static void SV_GameSendServerCommand(int client, string command)
- {
- Call(Addresses.SV_GameSendServerCommand, (uint)client, 0,command);
- }
- #endregion
- #region iPrintln
- public static void iPrintln(int client, string Text)
- {
- SV_GameSendServerCommand(client, "f \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region iPrintlnBold
- public static void iPrintlnBold(int client, string Text)
- {
- SV_GameSendServerCommand(client, "c \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region Set_ClientDvar
- public static void Set_ClientDvar(int client, string Text)
- {
- SV_GameSendServerCommand(client, "q \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region Fov
- public static void Fov(int client, string Text)
- {
- SV_GameSendServerCommand(client, "q \"cg_fov \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region Vision
- public static void Vision(int client, string Text)
- {
- SV_GameSendServerCommand(client, "J \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region KickWithError
- public static void Kick(int client, string Text)
- {
- SV_GameSendServerCommand(client, "r \"" + Text + "\"");
- Thread.Sleep(20);
- }
- #endregion
- #region GiveWeapon
- public static void GiveWeapon(int client, int weapon,int akimbo)
- {
- Call(Addresses.G_GivePlayerWeapon, (uint)G_ClientFunction(client), (uint)weapon, 0);
- Call(Addresses.Add_Ammo, (uint)(Addresses.G_Entity + (client * 0x280)), (uint)weapon, 0, 9999, 1);
- }
- #endregion
- #region G_ClientFunction
- public static uint G_ClientFunction(int client)
- {
- return Addresses.G_Client + ((uint)client * 0x3980);
- }
- #endregion
- #region SetModel
- public static void SetModel(int client, string model)
- {
- Call(Addresses.G_SetModel, (uint)(Addresses.G_Entity + (client * 640)), model);
- }
- #endregion
- #region Cmd_ExecuteSingleCommand
- public static void Cmd_ExecuteSingleCommand(uint client, string command)
- {
- Call(Addresses.Cmd_ExecuteSingleCommand, (uint)client, command);
- }
- #endregion
- #region G_EntityFunction
- public static UInt32 G_EntityFunction(Int32 clientIndex, UInt32 Mod = 0)
- {
- return ((0xfca280 + Mod) + ((UInt32)(0x280 * clientIndex)));
- }
- #endregion
- #region GiveWeapon
- public static void G_GivePlayerWeapon(int client,int ammo, int weapon, int akimbo)
- {
- for (int i = 0; i < 18; i++)
- {
- long GClients = Addresses.G_Client + (i * 0x3980);
- Call(Addresses.G_GivePlayerWeapon, GClients, (uint)weapon, akimbo);
- Call(Addresses.Add_Ammo, (uint)(Addresses.G_Entity + (i * 640)), (uint)weapon, 0, ammo, 1);
- Call(Addresses.SV_GameSendServerCommand, i, 0, "a \"" + weapon + "\"");
- }
- long GClient = Addresses.G_Client + (client * 0x3980);
- Call(Addresses.G_GivePlayerWeapon, GClient, (uint)weapon, akimbo);
- Call(Addresses.Add_Ammo, (uint)(Addresses.G_Entity + (client * 0x280)), (uint)weapon, 0, ammo, 1);
- Call(Addresses.SV_GameSendServerCommand, client, 0, "a \"" + weapon + "\"");
- }
- #endregion
- }
- #region Addresses
- public static class Addresses
- {
- public static uint
- G_Client = 0x110A280,
- g_client = 0x110A280,
- G_ClientIndex = 0x3980,
- EntityIndex = 0x280,
- G_Entity = 0xFCA280,
- MapBrushModel = 0x7F80,
- BG_GetPerkIndexForName = 0x210B0,
- BG_GetNumWeapons = 0x3CFBC,
- BG_FindWeaponIndexForName = 0x3CFD0,
- BG_GetWeaponIndexForName = 0x3D434,
- BG_GetViewModelWeaponIndex = 0x3D7D8,
- Cmd_ExecuteSingleCommand = 0x1DB240,
- BG_WeaponFireRecoil = 0x3FBD0,
- CG_FireWeapon = 0xBE498,
- Key_IsDown = 0xD1CD8,
- Key_StringToKeynum = 0xD1D18,
- Key_IsValidGamePadChar = 0xD1E64,
- Key_KeyNumToString = 0xD1EA4,
- Key_Unbind_f = 0xD2368,
- Key_Bind_f = 0xD247C,
- BG_TakePlayerWeapon = 0x1C409C,
- G_GivePlayerWeapon = 0x1C3034,
- SV_GameSendServerCommand = 0x228FA8,
- SV_GetConfigString = 0x22A4A8,
- SV_SetConfigString = 0x22A208,
- va = 0x299490,
- G_SetModel = 0x1BEF5C,
- G_LocalizedStringIndex = 0x1BE6CC,
- G_MaterialIndex = 0x1BE744,
- G_ModelIndex = 0x1BE7A8,
- G_ModelName = 0x1BE8A0,
- Add_Ammo = 0x18A29C,
- PlayerCmd_SetPerk = 0x17EBE8,
- G_Damage = 0x183E18,
- G_RadiusDamage = 0x185600,
- G_GetClientScore = 0x18EA74,
- G_GetClientDeaths = 0x18EA98,
- Cmd_AddCommandInternal = 0x1DC4FC,
- CBuf_AddText /*(int localClientNum, const char *text)*/ = 0x001DB240,
- SV_SendDisconnect /*(client_s *client, int state, const char *reason)*/ = 0x0022472C,
- SV_SendClientGameState /*(client_s *client)*/ = 0x002284F8,
- SV_KickClient /*(client_s *cl, char *playerName, int maxPlayerNameLen)*/ = 0x00223BD0,
- G_CallSpawnEntity /*(gentity_s *ent)*/ = 0x001BA730,
- Player_Die /*(unsigned int *self, unsigned int *inflictor, unsigned int *attacker, int damage, int meansOfDeath, int iWeapon, const float *vDir, unsigned int hitLoc, int psTimeOffset)*/ = 0x00183748,
- SV_DropClient /*(client_s *drop, const char *reason, bool tellThem)*/ = 0x002249FC,
- SV_SendServerCommand /*(client_s *,svscmd_type,char const *,...)*/ = 0x0022CEBC,
- Scr_Notify /*(gentity_s *ent, unsigned __int16 stringValue, unsigned int paramcount)*/ = 0x001BB1B0,
- Sv_SetGametype /*(void)*/ = 0x00229C1C,
- Sv_Maprestart /*(int fast_restart)*/ = 0x00223774,
- sv_maprestart_f = 0x00223B20,
- sv_spawnsever /*(const char *server)*/ = 0x0022ADF8,
- sv_map_f = 0x002235A0,
- sv_matchend /*(void)*/ = 0x0022F7A8,
- R_AddCmdDrawText /*(const char *text, int maxChars, void *font, float x, float y, float xScale, float yScale, float rotation, const float *color, int style)*/ = 0x00393640,
- R_RegisterFont /*(char* asset, int imagetrack)*/ /*(const char *name, int imageTrack)*/ = 0x003808B8,
- R_AddCmdDrawStretchPic /*(float x, float y, float w, float h, float xScale, float yScale, float xay, float yay, const float *color, int material)*/ = 0x00392D78,
- CL_DrawTextHook /*(const char *text, int maxChars, void *font, float x, float y, float xScale, float yScale, const float *color, int style)*/ = 0x000D93A8,
- R_AddCmdDrawTextWithEffects /*(char const *,int,Font_s *,float,float,float,float,float,float const * const,int,float const * const,Material *,Material *,int,int,int,int)*/ = 0x003937C0,
- CG_BoldGameMessage /*(int LocalClientNum, const char *Message)*/ = 0x0007A5C8,
- UI_FillRectPhysical /*(float x, float y, float width, float height, const float *color)*/ = 0x0023A810,
- UI_DrawLoadBar /*(ScreenPlacement *scrPlace, float x, float y, float w, float h, int horzAlign, int vertAlign, const float *color, Material *material)*/ = 0x0023A730,
- Scr_MakeGameMessage /*(int iClientNum, const char *pszCmd)*/ = 0x001B07F0,
- Scr_ConstructMessageString /*(int firstParmIndex, int lastParmIndex, const char *errorContext, char *string, unsigned int stringLimit)*/ = 0x001B04F4,
- R_NormalizedTextScale /*(Font_s *font, float scale)*/ = 0x003808F0,
- TeleportPlayer /*(gentity_s *player, float *origin, float *angles)*/ = 0x00191B00,
- CL_DrawText /*(ScreenPlacement *scrPlace, const char *text, int maxChars, Font_s *font, float x, float y, int horzAlign, int vertAlign, float xScale, float yScale, const float *color, int style)*/ = 0x000D9490,
- CL_DrawTextRotate /*(ScreenPlacement *scrPlace, const char *text, int maxChars, Font_s *font, float x, float y, float rotation, int horzAlign, int vertAlign, float xScale, float yScale, const float *color, int style)*/ = 0x000D9554,
- SV_GameDropClient /*(int clientNum, const char *reason)*/ = 0x00229020,
- Dvar_GetBool /*(const char *dvarName)*/ = 0x00291060,
- Dvar_GetInt /*(const char *dvarName)*/ = 0x002910DC,
- Dvar_GetFloat /*(const char *dvarName)*/ = 0x00291148,
- Dvar_RegisterBool /*(const char *dvarName, bool value, unsigned __int16 flags, const char *description)*/ = 0x002933F0,
- Dvar_IsValidName /*(const char *dvarName)*/ = 0x0029019C,
- Material_RegisterHandle /*(const char *name, int imageTrack)*/ = 0x0038B044,
- CL_RegisterFont /*(const char *fontName, int imageTrack)*/ = 0x000D9734,
- SetClientViewAngle /*(gentity_s *ent, const float *angle)*/ = 0x001767E0,
- R_RegisterDvars /*(void)*/ = 0x0037E420,
- PlayerCmd_SetClientDvar /*(scr_entref_t entref)*/ = 0x0017CB4C,
- Jump_RegisterDvars /*(void)*/ = 0x00018E20,
- AimTarget_RegisterDvars = 0x00012098,
- G_FreeEntity /*(gentity_s *ed)*/ = 0x001C0840,
- G_EntUnlink /*(gentity_s *ent)*/ = 0x001C4A5C,
- SV_DObjGetTree /*(gentity_s *ent)*/ = 0x00229A68,
- BG_GetEntityTypeName /*(const int eType)*/ = 0x0001D1F0,
- CL_GetClientState /*(int localClientNum, uiClientState_s *state)*/ = 0x000E26A8,
- CL_GetConfigString /*(int localClientNum, int configStringIndex)*/ = 0x000C5E7C,
- Info_ValueForKey /*(const char *s, const char *key)*/ = 0x00299604,
- Scr_GetInt /*(unsigned int index)*/ = 0x002201C4,
- ClientSpawn /*(gentity_s *ent, const float *spawn_origin, const float *spawn_angles)*/ = 0x00177468,
- Sv_ClientCommand /*(client_s *cl, msg_t *msg)*/ = 0x00228178,
- Sv_ExecuteClientMessage /*(client_s *cl, msg_t *msg)*/ = 0x00228B50,
- Sv_ExecuteClientCommand /*(client_s *cl, const char *s, int clientOK)*/ = 0x00182DEC,
- ClientCommand /*(int clientNum)*/ = 0x00182440,
- CalculateRanks /*(void)*/ = 0x0019031C,
- ClientScr_SetScore /*(gclient_s *pSelf, client_fields_s *pField)*/ = 0x00176150,
- ClientScr_SetMaxHealth /*(gclient_s *pSelf, client_fields_s *pField)*/ = 0x00176094,
- Sv_ReceiveStats /*(netadr_t from, msg_t *msg)*/ = 0x002244E0,
- ClientConnect /*(int clientNum, unsigned __int16 scriptPersId)*/ = 0x001771A0,
- Sv_DirectConnect /*(netadr_t from)*/ = 0x00255BB4,
- Sv_SetConfigstring /*(int index, const char *val)*/ = 0x0022A208,
- Sv_AddServerCommand /*(client_s *client, svscmd_type type, const char *cmd)*/ = 0x0022CBA0,
- IntermissionClientEndFrame /*(gentity_s *ent)*/ = 0x001745F8,
- memset = 0x0049B928,
- str_pointer = 0x523b30,
- g_gametype = 0x8360d5;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement