#include "Files.h"
#include "Base.h"
#include "Menu.h"
#include "DirectX.h"
#include "Itens.h"
#include "Xor.h"
INT frame;
//Posição do Menu.
INT menux = 50;
INT menuy = 45;
VOID cBase::RenderFrame(LPDIRECT3DDEVICE9 pDevice)
{
if(Mvisible)
{
if(colorborder == 0)
{
cBase::DrawBox(menux, menuy, Mxofs + 20, 20, TBlack, Grey, pDevice);// Cores Bordas e fundo Cabeçalho
cBase::DrawBox(menux, menuy + 25, Mxofs + 20, frame, TBlack, Black, pDevice);// Cores Bordas e fundo Tabela de baixo
/*} else if(colorborder == 1) {
cBase::DrawBox(menux, menuy, Mxofs + 20, 20, TBlack, Green, pDevice);
cBase::DrawBox(menux, menuy + 25, Mxofs + 20, frame, TBlack, Green, pDevice);
} else if(colorborder == 2) {
cBase::DrawBox(menux, menuy, Mxofs + 20, 20, TBlack, Blue, pDevice);
cBase::DrawBox(menux, menuy + 25, Mxofs + 20, frame, TBlack, Blue, pDevice);
} else if(colorborder == 3) {
cBase::DrawBox(menux, menuy, Mxofs + 20, 20, TBlack, Black, pDevice);
cBase::DrawBox(menux, menuy + 25, Mxofs + 20, frame, TBlack, Black, pDevice);*/
}
Directx.Texto(menux + 10, menuy + 3, White, TCenter, Directx.pFont, "~iTzOriginal~");//Titulo em vermelho
}
Menu.MenuShow(menux + 10, menuy + 35, Directx.pFont);
Menu.MenuNav();
if(Mmax == 0)
Menu.RenderMenu();
Base.MoveMenu(pDevice);
}
DWORD cBase::GetPointer(INT inicio)
{
DWORD *Device = ***(DWORD ****)DeviceGame;
if(Device == NULL)
return 0;
return Device[inicio];
}
VOID cBase::FillRGB(INT x, INT y, INT w, INT h, D3DCOLOR color, LPDIRECT3DDEVICE9 pDevice)
{
D3DRECT rec = {x, y, x + w, y + h};
pDevice->Clear(1, &rec, D3DCLEAR_TARGET, color, 0, 0);
}
VOID cBase::DrawBorder(INT x, INT y, INT w, INT h, INT px, D3DCOLOR BorderColor, LPDIRECT3DDEVICE9 pDevice)
{
FillRGB(x, (y + h - px), w, px, BorderColor, pDevice);
FillRGB(x, y, px, h, BorderColor, pDevice);
FillRGB(x, y, w, px, BorderColor, pDevice);
FillRGB((x + w - px), y, px, h, BorderColor, pDevice);
}
VOID cBase::DrawBox(INT X, INT Y, INT W, INT H, D3DCOLOR Color, D3DCOLOR BorderColor, LPDIRECT3DDEVICE9 pDevice) {
DrawBorder(X, Y, W, H, 2, BorderColor, pDevice);
CONST DWORD D3D_FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE;
struct Vertex
{
FLOAT X, Y, W, H;
D3DCOLOR Color;
} V[4] = {
{(FLOAT)X, (FLOAT)(Y + H), 0.0F, 0.0F, Color},
{(FLOAT)X, (FLOAT)Y, 0.0F, 0.0F, Color},
{(FLOAT)(X + W), (FLOAT)(Y + H), 0.0F, 0.0F, Color},
{(FLOAT)(X + W), (FLOAT)Y, 0.0F, 0.0F, Color}
};
pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, D3DZB_TRUE);
pDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
pDevice->SetRenderState(D3DRS_FOGENABLE, D3DZB_FALSE);
pDevice->SetFVF(D3D_FVF);
pDevice->SetTexture(0, NULL);
pDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, V, sizeof(Vertex));
}
VOID cBase::MoveMenu(LPDIRECT3DDEVICE9 pDevice)
{
if(movemenu)
{
POINT myCursor;
GetCursorPos(&myCursor);
menux = myCursor.x;
menuy = myCursor.y;
}
}
VOID cBase::CrossHair(LPDIRECT3DDEVICE9 pDevice, D3DCOLOR Color)
{
D3DVIEWPORT9 Viewport;
pDevice->GetViewport(&Viewport);
DWORD ScreenX = Viewport.Width / 2;
DWORD ScreenY = Viewport.Height / 2;
D3DRECT rec1 = {ScreenX - 15, ScreenY, ScreenX + 15, ScreenY + 2};
D3DRECT rec2 = {ScreenX, ScreenY - 15, ScreenX + 2, ScreenY + 15};
pDevice->Clear(1, &rec1, D3DCLEAR_TARGET, Color, 0, 0);
pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, Color, 0, 0);
}
INT cBase::EditMemory(VOID *lpMem, VOID *lpSrc, size_t len)
{
DWORD flNewProtect = PAGE_READWRITE, lpflOldProtect;
unsigned char *pDst = (unsigned char *)lpMem, *pSrc = (unsigned char *)lpSrc;
if(VirtualProtect(lpMem, len, flNewProtect, &lpflOldProtect))
{
while(len-- > 0) *pDst++ = *pSrc++;
return 0;
}
return 1;
}
bool cBase::IsGameReadyForHook(VOID)
{
if(GetModuleHandle("d3d9.dll") != NULL
&& GetModuleHandle("ClientFX.fxd") != NULL
&& GetModuleHandle("CShell.dll") != NULL)
return true;
return false;
}
DWORD WINAPI StartRoutine( LPVOID ) ;
DWORD WINAPI dwMainThread(LPVOID)
{
while(!Base.IsGameReadyForHook())
Sleep(100);
Directx.Hook();
return 0;
}
INT WINAPI DllMain(HMODULE hDll, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hDll);
if(dwReason == DLL_PROCESS_ATTACH)
{
//MessageBox(0, "Créditos -> LSM Matty, Whit, Slaahsy, Unknown.Coder, ChaosMagician, picoruxo, L0OocKie, xpeeh, luccss, WE11ington & CAFlames <-", "Créditos '--'", MB_OK);// Mensage Box Na hora de injetar
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)dwMainThread, NULL, NULL, NULL);
//CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)StartRoutine, NULL, NULL, NULL);
}
return 1;
}
//GHBR - Creditos : Xpeeh, Luccss, Victor_Silent
//Whit(Base Original), Capevaldo, WE11ington
#ifndef _ITENS_H_
#define _ITENS_H_
CHAR *Descriptografa( CONST CHAR *plaintext ) //Classe Do Decrypt, para encryptar strings
{
INT len = strlen( plaintext );
CHAR *cyphertext = new CHAR[len + 1];
for( INT i = 0; i < len; ++i )
cyphertext[i] = plaintext[i] - 45;
cyphertext[len] = 0;
return cyphertext;
}
//#define ChamsNxAtt Descriptografa ("GleqwR|Exx")
cBase Base;
INT movemenu;
INT colorborder;
//Grupos do Menu
INT visuals = 1;
INT removers = 1;
INT others = 1;
INT vips = 1;
INT menuoptions = 1;
//Variaveis dos Hackers.
INT fps; INT fpsx1;
INT chams; INT chamsx1;
INT names; INT namesx1;
INT beast; INT beastx1;
INT recoil; INT recoilx1;
INT reload; INT reloadx1;
INT fog; INT fogx1;
INT speed; INT speedx1;
INT jump; INT jumpx1;
INT fly; INT flyx1;
INT pick; INT pickx1;
INT cross; INT crossx1;
INT weapon; INT weaponx1;
INT bullets; INT bulletsx1;
INT rapidfire; INT rapidfirex1;
INT Gravity; INT Gravityx1;
INT NXChams; INT NXChamsx2;
//Titutlo
CHAR Titulo[50] = "";
//Chaves do menu
CHAR *Opt_Folder[] = { "", "" };
CHAR *Opt_on_off[] = { "0", "1" };
CHAR *Opt_rapidfire[] = { "Des", "Mouse [L]", "Shooting" };
CHAR *Opt_color[] = { "Red", "Green", "Blue", "Black" };
VOID cMenu::RenderMenu(VOID)
{
AdicionarItem(" Visuais", Opt_Folder, &visuals, 2, MENUFOLDER);
if(visuals) {
// AdicionarItem( ChamsNxAtt, Opt_on_off, &NXChams, 2, MENUITEM);
AdicionarItem(" Name Tag", Opt_on_off, &names, 2, MENUITEM);
}
AdicionarItem(" Removedores", Opt_Folder, &removers, 2, MENUFOLDER);
if(removers) {
AdicionarItem(" No Recoil", Opt_on_off, &recoil, 2, MENUITEM);
AdicionarItem(" No Reload", Opt_on_off, &reload, 2, MENUITEM);
AdicionarItem(" No Fog", Opt_on_off, &fog, 2, MENUITEM);
}
AdicionarItem(" Outros", Opt_Folder, &others, 2, MENUFOLDER);
if(others) {
AdicionarItem(" Show FPS", Opt_on_off, &fps, 2, MENUITEM);
AdicionarItem(" Speed", Opt_on_off, &speed, 2, MENUITEM);
AdicionarItem(" Super Jump", Opt_on_off, &jump, 2, MENUITEM);
}
AdicionarItem(" Semi Vips", Opt_Folder, &vips, 2, MENUFOLDER);
if(vips) {
AdicionarItem(" Weapon Range", Opt_on_off, &weapon, 2, MENUITEM);
AdicionarItem(" Super Bullets", Opt_on_off, &bullets, 2, MENUITEM);
AdicionarItem(" Rapid Fire", Opt_rapidfire, &rapidfire, 3, MENUITEM);
}
AdicionarItem(" Opçoes do Menu", Opt_Folder, &menuoptions, 2, MENUFOLDER);
if(menuoptions) {
AdicionarItem("Move Menu", Opt_on_off, &movemenu, 2, MENUITEM);
AdicionarItem("Color Border", Opt_color, &colorborder, 4, MENUITEM);
}
}
void PushToConsole( const char *string )
{
__asm
{
push string
mov eax, 0x48AD50; LTClientEXE
call eax
add esp, 0x4
}
}
VOID cBase::Funcoes(LPDIRECT3DDEVICE9 pDevice)
{
//if( NXChams ) {
//PushToConsole( "+SkelModelStencil 1.0" );
//} else {
// PushToConsole( "+SkelModelStencil 0.0" );
//}
if(names) {
memcpy((VOID *)EspName1, (VOID *)(PBYTE)"\x90\x90", 2);
memcpy((VOID *)EspName2, (VOID *)(PBYTE)"\x90\x90", 2);
} else {
memcpy((VOID *)EspName1, (VOID *)(PBYTE)"\x75\x05", 2);
memcpy((VOID *)EspName2, (VOID *)(PBYTE)"\x75\x05", 2);
}
if(recoil)
memcpy((VOID *)NoRecoil, (VOID *)(PBYTE)"\x90\x90\x90\x90", 4);
else
memcpy((VOID *)NoRecoil, (VOID *)(PBYTE)"\xD9\x44\x24\x14", 4);
if(reload)
memcpy((VOID *)NoReload, (VOID *)(PBYTE)"\x90\x90\x90\x90\x90\x90", 6);
else
memcpy((VOID *)NoReload, (VOID *)(PBYTE)"\x0F\x84\xB1\x01\x00\x00", 6);
if(fog) {
PushToConsole("+FogEnable 0.0");
} else {
PushToConsole("+FogEnable 1.0");
}
if(fps) {
PushToConsole("+ShowFps 1.0");
} else {
PushToConsole("+ShowFps 0.0");
}
if(cross) Base.CrossHair(pDevice, Red);
if(weapon) {
memcpy((VOID *)WeaponRange1, (VOID *)(PBYTE *)"\xB8\x00\x00\x00\x10\x90", 6);
memcpy((VOID *)WeaponRange2, (VOID *)(PBYTE *)"\xB8\x00\x00\x00\x10\x90", 6);
} else {
memcpy((VOID *)WeaponRange1, (VOID *)(PBYTE *)"\x8B\x80\xC8\x02\x00\x00", 6);
memcpy((VOID *)WeaponRange2, (VOID *)(PBYTE *)"\x8B\x80\xC8\x02\x00\x00", 6);
}
if(bullets) {
memcpy((VOID *)SuperBullets, (VOID *)(PBYTE)"\x90\x90\x90", 3);
} else {
memcpy((VOID *)SuperBullets, (VOID *)(PBYTE)"\x0F\x94\xC0", 3);
}
if(rapidfire == 1 && GetAsyncKeyState(VK_LBUTTON)<0) {
memcpy((VOID *)RapidFire, (VOID *)(PBYTE)"\x90\x90", 2);
} else if((*(BYTE *)GameStatus == 1) && rapidfire == 2) {
memcpy((VOID *)RapidFire, (VOID *)(PBYTE)"\x90\x90", 2);
} else {
memcpy((VOID *)RapidFire, (VOID *)(PBYTE)"\x74\x3E", 2);
}
}
#endif