Hi Guys i have problem with code caving I hope someone can help me
Every time when I enable Ammo Cheat and I shot ammo go to Zero
and when i enable Money Cheat money added but i cant buy weapons etc in Game
Here the Picture
http://www.mediafire.com/view/3qpc0k...er-image8.bmp#
and here the code
#include "common.h"
bool infammo = false;
bool HooksSet = false;
bool maxmoney = false;
VOID __declspec(naked) CheckAmmo(VOID) { //XPG User Engnine
//82204810 556A0FFE srwi r10,r11,31
//82204814 7D4A01D4 addme r10,r10
//82204818 7D4B5838 and r11,r10,r11
//8220481C 91630000 stw r11,0(r3)
//82204820 5563003E rlwinm r3,r11,0,0,31
DWORD Ptr;
__asm {
srwi r10,r11,31
addme r10,r10
and r11,r10,r11
stw r11,0(r3)
}
__asm
{
stw r5,Ptr
}
if (Ptr == 0x8323E248 && infammo == TRUE) {
INT moreammo = 100;
__asm {
stw moreammo,0(r3)
}
}
__asm {
lis r11,0x8220
ori r11,r11,0x4820
mtctr r11
bctr
}
}
VOID __declspec(naked) CheckMoney(VOID) {
//823A9B40 1D2961B8 mulli r9,r9,25016
//823A9B44 7D495214 add r10,r9,r10
//823A9B48 910A5E8C stw r8,5E8Ch(r10)
//823A9B4C 917F5E8C stw r11,5E8Ch(r31)
//823A9B50 4800B441 bl 823B4F90
DWORD Ptr2;
__asm {
mulli r9,r9,25016
add r10,r9,r10
stw r8,5E8Ch(r10)
stw r11,5E8Ch(r31)
}
__asm
{
stw r3,Ptr2
}
if (Ptr2 == 0x000001FE && maxmoney == TRUE) {
INT moremoney = 999999;
__asm {
stw moremoney,5E8Ch(r31)
}
}
__asm {
lis r11,0x823A
ori r11,r11,0x9B50
mtctr r11
bctr
}
}
VOID SetHooks() {
DWORD Infammo[4];
patchInJump( (PDWORD)Infammo, (DWORD)CheckAmmo, FALSE );
DoCave(0x82204810, &Infammo[0], 4);
DoCave(0x82204814, &Infammo[1], 4);
DoCave(0x82204818, &Infammo[2], 4);
DoCave(0x8220481C, &Infammo[3], 4);
DWORD Maxmoney[4];
patchInJump( (PDWORD)Maxmoney, (DWORD)CheckMoney, FALSE );
DoCave(0x823A9B40, &Maxmoney[0], 4);
DoCave(0x823A9B44, &Maxmoney[1], 4);
DoCave(0x823A9B48, &Maxmoney[2], 4);
DoCave(0x823A9B4C, &Maxmoney[3], 4);
HooksSet = TRUE;
}
VOID TrainerLoaded()
{
PulseController();
Notify(L"Your Trainer Has Loaded");
bool GameReady = false;
}
VOID ShowTrainerMain()
{
Prompt = XShowMessageBoxUI(0, L"Created By YourName", L"YourGame +2 Trainer\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\nView Available Codes: DPAD-DOWN(x4)\r\n", ARRAYSIZE(g_strButtons), g_strButtons, 0, XMB_PASSCODEMODE, &g_mb_result, &g_xol);
if( HooksSet == false )//When you press the activate buttons (Start + dpad up) it will automatically set your cave by setting hooksSet to true which will activate the sethooks function above
{
SetHooks();
}
}
VOID ButtonPressResult( MESSAGEBOX_RESULT g_mb_result )
{
if( g_mb_result.rgwPasscode[0] == DPAD_DOWN && g_mb_result.rgwPasscode[1] == DPAD_DOWN && g_mb_result.rgwPasscode[2] == DPAD_DOWN && g_mb_result.rgwPasscode[3] == DPAD_DOWN )
{
Sleep(500);
//this is the page that shows all available cheats \r\n indicates create new line
XShowMessageBoxUI(0, L"Viewing All Available Codes", L"All Cheats Dpad Up(x4)\r\nInf Health RT(x4)\r\nInf Ammo LT(x4)Hope You Enjoy\r\n~~~~~~~~~~~~~~~~~~~~~~~~~\r\nXPGamesaves. com\r\nHome To TeamXPG and 360 Revolution", ARRAYSIZE(g_strButtons), g_strButtons, 0, XMB_NOICON, &g_mb_result, &g_xol);
memset( &g_mb_result.rgwPasscode[0], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[1], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[2], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[3], 0x00, 0x02 );
Prompt = 0x9999;
}
if( g_mb_result.rgwPasscode[0] == LEFT_TRIGGER && g_mb_result.rgwPasscode[1] == LEFT_TRIGGER && g_mb_result.rgwPasscode[2] == LEFT_TRIGGER && g_mb_result.rgwPasscode[3] == LEFT_TRIGGER )
{
Sleep(500);
if( maxmoney == TRUE )
{
Notify(L"maxmoney Deactivated");
maxmoney = FALSE;
PulseController();
}else{
Notify(L"maxmoney Activated");
maxmoney = TRUE;
PulseController();
}
memset( &g_mb_result.rgwPasscode[0], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[1], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[2], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[3], 0x00, 0x02 );
Prompt = 0x9999;
}
if( g_mb_result.rgwPasscode[0] == RIGHT_TRIGGER && g_mb_result.rgwPasscode[1] == RIGHT_TRIGGER && g_mb_result.rgwPasscode[2] == RIGHT_TRIGGER && g_mb_result.rgwPasscode[3] == RIGHT_TRIGGER )
{
Sleep(500);
if( infammo == TRUE )
{
Notify(L"Inf Health Deactivated");
infammo = FALSE;
PulseController();
}else{
Notify(L"Inf Health Activated");
infammo = TRUE;
PulseController();
}
memset( &g_mb_result.rgwPasscode[0], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[1], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[2], 0x00, 0x02 );
memset( &g_mb_result.rgwPasscode[3], 0x00, 0x02 );
Prompt = 0x9999;
}
}
i dont really what i making Wrong
with XYZ Trainer Engine my Code Caving Codes working great i have tested with some Games.
but the probmlem in the XYZ Engine I dont know how added more Code Caving Codes.
void __declspec(naked)Max_Money(){//XYZ Trainer Engine
//823A9B40 1D2961B8 mulli r9,r9,25016
//823A9B44 7D495214 add r10,r9,r10
//823A9B48 910A5E8C stw r8,5E8Ch(r10)
//823A9B4C 917F5E8C stw r11,5E8Ch(r31)
//823A9B50 4800B441 bl 823B4F90
DWORD IDENT,CASH;
__asm mulli r9,r9,25016
__asm add r10,r9,r10
__asm stw r8,5E8Ch(r10)
__asm stw r11,CASH
__asm stw r3,IDENT
if(cheat[1] && IDENT == 0x1FE )CASH=999999;//CASH
__asm lwz r11,CASH
__asm stw r11,5E8Ch(r31)
__asm lis r2,0x823A
__asm ori r2,r2,0x9B50
__asm mtctr r2
__asm bctr
}
void __declspec(naked)Inf_Ammo(){
//82204810 556A0FFE srwi r10,r11,31
//82204814 7D4A01D4 addme r10,r10
//82204818 7D4B5838 and r11,r10,r11
//8220481C 91630000 stw r11,0(r3)
//82204820 5563003E rlwinm r3,r11,0,0,31
DWORD IDENT,AMMO;
__asm srwi r10,r11,31
__asm addme r10,r10
__asm and r11,r10,r11
__asm stw r11,AMMO
__asm stw r5,IDENT
if(cheat[2] && IDENT == 0x8323E248 )AMMO=100;
__asm lwz r11,AMMO
__asm stw r11,0(r3)
__asm lis r2,0x8220
__asm ori r2,r2,0x4820
__asm mtctr r2
__asm bctr
}
static void INFloop1(){ while(true) { if (_game == ID) {
if( cheat[1] )//Max_Money_Zombies
if( chkmem(0x823A9B40, 0x1D2961B8))asmpatch( 2, 0x823A9B40, Max_Money );
if( cheat[2] )//Inf_Ammo
if( chkmem(0x82204810, 0x556A0FFE))asmpatch( 2, 0x82204810, Inf_Ammo );
} Sleep(20); } }
And with the XPG User Engine my code caving Codes Does not work
properly that makes me Crasy
can you tell me whats the problem in xpg Engine or how I can add more code in XYZ Trainer Engine Please please please :)