Box ESP

Posts 115 of 54 · Page 1 of 4
Box ESP
ok it is my Box ESP for you all

Code:
inline void DrawBoundingBox (UCanvas* Canvas, APawn* Target)
{
    FVector X,Y,Z,D,E,top,bottom;;
    float width, Left, Right, Top, Bot;

    GetAxes(MyCameraRotation,X,Y,Z);

    D.X = Target->Location.X - MyCameraLocation.X;
    D.Y = Target->Location.Y - MyCameraLocation.Y;
    D.Z = Target->Location.Z - MyCameraLocation.Z;

    if(Dot(D,X) <= cos(90 * 3.14159265 / 180))
        return;

    FBoxSphereBounds Player = Target->Mesh->Bounds;

    top = Target->Location;
    top = WorldToScreen(Canvas,top);

    bottom = Player.BoxExtent;
    bottom = WorldToScreen(Canvas,bottom);

    width = ((top.Y - bottom.Y) / 3);

    Left  = top.X + width;
    Right = top.X - width;
    Top   = top.Y;
    Bot   = bottom.Y;

    Canvas->Draw2DLine(Left,  Top, Left,  Bot, Green);
    Canvas->Draw2DLine(Left,  Bot, Right, Bot, Green);
    Canvas->Draw2DLine(Right, Bot, Right, Top, Green);
    Canvas->Draw2DLine(Right, Top, Left,  Top, Green);
}
Credits to SystemFiles for help me fix it
how to use Source code???????? PLEASE HELP ME
Quote Originally Posted by SPIRIT7 View Post
how to use Source code???????? PLEASE HELP ME
You need a full base before you can use this.
Code:
float Size (FVector &v)
{
	return sqrt(v.x*v.x + v.y*v.y + v.z*v.z);
}

void Normalize (FVector &v)
{
	float size = Size(v);

	if ( !size )
	{
		v.x = v.y = v.z = 1;
	}
	else
	{
		v.x /= size;
		v.y /= size;
		v.z /= size;
	}
}

void inline GetAxes (FRotator R, FVector &X, FVector &Y, FVector &Z)
{
	X = RotToVec(R);
	X.Normalize();
	R.Yaw += 16384;
	FRotator R2 = R;
	R2.Pitch = 0.f;
	Y = RotToVec(R2);
	Y.Normalize();
	Y.Z = 0.f;
	R.Yaw -= 16384;
	R.Pitch += 16384;
	Z = RotToVec(R);
	Z.Normalize();
}

float inline Dot (const FVector& V1,const FVector& V2)
{
	return ( V1.X*V2.X + V1.Y*V2.Y + V1.Z*V2.Z );
}
Originally Posted by Tamimego
You can only call Project in HUD.PostRender. It's pretty much the only time the game has the ViewScene in Canvas or whatever set. Some games it is different though, like FFOW had a function called CachedProject where they stored the Projection and View Matrixes from the last frame.
Code:
FVector WorldToScreen (UCanvas* Canvas, FVector WorldLocation)//Helios
{
    FVector X,Y,Z,D,Out;
	GetAxes(MyCameraRotation,X,Y,Z);
	D = WorldLocation - MyCameraLocation;
	Out.X = (Canvas->ClipX/2)+( Dot(D,Y))*((Canvas->ClipX/2)/tan(Me->FovAngle*PI/360))/Dot(D,X);
	Out.Y = (Canvas->ClipY/2)+(-Dot(D,Z))*((Canvas->ClipX/2)/tan(Me->FovAngle*PI/360))/Dot(D,X);
	Out.Z = 0;
	return Out;
}
Credits to
Tamimego
R00T88
x22
HOOAH07


ok now you got WorldToScreen to work

Code:
void DrawPlayerESP( UCanvas* pCanvas )
{
    if (pPC == NULL || pPC->Pawn == NULL || pPC->WorldInfo == NULL )
    return;

    APawn* Target = pPC->Pawn->WorldInfo->PawnList;
    while ( Target != NULL )
    {
        if ( Target != NULL && !Target->bDeleteMe && Target->Health >0 && Target != pPC->Pawn && !Target->IsA(AVehicle::StaticClass())) 
        {
		DrawBoundingBox (pCanvas, Target);
        }
    
        Target = Target->NextPawn;
    }
}

ok you are good to go
Code:
DrawPlayerESP( pCanvas );
Realy, maybe someone will write a step by step realties, as the codes are written in here in themes to make the ESP or any hack
hi
You give a man a fish, you feed him for a day. You teach a man how to fish. You feed him for life. It's better to teach them how to use it than to just give them a compiled .dll

I will write up a full tutorial later on today
Quote Originally Posted by the1domo View Post
You give a man a fish, you feed him for a day. You teach a man how to fish. You feed him for life. It's better to teach them how to use it than to just give them a compiled .dll

