Sep 6, 2014 at 2:16am UTC
/*******************************************************/
/* Solify's -> CA Base D3D Menu Selection
/* WE11ington -> Disponibilizou Para Combat Arms Brasil
/* luizimloko -> Menu Selection V4
/*******************************************************/
#include "stdafx.h"
#include "Menu.h"
#include "Hook.h"
/////////////////////////////////////
// Combatarms_VER_BR_2.1201.03 //
/////////////////////////////////////
#define DeviceGame1 0x009113C8 //
#define DeviceGame 0x1854693 //
/////////////////////////////////////
int PosX = 30;
int PosY = 70;
int Posy = 60;
// Chaves Menu
char* opt_opçoes[] = { "[off]", "[Tai]" };
//Menu
char MenuTitle[50] = { "Kontol Menu" }; // Titulo do hack aqui, Menu Title.
char Timestruct[50] = { "hh':'mm" }; // Estrutura Relogio.
char TimeString[50];
int MenuSelection;
int Current = true;
bool Menu = true;
bool bFont;
//Hack Variables
int Fps, cCrossHair,MoverMenu, Chams;
{
DWORD adrMin1, adrMin2 = 0;
DWORD dwPB1 = (DWORD)GetModuleHandleA("io3DEngine.dll");
DWORD dwPB = (DWORD)GetModuleHandleA("lostsaga.exe");
if (dwPB, dwPB > 0) {
adrMin1 = dwPB + (DWORD)DeviceGame;
Patch((void *)(adrMin1),(void*)(PBYTE)"\x8B\x00", 2); // Revo d'Blangkon
}
}
HRESULT WINAPI hkReset(LPDIRECT3DDEVICE9 pDevice, D3DPRESENT_PARAMETERS *a)
{
Directx_Font->OnLostDevice();
HRESULT hTorna = oReset(pDevice, a);
if(SUCCEEDED(hTorna))
Directx_Font->OnResetDevice();
return hTorna;
}
HRESULT WINAPI hkPresent(LPDIRECT3DDEVICE9 pDevice, const RECT *a, const RECT *b, HWND c, const RGNDATA *d)
{
if(Directx_Font) {
Directx_Font->Release();
Directx_Font = NULL;
bFont = false;
}
if(!bFont) {
D3DXCreateFont(pDevice, 14, 0, 400, 1, 0, 1, 0, 4, 0 | (0<<4), "Arial", &Directx_Font);
bFont = true;
}
if(GetAsyncKeyState(VK_INSERT)&1) Menu = !Menu;
if(Menu && Directx_Font) {
pDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
GetTimeFormat(NULL, NULL, NULL, NULL, Timestruct, 15);
DrawBox(PosX - 10, PosY - 22, 162, 20, TBlack, Green, pDevice);//Draw box do titulo.
DrawBorder(PosX - 10, PosY - 22, 162, 20, 1, Green, pDevice);//Borda da box do titulo.
DrawText(pDevice, PosX , PosY - 20, Yellow, MenuTitle);// Titulo do hack. MenuTitle declaração, então deve mudar la em cima.
sprintf_s(TimeString, "%s", Timestruct);// Relogio.
DrawText(pDevice, PosX + 100, PosY - 20, Yellow, TimeString);// Texto do Relogio.
DrawBox(PosX - 10, PosY, 162, 70, TBlack, Green, pDevice);// Draw Box Principal //Cada vez que for adicionar uma nova função aumente o INT h (50) em 20 em 20 por exemplo, 50 + 20 = 70, 70 + 20 = 100, Espero que intenda.
DrawBorder(PosX - 10, PosY, 162, 70, 1, Green, pDevice); //Borda da box principal.
DrawBorder(PosX - 10, Posy + 2 + (MenuSelection * 15), 162, 13, 1, Cyan, pDevice); // Selection
Current = 1;
if(GetAsyncKeyState(VK_UP)&1)
MenuSelection--;
if(GetAsyncKeyState(VK_DOWN)&1)
MenuSelection++;
Additem("Anti Hit" , 1, Fps, 0, opt_opçoes, pDevice);
Additem("?" , 1, Chams, 0, opt_opçoes, pDevice);
Additem("?", 1, cCrossHair, 0, opt_opçoes, pDevice);
Additem("Move Menu", 1, MoverMenu, 0, opt_opçoes, pDevice);
if(MenuSelection >= 1)
MenuSelection = 1;
else if(MenuSelection <0 )
MenuSelection =1 ;
}
if(MoverMenu) {
POINT MyCursor;
GetCursorPos(&MyCursor);
PosX = MyCursor.x;
PosY = MyCursor.y;
Posy = MyCursor.y - 10;
}
return oPresent(pDevice, a, b, c, d);
}
DWORD WINAPI Hook(LPVOID lpArgs)
{
DWORD dwD3D9 = 0;
while(!dwD3D9) {
Sleep(5);
dwD3D9 = (DWORD)GetModuleHandle("d3d9.dll");
}
DWORD dwVTable[2] = { 0 };
CreateDevice(dwVTable);
oReset = (tReset) DetourCreate((PBYTE) dwVTable[0], (PBYTE) &hkReset, 5);
oPresent = (tPresent)DetourCreate((PBYTE) dwVTable[1], (PBYTE) &hkPresent, 5);
return FALSE;
}
The Trouble is :
c:\users\eka\downloads\programs\ca base d3d menu selection\ca base d3d menu selection\hack.cpp(35): error C2447: '{' : missing function header (old-style formal list?)