WarRock EU - Code Snippets

09/27/2011 17:02 Neqqa™#5266
Quote:
du schreibst da 20 drawtext funktionen hin und und jeder ne andere farbe + buchstabe?
naja das wäre auch mein Plan B gewesen :D

aber gibt es denn nichts einfacheres :D
09/27/2011 17:09 Angel-Piece#5267
Quote:
Originally Posted by Neqqa™ View Post
naja das wäre auch mein Plan B gewesen :D

aber gibt es denn nichts einfacheres :D
mache in bild^^
09/27/2011 17:15 Neqqa™#5268
mhm stimmt auch wieder :D

wäre auch ne Möglichkeit^^

aber dann muss ich wieder die spirited Menu Zeugs einfügen :D
09/27/2011 17:32 Raz9r#5269
Quote:
Originally Posted by Neqqa™ View Post
mhm stimmt auch wieder :D

wäre auch ne Möglichkeit^^

aber dann muss ich wieder die spirited Menu Zeugs einfügen :D
Schau dir an, was deine DrawText Funktion macht - und schreib dir eine eigene, modifizierte Version, die die Farbe bei Erhöhung des Pointers auf den Text verändert.
09/28/2011 14:50 St4nDbY#5270
Ich hätte hier mal die Source vom Aimbot hab nix gefunden aber man kann ja schlecht alle seiten hier nachsschauen

Viel Spaß damit.

