how to patch this code on xpg engine help

Discussion in 'Trainer Creation' started by trainee 2, Jun 24, 2015.

  1. tr

    trainee 2 Newbie
    205/282

    Ok from what i have found out so far i believe this is a codecave for engines on this site
    VOID __declspec(naked) CheckHP(VOID) {
    DWORD myPtr;//
    __asm {
    mr myPtr,r3 // mr myptr,r3 (move register My Pointer = r3)
    stw r10,20h(r31)
    fsubs fr12,fr0,fr13
    fsel fr11,fr12,fr13,fr0
    stfs fr11,34Ch(r31)
    }
    if (myPtr == 0x01 && InfHealth == TRUE) {
    float fltValue = 10000.0f;
    __asm
    {
    stfs fltValue,34Ch(r31)
    }
    }
    else if (myPtr == 0x063C && OneHitKo == TRUE) {
    (myPtr != 0x01 && OneHitKo == TRUE)
    float XfltValue = -100.0f;
    __asm
    {
    stfs XfltValue,8(r31)
    }
    }
    __asm{
    lis r11,0x82A9 //1st half of return address
    ori r11,r11,0x0A58//2nd half of return address
    mtctr r11
    bctr
    }
    so my question is this this is also double not dword
    //82567348 54C0077A rlwinm r0,r6,0,29,29
    //8256734C 2C000000 cmpwi r0,0
    //82567350 D9C90000 stfd fr14,0(r9)
    //82567354 408200A4 bne 825673F8 // how do you deal with this or something similar
    //82567358 80F00000 lwz r7,0(r16)
    This is an actual break point for a request in youre trainer section and this is how i patched it but our patches are simillar but also differant

    ASM void NameOfCave(){
    //82567348 54C0077A rlwinm r0,r6,0,29,29
    //8256734C 2C000000 cmpwi r0,0
    //82567350 D9C90000 stfd fr14,0(r9)
    //82567354 408200A4 bne 825673F8
    //82567358 80F00000 lwz r7,0(r16)
    DWORD p1,ret; DOUBLE f1;
    __asm mtctr r10
    __asm rlwinm r0,r6,0,29,29
    __asm cmpwi r0,0
    __asm lwz p1,12(r9)
    __asm stfd fr14,f1
    if (MyTrainer.Cheat[1] && p1 == 0x414c20c0)f1 = 1000000000.0;
    __asm lfd fr14,f1
    __asm stfd fr14,0(r9)
    __asm mfctr r10
    __asm bne branch
    ret = 0x82567358;
    __asm mtctr ret
    __asm bctr
    __asm branch:;
    ret = 0x825673F8;
    __asm mtctr ret
    __asm bctr
    }
    believe it or not this is just for money lol
     
  2. sensi420

    sensi420 Contributor TeamXPG
    205/282

    easy fix

    //82567354 408200A4 bne 825673F8

    add to asm
    bne $825673F8


    __asm
    {
    $825673F8 :
    lis r11, 8256
    ori r11, r11, 73F8
    mtctr r11
    bctrl
    }
     
  3. tr

    trainee 2 Newbie
    0/47

    thanks a lot mate , i appreciate it , ill have a go at making this and if i get it i will post the trainer
     

Share This Page