I will write up a full tutorial later on today
I can try to get it stickied for you if its good enough. it would help this whole community
my tutorial
Code:
//-------------------------------------------------------
ok my tutorial on the UE3 for apb by the1domo @ ‪The Defaced
//-------------------------------------------------------
FColor MakeColor(int R, int G, int B, int A)
{
	FColor ReturnedColor;
	ReturnedColor.R = R;
	ReturnedColor.G = G;
	ReturnedColor.B = B;
	ReturnedColor.A = A;
	return ReturnedColor;
}
//-------------------------------------------------------
FColor Green = MakeColor(0,255,0,255);
FColor Red = MakeColor(255,0,0,255);
//-------------------------------------------------------
you need to define PI and URotationToRadians
//-------------------------------------------------------
#define PI 3.1415926
#define URotationToRadians  PI / 32768
//-------------------------------------------------------
Heres some stuff from the SDK you need for apb
//-------------------------------------------------------
APlayerController*		pPC				= NULL;
APlayerController*		PlayerController		= NULL;
APlayerController*		MPC				= NULL;
UObject*			pCallObject			= NULL;
AcAPBPlayerController*		pPlayerController		= NULL;
FVector 			MyCameraLocation		= FVector();
FRotator			MyCameraRotation		= FRotator();
//-------------------------------------------------------
you need this to get all of your pointers Credits go to uNrEaL
//-------------------------------------------------------
UObject* GetInstanceOf ( UClass* Class )
{
	static UObject* ObjectInstance;

	ObjectInstance = NULL;

	for ( int i = 0; i < UObject::GObjObjects()->Count; ++i )
	{
		UObject* CheckObject = ( *UObject::GObjObjects() )( i );

		if ( CheckObject && CheckObject->IsA( Class ) )
		{
			if ( !strstr( CheckObject->GetFullName(), "Default" ) )
				ObjectInstance = CheckObject;
		}
	}

	return ObjectInstance;
};
//-------------------------------------------------------
to get the Size of a FVector
//-------------------------------------------------------
float Size (FVector &v)
{
	return sqrt(v.X*v.X + v.Y*v.Y + v.Z*v.Z);
}
//-------------------------------------------------------
Normalize is a vector
//-------------------------------------------------------
void Normalize (FVector &v)
{
	float size = Size(v);

	if ( !size )
	{
		v.x = v.y = v.z = 1;
	}
	else
	{
		v.x /= size;
		v.y /= size;
		v.z /= size;
	}
}
//-------------------------------------------------------
ok use thie to get GetAxes
//-------------------------------------------------------
void inline GetAxes (FRotator R, FVector &X, FVector &Y, FVector &Z)
{
	X = RotToVec(R);
	X.Normalize();
	R.Yaw += 16384;
	FRotator R2 = R;
	R2.Pitch = 0.f;
	Y = RotToVec(R2);
	Y.Normalize();
	Y.Z = 0.f;
	R.Yaw -= 16384;
	R.Pitch += 16384;
	Z = RotToVec(R);
	Z.Normalize();
}
//-------------------------------------------------------
you need this to use WorldToScreen and Draw Boxs
//-------------------------------------------------------
float inline Dot (const FVector& V1,const FVector& V2)
{
	return ( V1.X*V2.X + V1.Y*V2.Y + V1.Z*V2.Z );
}
//-------------------------------------------------------
Quote:
Originally Posted by Tamimego
You can only call Project in HUD.PostRender. It's pretty much the only time the game has the ViewScene in Canvas or whatever set. Some games it is different though, like FFOW had a function called CachedProject where they stored the Projection and View Matrixes from the last frame.
//-------------------------------------------------------
WorldToScreen is wot you uses to Draw on the Screen 
//-------------------------------------------------------
FVector WorldToScreen (UCanvas* Canvas, FVector WorldLocation)//Helios
{
    FVector X,Y,Z,D,Out;
	GetAxes(MyCameraRotation,X,Y,Z);

	//D = WorldLocation - MyCameraLocation;
	D.X = WorldLocation.X - MyCameraLocation.X;
	D.Y = WorldLocation.Y - MyCameraLocation.Y;
	D.Z = WorldLocation.Z - MyCameraLocation.Z;

	Out.X = (Canvas->ClipX/2)+( Dot(D,Y))*((Canvas->ClipX/2)/tan(Me->FovAngle*PI/360))/Dot(D,X);
	Out.Y = (Canvas->ClipY/2)+(-Dot(D,Z))*((Canvas->ClipX/2)/tan(Me->FovAngle*PI/360))/Dot(D,X);
	Out.Z = 0;
	return Out;
}
//-------------------------------------------------------
Credits to
Tamimego
R00T88
x22
HOOAH07
//-------------------------------------------------------
ok it is my Draw Box ESP Credits to SystemFiles for help me fix it
you use it to Draw Boxs on the Screen
//-------------------------------------------------------
inline void DrawBoundingBox (UCanvas* Canvas, APawn* Target)
{
    FVector X,Y,Z,D,E,top,bottom;;
    float width, Left, Right, Top, Bot;

    GetAxes(MyCameraRotation,X,Y,Z);

    D.X = Target->Location.X - MyCameraLocation.X;
    D.Y = Target->Location.Y - MyCameraLocation.Y;
    D.Z = Target->Location.Z - MyCameraLocation.Z;

    if(Dot(D,X) <= cos(90 * 3.14159265 / 180))
        return;

    FBoxSphereBounds Player = Target->Mesh->Bounds;

    top = Target->Location;
    top = WorldToScreen(Canvas,top);

    bottom = Player.BoxExtent;
    bottom = WorldToScreen(Canvas,bottom);

    width = ((top.Y - bottom.Y) / 3);

    Left  = top.X + width;
    Right = top.X - width;
    Top   = top.Y;
    Bot   = bottom.Y;

    Canvas->Draw2DLine(Left,  Top, Left,  Bot, Green);
    Canvas->Draw2DLine(Left,  Bot, Right, Bot, Green);
    Canvas->Draw2DLine(Right, Bot, Right, Top, Green);
    Canvas->Draw2DLine(Right, Top, Left,  Top, Green);
}
//-------------------------------------------------------
how we need to itert tho the Player list
//-------------------------------------------------------
void DrawPlayerESP( UCanvas* pCanvas )
{
    if (pPC == NULL || pPC->Pawn == NULL || pPC->WorldInfo == NULL )
    return;

    APawn* Target = pPC->Pawn->WorldInfo->PawnList;
    while ( Target != NULL )
    {
        if ( Target != NULL && !Target->bDeleteMe && Target->Health >0 && Target != pPC->Pawn && !Target->IsA(AVehicle::StaticClass())) 
        {
		DrawBoundingBox (pCanvas, Target);
        }
    
        Target = Target->NextPawn;
    }
}
//-------------------------------------------------------
PostRender is your main thread
//-------------------------------------------------------
void PostRender(UCanvas* pCanvas)
{
	if(pCanvas)
	{
		pPlayerController = ( AcAPBPlayerController* )GetInstanceOf( AcAPBPlayerController::StaticClass() ); 
		pPlayerController->GetPlayerViewPoint( &MyCameraLocation, &MyCameraRotation );
		DrawPlayerESP(pCanvas);
	}
}
//-------------------------------------------------------
your hook Function you need it to get the Canvas and pCallObject for the hook Credits go to uNrEaL
//-------------------------------------------------------
void hkProcessEvent ( UFunction* pFunction, void* pParms, void* pResult )
{
	_asm pushad;w

	_asm mov pCallObject, ecx;

	if ( pFunction )
	{
		strcpy( FunctionName, pFunction->GetFullName() );

		if ( !strcmp( FunctionName, "Function Engine.GameViewportClient.PostRender" ))
		{			
			PostRender(((UGameViewportClient_eventPostRender_Parms*)pParms)->Canvas );
		}
	    if ( !strcmp( FunctionName, "Function Engine.PlayerController.PlayerTick" ))
		{			
			pPC = (APlayerController*)pCallObject;
		}
		else if ( !strcmp( FunctionName, "Function APBGame.cAPBPlayerController.Destroyed" ))
		{			
			if(pPC == pCallObject)
			{
				pPC = NULL;
			}
		}	
	}

	_asm popad;

	pProcessEvent( pFunction, pParms, pResult );
}
//-------------------------------------------------------
your Detour Function for the hack
//-------------------------------------------------------
void OnAttach ()
{
	pProcessEvent = ( tProcessEvent )DetourFunction( ( PBYTE )ProcessEvent, ( PBYTE )hkProcessEvent );
}
//-------------------------------------------------------
DllMain you need this for the dll
//-------------------------------------------------------
BOOL WINAPI DllMain ( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
{
	if ( dwReason == DLL_PROCESS_ATTACH )
		OnAttach ();

	return TRUE;
}
//-------------------------------------------------------
If people still dont understand this, I can make a video tutorial.

love,
the1domo
lol
a video tutorial is better, so nothing can go wrong
Dude, compile it to everyone insted, it will become easier and u wont have a shitload of p12's whining about how to use ect, just compile the shit for them, get alot of thanks and ur done ^^
Can you compile it for me? cuz im still learing C++
and if you need help you can add me on msn or email @ domo@TheDefaced.net or if you want to help me make a public hack or want to join my team
Hi im new, but wouldnt it be possible for this source code to be made into a .dll and then posted? because then you just use the base hook to inject it...
I'm derp with C++ but I am guessing you CP that shit into C++ and compile that into a .dll and inject it using an injector
Posts 115 of 54 · Page 1 of 4
This thread is closed for replies.

Tags for this Thread

None

Need help?