Quote:
void Aimbot(void)
{
if (g_pBase->local)
{
for(int i = 0; i < 32; i++)
{
int NearestPlayer = GetNearestPlayer();
CPlayerInfo *pInfo = GetPlayerInfoByIndex(i);
CPlayerInfo *pLocalInfo = GetPlayerInfoByIndex(g_pBase->local->index);


if (CH_Aimbot)
{
CH_NoRecoil = 1;


if (CH_AimKey == 1 )
{
if (g_pLocal)
{
g_pLocal->yaw = CalculateYaw(g_pBase->local, g_pBase->player[NearestPlayer]);
g_pLocal->pitch = CalculatePitch(g_pBase->local, g_pBase->player[NearestPlayer]);
}
if (CH_Telekill)
{
g_pBase->local->pos1 = g_pBase->player[NearestPlayer]->pos1;
g_pBase->local->pos3 = g_pBase->player[NearestPlayer]->pos3;
g_pBase->local->pos2 = g_pBase->player[NearestPlayer]->pos2;
}
}

if (CH_AimKey == 2 )
{
if (GetAsyncKeyState(VK_LBUTTON))
{
if (g_pLocal)
{
g_pLocal->yaw = CalculateYaw(g_pBase->local, g_pBase->player[NearestPlayer]);
g_pLocal->pitch = CalculatePitch(g_pBase->local, g_pBase->player[NearestPlayer]);
}
if (CH_Telekill)
{
g_pBase->local->pos1 = g_pBase->player[NearestPlayer]->pos1;
g_pBase->local->pos3 = g_pBase->player[NearestPlayer]->pos3;
g_pBase->local->pos2 = g_pBase->player[NearestPlayer]->pos2;
}
}
}
if (CH_AimKey == 3 )
{
if (GetAsyncKeyState(VK_RBUTTON))
{
if (g_pLocal)
{
g_pLocal->yaw = CalculateYaw(g_pBase->local, g_pBase->player[NearestPlayer]);
g_pLocal->pitch = CalculatePitch(g_pBase->local, g_pBase->player[NearestPlayer]);
}
if (CH_Telekill)
{
g_pBase->local->pos1 = g_pBase->player[NearestPlayer]->pos1;
g_pBase->local->pos3 = g_pBase->player[NearestPlayer]->pos3;
g_pBase->local->pos2 = g_pBase->player[NearestPlayer]->pos2;
}
}
}



int GetLocalPlayerIndex()
{
DWORD *dwServPtr = (DWORD*)ADR_ServerPointer;
return *(int*)((*dwServPtr) + 0x160EC);
}



#define STANDS 0x01
#define PRONES 0x02
#define MOVING 0x03
#define KNEES 0x04
#define RUNS 0x05
#define JUMPS 0x06
#define ROLLS 0x07

#define PI_SQUARED2 9.869604401f
#define PI_SQUARED3 9.8696044010893586188344909998762f
#define PI_SQUARED 3.14159265f
#define PI 3.14159265f


BYTE GetState(CPlayer* pPlayer)
{
BYTE status = pPlayer->state;
BYTE status2 = pPlayer->state2;

if(status == 0x47)
return STANDS;

if(status == 0x38 || status == 0x3b || status == 0x3b || status == 0x3e || status == 0x3c)
return PRONES;

if(status == 0x4b || status == 0x4a || status == 0x4c || status == 0x4d)
return MOVING;

if(status == 0x57 || status == 0x5d || status == 0x5c || status == 0x5e || status == 0x5f)
return KNEES;

if(status == 0x46)
return RUNS;

if(status == 0x54)
return JUMPS;

if(status == 0x25)
return ROLLS;


}


//D3D Methods
float PitchCorrection = 0.0f;

int GetNearestPlayer()
{
float Distance = 0.0f;
float minDistance = 10000000.0f;
int index;

int Local = GetLocalPlayerIndex();

for (int i = 0; i < 32; i++)
{
if (i != Local && GetPlayerInfoByIndex(i)->health > 0)
{
if (CH_Team)
{
if (GetPlayerInfoByIndex(Local)->team != GetPlayerInfoByIndex(i)->team)
{
Distance = GetDistanceA(g_pBase->local, g_pBase->player[i]);
if (Distance < minDistance)
{
minDistance = Distance;
index = i;
}
}
}
else
{
Distance = GetDistanceA(g_pBase->local, g_pBase->player[i]);
if (Distance < minDistance)
{
minDistance = Distance;
index = i;
}
}
}
}

return index;
}

float CalculateYaw(CPlayer* Local, CPlayer* Target)
{
float deltaX = Target->pos1 - Local->pos1;
float deltaY = Target->pos3 - Local->pos3;
float result;

//Calculate Yaw Aim in degrees
result = (float)((atan2(deltaY, deltaX) * 180 / PI) - 90);

return result;
}


float CalculatePitch(CPlayer* Local, CPlayer* Target)
{
float origZ = Target->pos2 /*- g_pLocal->pos2*/;


switch (GetState(Target))
{
case STANDS:
origZ += 26.5f;
PitchCorrection = 26.5f;
break;
case PRONES:
origZ += 0.0f;
PitchCorrection = 0.0f;
break;
case MOVING:
origZ += 27.5f;
PitchCorrection = 27.5f;
break;
case KNEES:
origZ += 19.1f;
PitchCorrection = 19.1f;
break;
case RUNS:
origZ += 26.3f;
PitchCorrection = 26.3f;
break;
case JUMPS:
origZ += 31.5f;
PitchCorrection = 31.5f;
break;
case ROLLS:
origZ += 18.1f;
PitchCorrection = 18.1f;
break;
default:
origZ += 26.5f;
PitchCorrection = 26.5f;
break;
}

bool valid = false;

float deltaX = Target->pos1 - g_pLocal->pos1;
float deltaY = Target->pos3 - g_pLocal->pos3;
float deltaZ = origZ - g_pLocal->pos2;
float result;

float hypotenuse = sqrt((deltaX * deltaX) + (deltaZ + deltaZ));
/*float hypotenuse = sqrt((deltaX * deltaX) + (deltaY * deltaY) + (deltaZ + deltaZ));*/
result = (asin(deltaZ / hypotenuse)) * 180 / PI;

result *= -1;

if (result > - 60 && result < 75)
{
valid = true;
return result;
}

return 0;
}

float CalculatePitch(CPlayer* Local, CPlayer* Target)
{
float origZ = Target->pos3 - Local->pos3;

switch (GetState(Target))
{
case STANDS:
origZ += 26.5f;
PitchCorrection = 26.5f;
break;
case PRONES:
origZ += 0.0f;
PitchCorrection = 0.0f;
break;
case MOVING:
origZ += 27.5f;
PitchCorrection = 27.5f;
break;
case KNEES:
origZ += 19.1f;
PitchCorrection = 19.1f;
break;
case RUNS:
origZ += 26.3f;
PitchCorrection = 26.3f;
break;
case JUMPS:
origZ += 31.5f;
PitchCorrection = 31.5f;
break;
case ROLLS:
origZ += 18.1f;
PitchCorrection = 18.1f;
break;
default:
origZ += 26.5f;
PitchCorrection = 26.5f;
break;
}

bool valid = false;

float deltaX = Target->pos1 - g_pLocal->pos1;
float deltaY = Target->pos2 - g_pLocal->pos2;
float deltaZ = origZ - g_pLocal->pos3;
float result;

float hypotenuse = sqrt((deltaX * deltaX) + (deltaY * deltaY) + (deltaZ + deltaZ));
result = (asin(deltaZ / hypotenuse)) * 180 / PI;

result *= -1;

if (result > - 60 && result < 75)
{
valid = true;
return result;
}

return 0;
}
09/28/2011 15:28 Dogukan47#5271
Quote:
Originally Posted by St4nDbY View Post
Ich hätte hier mal die Source vom Aimbot hab nix gefunden aber man kann ja schlecht alle seiten hier nachsschauen

Viel Spaß damit.
credits?
09/28/2011 17:19 Angel-Piece#5272
Quote:
Originally Posted by Dogukan47 View Post
credits?
das ist die fail source von UPK oder system32 die nicht geht ^^ die hier schon 500 ,mal geposted wurde
09/28/2011 23:42 KingClem™#5273
@Angel eher die von System.UPK hat nen anderen Coding style und bei dem geht es dazu zu 99% ^^
09/29/2011 17:34 Angel-Piece#5274
Quote:
Originally Posted by KingClem™ View Post
@Angel eher die von System.UPK hat nen anderen Coding style und bei dem geht es dazu zu 99% ^^
bei beiden geht es einwandfrei systems32 base wurde geklaut und unknownpk hat dann diese aimbot source geposted jedenfals steht da credits to upk deshalb ka und die wurde sowieso verändert so das die nicht geht alles da drin wurde verändert
09/30/2011 18:21 _TradEmArk_:)#5275
So..
Es Funktioniert aber Crasht nach Höchstens 10 Minuten, also Flamt nicht!



Patch.h
Code:
#include "StdAfx.h"

#pragma once

class cPatch
{
private:
	DWORD   ADR;
	BYTE	OFF_BYTES[255];
	BYTE    ON_BYTES[255];
	int		SIZE;
	enum	PATCHSTATUS
	{
		NORMAL,
		PATCHED,
	};
	int		STATUS;

	void*	memcpy_s(void* pvAddress, const void* pvBuffer, size_t stLen);
public:
	cPatch(DWORD pAdr,BYTE* pByte,int pSize);
	void Patch();
	void Restore();
};
Patch.cpp
Code:
#include "Patch.h"
 
void* cPatch::memcpy_s(void *pvAddress, const void *pvBuffer, size_t stLen)
{
	MEMORY_BASIC_INFORMATION mbi;
	VirtualQuery( ( void* )pvAddress, &mbi, sizeof( mbi ) );
	VirtualProtect( mbi.BaseAddress, mbi.RegionSize, PAGE_EXECUTE_READWRITE, &mbi.Protect );
	void* pvRetn = memcpy( ( void* )pvAddress, ( void* )pvBuffer, stLen );
	VirtualProtect( mbi.BaseAddress, mbi.RegionSize, mbi.Protect, &mbi.Protect );
	FlushInstructionCache( GetCurrentProcess( ), ( void* )pvAddress, stLen );
	return pvRetn;
}
 
cPatch::cPatch(DWORD pAdr,BYTE* pByte,int pSize)
{
	STATUS	=	NORMAL;
	SIZE	=	pSize;
	ADR		=	pAdr;
	
	for(int i = 0; i < pSize; i++)
	{
		OFF_BYTES[i]	=	0x00;
		ON_BYTES[i]		=	pByte[i];
	}
}
 
void cPatch::Patch() 
{
	if( STATUS==NORMAL )
	{
		BYTE *pOFF_BYTES = (BYTE*)ADR;
		for( int i = 0; i < SIZE; i++ )
		{
			OFF_BYTES[i] = pOFF_BYTES[i];
		}
		memcpy_s((void*)ADR,(const void*)ON_BYTES,SIZE);
		STATUS=PATCHED;
	}
}
void cPatch::Restore()
{
	if(STATUS==PATCHED)
	{
		memcpy_s((void*)ADR,(const void*)OFF_BYTES,SIZE);
		STATUS=NORMAL;
	}
}
StdAfx.h
Code:
#if !defined(AFX_STDAFX_H__93345D3A_0CF1_4A56_B453_22701C1CCB5A__INCLUDED_)
#define AFX_STDAFX_H__93345D3A_0CF1_4A56_B453_22701C1CCB5A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


// Insert your headers here
#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <d3d9.h>
#include <d3dx9.h>
#include <fstream>
#include "stdio.h"
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "D3DX9.LIB")
#pragma warning(disable:4996)
using namespace std;

// TODO: reference additional headers your program requires here

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__93345D3A_0CF1_4A56_B453_22701C1CCB5A__INCLUDED_)
Main.cpp
Code:
#include Patch.h

//----------------------------------------------
#define RADARGPS  0x540C99//Updated
cPatch ASRadarGPS(RADARGPS,(PBYTE)"\xEB",1);//Off: x75 x15
if( AS_RadarGPS ) { ASRadarGPS.Patch(); } else { ASRadarGPS.Restore(); }
//----------------------------------------------
Credits
Code:
TradEmArk™
Büny
Yazzn
09/30/2011 18:34 Dogukan47#5276
wenn es funct dann sollte es nicht crashen meinst du das es mit bypass crasht oder ohne?
09/30/2011 18:36 _TradEmArk_:)#5277
Das ist eine ASM Funktion, durch den Patch wird es möglich gemacht das du es ohne Bypass benutzen kannst. Leider wurde diese Funktion von WarRock Gefixxt also Crasht es simpel oder?
09/30/2011 19:07 Dogukan47#5278
wenns gepatched wurde warum postest du es?
09/30/2011 19:10 _TradEmArk_:)#5279
Omg Lern doch Lesen :facepalm:
Für die leute die es Benutzen wollen ich habe doch Geschrieben das es crasht und das ihr nicht Flamen sollt, Es hält ca 10-12 Minuten und jetzt sag einfach Nichtsmehr, du nervst mich
09/30/2011 19:21 Angel-Piece#5280
Quote:
Originally Posted by _TradEmArk_:) View Post
Das ist eine ASM Funktion, durch den Patch wird es möglich gemacht das du es ohne Bypass benutzen kannst. Leider wurde diese Funktion von WarRock Gefixxt also Crasht es simpel oder?
wtf du stehst in den credits und weißt nicht mal wofür das ist


und das ist die von system32 die er mal geposted hat o.0 ?