Post: [RELEASE] [C++] Remote Procedure Call by MsKx & Marentdu93 !
04-18-2016, 09:43 AM #1
MsKx-
Haxor!
(adsbygoogle = window.adsbygoogle || []).push({});
Hello NextGenUpdate
Today I decide to share you the Remote Procedure Call in C++.

Code:
             void RPCEnable(uint func){
unsigned char rpc[4] = { 0x4e, 0x80, 0, 0x20};
unsigned char rpc3[4] = { 0xf8, 0x21, 0xff, 0x91};
unsigned char buffer[136] = {
0x7c, 8, 2, 0xa6, 0xf8, 1, 0, 0x80, 60, 0x60, 0x10, 5, 0x81, 0x83, 0, 0x4c,
0x2c, 12, 0, 0, 0x41, 130, 0, 100, 0x80, 0x83, 0, 4, 0x80, 0xa3, 0, 8,
0x80, 0xc3, 0, 12, 0x80, 0xe3, 0, 0x10, 0x81, 3, 0, 20, 0x81, 0x23, 0, 0x18,
0x81, 0x43, 0, 0x1c, 0x81, 0x63, 0, 0x20, 0xc0, 0x23, 0, 0x24, 0xc0, 0x43, 0, 40,
0xc0, 0x63, 0, 0x2c, 0xc0, 0x83, 0, 0x30, 0xc0, 0xa3, 0, 0x34, 0xc0, 0xc3, 0, 0x38,
0xc0, 0xe3, 0, 60, 0xc1, 3, 0, 0x40, 0xc1, 0x23, 0, 0x48, 0x80, 0x63, 0, 0,
0x7d, 0x89, 3, 0xa6, 0x4e, 0x80, 4, 0x21, 60, 0x80, 0x10, 5, 0x38, 160, 0, 0,
0x90, 0xa4, 0, 0x4c, 0x90, 100, 0, 80, 0xe8, 1, 0, 0x80, 0x7c, 8, 3, 0xa6,
0x38, 0x21, 0, 0x70, 0x4e, 0x80, 0, 0x20
};
ccapi.WriteMemory(func, 0x04, rpc);
Sleep(20);
ccapi.WriteMemory(func + 4,0x88, buffer);
for(uint i = 0x10050000; i<10052854; i++ ){
unsigned char zeros[1] = { 0x00 };
ccapi.WriteMemory(i,sizeof(zeros),zeros);
}
Sleep(30);
ccapi.WriteMemory(func, 0x04, rpc3);
}

int a = 0;
int b = 0;
int c = 0;
template<typename T>
void Write(T val)
{
if(typeid(val) == typeid(int))
{
unsigned char buff[4];
*(T*)buff = val;
std::reverse(buff,buff + 4);
ccapi.WriteMemory(0x10050000 + (a * 4),4, buff);
a++;
}
if(typeid(val) == typeid(char*))
{
ccapi.WriteMemory(0x10050054 + (b * 0x400),strlen((char*)val) + 1,(unsigned char*)val);
ccapi.WriteInt32(0x10050000 + (a * 4),0x10050054 + (b * 0x400));
b++;
}
if(typeid(val) == typeid(float))
{
unsigned char buff[4];
*(T*)buff = val;
std::reverse(buff,buff + 4);
ccapi.WriteMemory(0x10050024 + (c * 4),4, buff);
c++;
}
}

template<typename P1,typename P2,typename P3>
int Call(UINT32 addr,P1 p1 = 0,
P2 p2 = 0,P3 p3 =0)
{
Write(p1);
Write(p2);
if(p3 != NULL){
Write(p3);
}
ccapi.WriteUInt32(0x1005004C,addr);
Sleep(300);
a = 0;
b = 0;
c = 0;
int ptr = ccapi.ReadInt32(0x10050050);
ccapi.WriteInt32(0x1005004C,0x000000);
return ptr;
}

To use our code, you can is to convert it with the CCAPI of Enstone or to use our modified CCAPI.

CCAPI modified: You must login or register to view this content.

Complementary functions.
    uint adress;
uint cbuff;
void SV_GameSendServerCommand(int client, char* command)
{
Call(adress, client, 0, command);
}
void Cbuf_AddText(int client, char* command)
{
Call(cbuff, client, command, NULL);
}

void iPrintln(int clientIndex, const char* Text,char Letter)
{
char cmd[100];
sprintf(cmd, "%c \"%s\"", Letter, Text );
SV_GameSendServerCommand(clientIndex, cmd);
}
void iPrintBold(int clientIndex, const char* Text,char Letter)
{

char cmd[100];
sprintf(cmd, "%c \"%s\"", Letter, Text );
SV_GameSendServerCommand(clientIndex, cmd);

}

Here we are! Smile
Enjoy, please and do not forget the credits if you use our scripts.

For help you can add me on skype: mskx.dev


Credits: Marentdu93, Milky444, MsKx

Cordially,
MsKx
04-21-2016, 08:55 AM #2
MsKx-
Haxor!
Originally posted by iVanTura
Damn Noob, you didn't even put milky4444 in credits
You must login or register to view this content.


I have put in credits.... You must login or register to view this content.

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo