Just yesterday the source i have been using started disconnecting.(it is a mixture of multiple hotkey hack sources and whatever else i have found) It disconnects when the runningman stops running. It was working until today. Everything builds just fine. It has semi-opk and semi telekill in it. I removed some random lines and edited it so people won't be able to c+p it into their hack. Both the semi opk and telekill were working before it started disconnecting. I have tried using different ptc methods and using an alt ltc but it still disconnects right after the running man. I'm just a beginner coder so i'm not capable of fixing more advanced errors that the compiler misses. If anyone could help me get it working again i'd greatly appreciate it. I also labeled what parts of the semi opk and semi telekill i removed and edited. Nothing that isn't posted somewhere else on mpgh is c+p friendly in this source. Please don't flame at me unless i am breaking a rule.
Code:
#include <windows.h>
#define charposoffset 0x66F34 //player pointer
#define otherplyrptr 0x37828110 //RPP
#define posyoffset 0xCC
#define yoffset 0xCC
DWORD posptr;
DWORD posy;
DWORD playertarget;
DWORD clientfx = (DWORD) GetModuleHandleA("ClientFX.fxd");
bool IsGameReadyForHook()
{
if( GetModuleHandleA( "d3d9.dll" ) != NULL
&& GetModuleHandleA( "ClientFX.fxd" ) != NULL
&& GetModuleHandleA( "CShell.dll" ) != NULL )
return true;
return false;
}
bool Memoria( void * pDest, char * szPatch, size_t sSize )
{
DWORD dwOrgProtect = NULL;
if ( !VirtualProtect ( pDest, sSize, PAGE_EXECUTE_READWRITE, &dwOrgProtect ))
return FALSE;
memcpy( pDest, szPatch, sSize );
VirtualProtect( pDest, sSize, dwOrgProtect, NULL );
return TRUE;
}
void *DetourFunction (BYTE *src, const BYTE *dst, const int len)
{
BYTE *jmp;
DWORD dwback;
DWORD jumpto, newjump;
VirtualProtect(src,len,PAGE_READWRITE,&dwback);
if(src[0] == 0xE9)
{
jmp = (BYTE*)malloc(10);
jumpto = (*(DWORD*)(src+1))+((DWORD)src)+5;
newjump = (jumpto-(DWORD)(jmp+5));
jmp[0] = 0xE9;
*(DWORD*)(jmp+1) = newjump;
jmp += 5;
jmp[0] = 0xE9;
*(DWORD*)(jmp+1) = (DWORD)(src-jmp);
}
else
{
jmp = (BYTE*)malloc(5+len);
memcpy(jmp,src,len);
jmp += len;
jmp[0] = 0xE9;
*(DWORD*)(jmp+1) = (DWORD)(src+len-jmp)-5;
}
src[0] = 0xE9;
*(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
for(int i = 5; i < len; i++)
src[i] = 0x90;
VirtualProtect(src,len,dwback,&dwback);
return (jmp-len);
}
void __cdecl PushToConsole(const char* szCommand )
{
DWORD dwCShell = (DWORD)GetModuleHandleA("CShell.dll");
if( dwCShell != NULL )
{
DWORD *LTClient = ( DWORD* )( 0x377E7810 );
void* CONoff = ( void* )*( DWORD* )( *LTClient + 0x208 );
__asm
{
push szCommand;
call CONoff;
add esp, 4;
}
}
}
void main()
{
////MessageBoxA(NULL,")","",MB_OK);
while (!IsGameReadyForHook()){
Sleep(20);
}
bool nxchams = false;
bool boxes = false;
bool norecoil = false;
bool pickup = false;
bool nospread = false;
bool crosshair = false;
bool removals = false;
bool speed = false;
bool fps = false;
bool panic = false;
bool jump = false;
bool reload = false;
bool vup = false;
bool vdown = false;
while(true){
if(GetAsyncKeyState(VK_NUMPAD0)<0){
if(fps){
PushToConsole("ShowFps 1");
fps= false;
} else {
PushToConsole("ShowFps 0");
fps = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD1)<0){
if(nxchams){
PushToConsole("SkelModelStencil 0");
nxchams = false;
} else {
PushToConsole("SkelModelStencil 1");
nxchams = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD2)<0){
if(boxes){
PushToConsole("FullBright 0");
boxes = false;
} else {
PushToConsole("FullBright 1");
boxes = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD3)<0){
if(removals){
PushToConsole("FogEnable 1");
PushToConsole("DynamicLight 1 ");
PushToConsole("EnableWeatherFX 1");
PushToConsole("MuzzleLight 1");
PushToConsole("SnowEnable 1");
PushToConsole("CamDamage 1");
PushToConsole("DrawParticles 1");
removals = false;
} else {
PushToConsole("DrawParticles 0");
PushToConsole("FogEnable 0");
PushToConsole("DynamicLight 0 ");
PushToConsole("EnableWeatherFX 0");
PushToConsole("MuzzleLight 0");
PushToConsole("CamDamage 0");
removals = true;
;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD4)<0){
if(norecoil){
norecoil = false;
} else {
norecoil = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD5)<0){
if(nospread){
PushToConsole("PerturbRotationEffect 3.000000");
PushToConsole("PerturbIncreaseSpeed 3.000000");
PushToConsole("FireMovePerturb 9.000000");
PushToConsole("PerturbWalkPercent 0.500000");
PushToConsole("PerturbDecreaseSpeed 9.000000");
PushToConsole("PerturbRecoil 9.000000");
PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
PushToConsole("ZoomedFireMovePerturb 9.000000");
PushToConsole("ZoomedFireDuckPerturb 9.000000");
nospread = false;
} else {
PushToConsole( "PerturbRotationEffect 0.000000" );
PushToConsole( "PerturbIncreaseSpeed 0.000000" );
PushToConsole( "PerturbWalkPercent 0.000000" );
PushToConsole( "PerturbFiringIncreaseSpeed 0.000000" );
PushToConsole( "PerturbRecoil 0.000000" );
PushToConsole( "FireMovePerturb 0.000000" );
PushToConsole( "ZoomedFireMoveDuckPerturb 0.000000" );
PushToConsole( "ZoomedFireMovePerturb 0.000000" );
PushToConsole( "ZoomedFireDuckPerturb 0.000000" );
nospread = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD6)<0){
if(pickup){
PushToConsole("ActivationDistance 100");
pickup = false;
} else {
PushToConsole("ActivationDistance 1000000");
pickup = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD7)<0){
if(speed){
PushToConsole("StartAccel 500.000000");
PushToConsole("MaxAccel 3000.000000");
PushToConsole("AccelInc 6000.000000");
PushToConsole("WalkVel 70.000000");
PushToConsole("FRunVel 285.000000");
PushToConsole("BRunVel 285.000000");
PushToConsole("SRunVel 285.000000");
speed = false;
} else {
PushToConsole("BaseMoveAccel 3000.000000");
PushToConsole("StartAccel 3000.000000");
PushToConsole("MaxAccel 3000.000000");
PushToConsole("AccelInc 3000.000000");
PushToConsole("WalkVel 3000.000000");
PushToConsole("FRunVel 3000.000000");
PushToConsole("BRunVel 3000.000000");
PushToConsole("SRunVel 3000.000000");
speed = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD8)<0){
if(jump){
PushToConsole("JumpVel 300.000000");
jump = false;
} else {
PushToConsole("JumpVel 900.000000");
jump = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_PRIOR)<0){
if(vup){
PushToConsole("CamMaxPosYOffset 200.000000");
vup = false;
} else {
PushToConsole("DuckDownCamOffSet 1000.000000");
vup = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NUMPAD9)<0){
if(crosshair){
PushToConsole("CrossHair_DefaultLength 10");
PushToConsole("CrossHair_DefaultGapLength 1");
PushToConsole("CrosshairGapMin 0");
PushToConsole("CrosshairGapMax 2");
PushToConsole("CrosshairBarMin 10");
PushToConsole("CrosshairBarMax 10");
PushToConsole("HitCrossHairMAXPerturb 0");
PushToConsole("HitCrossHairMINPerturb 0");
PushToConsole("HitCrossHairSize 0");
PushToConsole("CrossHair_FiringDuration 0");
crosshair = false;
} else {
PushToConsole("CrossHair_DefaultLength 50");
PushToConsole("CrossHair_DefaultGapLength -15");
PushToConsole("CrosshairGapMin -15");
PushToConsole("CrosshairGapMax -15");
PushToConsole("CrosshairBarMin 100");
PushToConsole("CrosshairBarMax 100");
PushToConsole("HitCrossHairMAXPerturb 0");
PushToConsole("HitCrossHairMINPerturb 0");
PushToConsole("HitCrossHairSize 0");
PushToConsole("CrossHair_FiringDuration 0");
crosshair = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_NEXT)<0){
if(vdown){
PushToConsole("DuckDownCamOffSet -13.000000");
vdown = false;
} else {
PushToConsole("CamMaxPosYOffset -1000.000000");
vdown = true;
}
Sleep(200);
}
if(GetAsyncKeyState(VK_DELETE)<0){
if(panic){
panic = false;
} else {
PushToConsole("ActivationDistance 100");
PushToConsole("CrossHair_DefaultLength 10");
PushToConsole("CrossHair_DefaultGapLength 1");
PushToConsole("CrosshairGapMin 0");
PushToConsole("CrosshairGapMax 2");
PushToConsole("CrosshairBarMin 10");
PushToConsole("CrosshairBarMax 10");
PushToConsole("HitCrossHairMAXPerturb 0");
PushToConsole("HitCrossHairMINPerturb 0");
PushToConsole("HitCrossHairSize 0");
PushToConsole("CrossHair_FiringDuration 0");
PushToConsole("JumpVel 300.000000");
PushToConsole("ActivationDistance 100");
PushToConsole("StartAccel 500.000000");
PushToConsole("MaxAccel 3000.000000");
PushToConsole("AccelInc 6000.000000");
PushToConsole("WalkVel 70.000000");
PushToConsole("FRunVel 285.000000");
PushToConsole("BRunVel 285.000000");
PushToConsole("SRunVel 285.000000");
PushToConsole( "ReloadSpeed 1.000000" );
PushToConsole("PerturbRotationEffect 3.000000");
PushToConsole("PerturbIncreaseSpeed 3.000000");
PushToConsole("FireMovePerturb 9.000000");
PushToConsole("PerturbWalkPercent 0.500000");
PushToConsole("PerturbDecreaseSpeed 9.000000");
PushToConsole("PerturbRecoil 9.000000");
PushToConsole("ZoomedFireMoveDuckPerturb 9.000000");
PushToConsole("ZoomedFireMovePerturb 9.000000");
PushToConsole("ZoomedFireDuckPerturb 9.000000");
PushToConsole("FogEnable 1");
PushToConsole("DynamicLight 1 ");
PushToConsole("EnableWeatherFX 1");
PushToConsole("MuzzleLight 1");
PushToConsole("SnowEnable 1");
PushToConsole("CamDamage 1");
PushToConsole("ModelApplySun 1");
PushToConsole("ModelShadow_Proj_Enable 1");
PushToConsole("DebrisFXLevel 1");
PushToConsole("ScatterEnable 1");
PushToConsole("modelshadow_proj_blurenable 1");
PushToConsole("ModelShadow_Proj_MinColorComponent 1");
PushToConsole("ModelShadow_Proj_MaxProjDist 1 ");
PushToConsole("ModelDebug_DrawBoxes 0");
PushToConsole("SkelModelStencil 0");
PushToConsole("ShowFps 0");
PushToConsole("CamMaxPosYOffset 0.000000");
PushToConsole("DrawParticles 1");
panic = true;
}
Sleep(200);
}
Sleep(20);
}
}
DWORD WINAPI OPKSTARTUP(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(800);
OPK();
return 0;
}
DWORD WINAPI dwHackThread(LPVOID)
{
while( !IsGameReadyForHook() )
Sleep(100);
main();
return 0;
}
BOOL WINAPI DllMain ( HMODULE hDll, DWORD dwReason, LPVOID lpReserved )
{
DisableThreadLibraryCalls(hDll);
if ( dwReason == DLL_PROCESS_ATTACH )
{
CreateThread(NULL, NULL, dwHackThread, NULL, NULL, NULL);
CreateThread(NULL, NULL, OPKSTARTUP, NULL, NULL, NULL);
}
return TRUE;
}