Announcement

Collapse
No announcement yet.

PRX trainer example

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PRX trainer example

    If someone interesting, here my first trainer source code

    Code:
    /*
    # # # # # # # # # # # # # # # # # # # # # #
    #                                         #
    #   Simple PRX trainer                    #
    #   for Demon's Souls BLES00932 v1.0      #
    #   with Playstation 3 System GUI         #
    #                                         #
    #   by dron_3                             #
    #                                         #
    # # # # # # # # # # # # # # # # # # # # # #
    */
    
    #include <sys/prx.h>
    #include <sys/ppu_thread.h>
    #include <sys/timer.h>
    #include <sys/memory.h>
    #include <cell/pad.h>
    #include <sysutil/sysutil_msgdialog.h>
    #include <sysutil/sysutil_oskdialog.h>
    
    SYS_MODULE_INFO( trainer, 0, 1, 1);
    SYS_MODULE_START( _trainer_start );
    
    //cheat flags
    #define CHEAT_HP        (1 << 0)
    #define CHEAT_MP        (1 << 1)
    #define CHEAT_STAMINA    (1 << 2)
    #define CHEAT_SOULS        (1 << 3)
    
    int cheatFlags = 0;
    
    //dialog state
    #define    STATE_IDLE        0
    #define    STATE_MESSAGE    1
    #define    STATE_OSKLOAD    2
    #define    STATE_OSK        3
    #define    STATE_OSKUNLOAD    4
    #define    STATE_EXITGAME    5
    
    int dialogState = STATE_IDLE;
    
    //message dialog variables
    char optionsString[512] = "1 - Infinite HP: OFF\n2 - Infinite MP: OFF\n3 - Infinite Stamina: OFF\n4 - Infinite Souls: OFF\n\n\nDo you want to change options?\n";
    const int resultNumChars = 4;
    
    //on-screen keyboard dialog variables
    CellOskDialogInputFieldInfo inputFieldInfo;
    CellOskDialogCallbackReturnParam OutputInfo;
    CellOskDialogPoint pos;
    CellOskDialogParam dialogParam;
    
    //controller data
    CellPadData PadData;
    
    //callback function for cellMsgDialogOpen2()
    void dialog_callback(int buttonType, void *userData)
    {
        switch(buttonType)
        {
        case CELL_MSGDIALOG_BUTTON_YES:
            dialogState = STATE_OSKLOAD;
            break;
    
        case CELL_MSGDIALOG_BUTTON_NO:
            dialogState = STATE_IDLE;
            break;
    
        case CELL_MSGDIALOG_BUTTON_ESCAPE:
            dialogState = STATE_IDLE;
            break;
        }
    }
    
    //callback function for cellSysutilRegisterCallback()
    void sysutil_callback(uint64_t status, uint64_t param, void *userData)
    {
        switch(status)
        {
        case CELL_SYSUTIL_OSKDIALOG_INPUT_ENTERED:
            //get entered string
            cellOskDialogGetInputText(&OutputInfo);
            cellOskDialogAbort();
            break;
    
        case CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED:
            cellOskDialogAbort();
            break;
    
        case CELL_SYSUTIL_OSKDIALOG_FINISHED:
            dialogState = STATE_OSKUNLOAD;
            break;
    
        case CELL_SYSUTIL_REQUEST_EXITGAME:
            dialogState = STATE_EXITGAME;
            break;
    
        default:
            break;
        }
    }
    
    //on-screen keyboard dialog initialization
    void dialog_init()
    {
        //field parameters
        inputFieldInfo.message = (uint16_t*)L"Enter option number";
        inputFieldInfo.init_text = (uint16_t*)L"";
        inputFieldInfo.limit_length = CELL_OSKDIALOG_STRING_SIZE;
        OutputInfo.result = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
        OutputInfo.numCharsResultString = resultNumChars;
        uint16_t resultTextBuffer[CELL_OSKDIALOG_STRING_SIZE + 1];
        OutputInfo.pResultString = resultTextBuffer;
    
        //key layout
        cellOskDialogSetKeyLayoutOption(CELL_OSKDIALOG_10KEY_PANEL);
    
        //activation parameters
        pos.x = 0.0;
        pos.y = 0.0;
        int32_t LayoutMode = CELL_OSKDIALOG_LAYOUTMODE_X_ALIGN_CENTER | CELL_OSKDIALOG_LAYOUTMODE_Y_ALIGN_TOP;
        cellOskDialogSetLayoutMode(LayoutMode);
        dialogParam.allowOskPanelFlg = CELL_OSKDIALOG_PANELMODE_NUMERAL;
        dialogParam.firstViewPanel = CELL_OSKDIALOG_PANELMODE_NUMERAL;
        dialogParam.controlPoint = pos;
        dialogParam.prohibitFlgs = 0;
    
        //registering callback function
        cellSysutilRegisterCallback(0, sysutil_callback, 0);
    }
    
    //display cheat menu dialog
    int uglycheatmenufunction()
    {
        //check input text from the on-screen keyboard dialog
        for(int i = 0; i < OutputInfo.numCharsResultString + 1; i++)
        {
            //check end of string
            if((OutputInfo.pResultString[i] & 0xFF) == '\0')
                break;
    
            //check and toggle options depending on input text
            switch(OutputInfo.pResultString[i] & 0xFF)
            {
            case '1':
                if(cheatFlags & CHEAT_HP)
                {
                    cheatFlags = cheatFlags ^ CHEAT_HP;
                    optionsString[18] = 'F';
                    optionsString[19] = 'F';
                }
                else
                {
                    cheatFlags = cheatFlags | CHEAT_HP;
                    optionsString[18] = 'N';
                    optionsString[19] = ' ';
                }
                break;
    
            case '2':
                if(cheatFlags & CHEAT_MP)
                {
                    cheatFlags = cheatFlags ^ CHEAT_MP;
                    optionsString[39] = 'F';
                    optionsString[40] = 'F';
                }
                else
                {
                    cheatFlags = cheatFlags | CHEAT_MP;
                    optionsString[39] = 'N';
                    optionsString[40] = ' ';
                }
                break;
    
            case '3':
                if(cheatFlags & CHEAT_STAMINA)
                {
                    cheatFlags = cheatFlags ^ CHEAT_STAMINA;
                    optionsString[65] = 'F';
                    optionsString[66] = 'F';
                }
                else
                {
                    cheatFlags = cheatFlags | CHEAT_STAMINA;
                    optionsString[65] = 'N';
                    optionsString[66] = ' ';
                }
                break;
    
            case '4':
                if(cheatFlags & CHEAT_SOULS)
                {
                    cheatFlags = cheatFlags ^ CHEAT_SOULS;
                    optionsString[89] = 'F';
                    optionsString[90] = 'F';
                }
                else
                {
                    cheatFlags = cheatFlags | CHEAT_SOULS;
                    optionsString[89] = 'N';
                    optionsString[90] = ' ';
                }
                break;
    
            default:
                break;
            }
            //clear input text
            OutputInfo.pResultString[0] = 0;
        }
    
        //open message dialog, return 1 if failed
        if(cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL |
                            CELL_MSGDIALOG_TYPE_SE_MUTE_OFF |
                            CELL_MSGDIALOG_TYPE_BG_VISIBLE |
                            CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO |
                            CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON |
                            CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_YES |
                            CELL_MSGDIALOG_TYPE_PROGRESSBAR_NONE,
                            optionsString, dialog_callback, 0, 0) != 0)
                            
                            return 1;
        return 0;
    }
    
    //cheat thread
    void thread_entry(uint64_t arg)
    {
        sys_timer_sleep(5);
    
        dialog_init();
    
        //open intro message
        cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL |
                                CELL_MSGDIALOG_TYPE_SE_MUTE_OFF |
                                CELL_MSGDIALOG_TYPE_BG_VISIBLE |
                                CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE |
                                CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF |
                                CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NONE |
                                CELL_MSGDIALOG_TYPE_PROGRESSBAR_NONE,
                                "PRX trainer by dron_3\n\n\nPress SELECT+START during game\n", dialog_callback, 0, 0);
    
        while(1)
        {
            sys_timer_usleep(100000);
    
            //get controller data
            cellPadGetData(0, &PadData);
            
            //check event and call callback
            cellSysutilCheckCallback();
    
            //open cheat menu, if SELECT+START pressed
            if((PadData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_SELECT) && (PadData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_START) && (dialogState == STATE_IDLE))
            {
                dialogState = STATE_MESSAGE;
                sys_timer_sleep(1);
    
                if(uglycheatmenufunction() != 0)
                    dialogState = STATE_IDLE;
            }
    
            //load on-screen keyboard
            if(dialogState == STATE_OSKLOAD)
            {
                dialogState = STATE_OSK;
                sys_timer_sleep(1);
    
                if(cellOskDialogLoadAsync(SYS_MEMORY_CONTAINER_ID_INVALID, &dialogParam, &inputFieldInfo) != 0)
                    dialogState = STATE_IDLE;
            }
    
            //unload on-screen keyboard
            if(dialogState == STATE_OSKUNLOAD)
            {
                dialogState = STATE_MESSAGE;
                cellOskDialogUnloadAsync(&OutputInfo);
                sys_timer_sleep(1);
    
                if(uglycheatmenufunction() != 0)
                    dialogState = STATE_IDLE;
            }
    
            //break cycle during game termination request event
            if(dialogState == STATE_EXITGAME)
                break;
    
            //write value depending on cheat flags
            if(*(uint32_t*)0x01B4A5EC != 0)
            {
                //HP
                if(cheatFlags & CHEAT_HP)
                    *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3C4) = 9999;
    
                //MP
                if(cheatFlags & CHEAT_MP)
                    *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3CC) = 9999;
    
                //Stamina
                if(cheatFlags & CHEAT_STAMINA)
                    *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3D4) = 9999;
    
                //Souls
                if(cheatFlags & CHEAT_SOULS)
                    if(*(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x49C) != 0)
                        *(uint32_t*)(*(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x49C) + 0x78) = 999999999;
            }
        }
    
        //exit thread
        sys_ppu_thread_exit(0);
    }
    
    extern "C" int _trainer_start(void)
    {
        //create thread
        sys_ppu_thread_t thread_id;
        sys_ppu_thread_create(&thread_id, thread_entry, 0, 1000, 0x1000, 0, "Cheat Thread");
    
        return SYS_PRX_RESIDENT;
    }
    in this trainer I used system GUI
    https://mega.nz/#!IpFm2IAT!y5jxURNGb...jRtregLdIVFIbM

    demonstration




    Also I made trainer for Borderlands 2 v1.15 BLES01684
    https://mega.nz/#!pktAiA5A!zMb_1yUPb...nblmMPfFjgQGTQ



    in this trainer I hooked and used Unreal Engine 3 functions
    Last edited by dron_3; 11-19-2016, 07:56 AM.
    http://dron-3.blogspot.com/

  • #2
    How to implement this ?
    Why don't you just release the trainer ?
    Ps3 scene is dead ! Just guitarman hacking some stuff sometimes
    Last edited by Borderlinez; 11-19-2016, 02:27 AM.

    Comment


    • #3
      Sorry, link in video description, now I added it in post.
      Last edited by dron_3; 11-19-2016, 08:14 AM.
      http://dron-3.blogspot.com/

      Comment


      • #4
        thank you nice work !

        Comment


        • #5
          I've wondered how to do something like this too, but once it comes to it being anything other than just PPC code I'd have no idea. I keep thinking to see if I can create a menu for games to toggle codes, but I'd probably need to make it a completely custom and different thing every game without a method like this.

          Yeah, the PS3 section is a bit slow. I'm usually doing games, I'm just slow and people keep wanting me to teach them how to find codes which can cause a big slowdown for me. At the moment I'm going through Diablo 3 trying to help teach Moises how to find codes on his own, I can't remember his username on here. It's the same game I greatly used to help guitarman learn a bit of how to do things. I'm hoping in the end that Moises will have an idea of how to find and make some codes on his own and will start doing so here too.
          July 7, 2019

          http://www.mediafire.com/file/9781uxzd2wjws92/PS3_Game_Cheats_Database_And_Tutorials_July_7%252C_2019.7z/file
          https://www.4shared.com/s/fLf6qQ66Zee
          https://www.sendspace.com/file/jvsdbd

          Comment


          • #6
            again thanks for the effort. sharing these stuffs with us is very enlightening. thanks bungholio and dron_3. you're keeping ps3 hacking alive. good work.

            Originally posted by Borderlinez View Post
            How to implement this ?
            Why don't you just release the trainer ?
            Ps3 scene is dead ! Just guitarman hacking some stuff sometimes
            i can't agree with you. codes are just not posted here or anywhere. it doesnt mean it's dead. there's so many people out there who hack on their own or with help from others. i'm one of them. i assure you when ps3 online gaming is cut off, ps3 scene will even grow more. the scene is just f*cked up by online cheaters.
            Last edited by sesiom316; 11-21-2016, 11:13 PM.

            Comment


            • #7
              Please allow me to bring about a better understanding and clarification as to what I meant ...
              PS4 is sony's number priority thus the ps3 has become and will continue to have less developers interested in the system ... conclusion being ps3 scene is dead in that aspect

              Ps3 Hack scene is dying !
              I understand that the majority of hackers don't release codes anymore due to the fact online cheating has become so popular so the end result is people release nothing instead and that's sad just my opinion !

              Look at other forums most codes you see on other sites are usually from and made by cmp hackers and others taking credit for them so again in return when the code author realizes this behaviour they stall future code releases ! and the few people like me that just want to enjoy a good offline game mode cannot have have that luxury anymore because of a few that spoil the fun for the majority !

              I respect all the hackers that take time to make codes when they can dron_3 Hiei-YYH, bungholio, GuitarMan, and those that i don't know of ! much respect
              Last edited by Borderlinez; 11-22-2016, 12:26 PM.

              Comment


              • #8
                dron_3 very interesting and thank you for this example. it would be nice if you could post at least the original codes for Demon Souls, so i can see where this is comming from. so i can try my own luck with another game. i remember you have already posted an example for resident evil revelations, but unluckily the old archive is unavailable

                also, it would be interesting to see in src how you have hooked these unreal engine functions.

                Comment


                • #9
                  I found pointers myself, maybe someone already did this before me
                  Code:
                  //Infinite HP
                  *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3C4) = 9999;
                  
                  //Infinite MP
                  *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3CC) = 9999;
                  
                  //Infinite Stamina
                  *(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x3D4) = 9999;
                  
                  //Infinite Souls
                  *(uint32_t*)(*(uint32_t*)(*(uint32_t*)0x01B4A5EC + 0x49C) + 0x78) = 999999999;
                  In CU format it looks like
                  Code:
                  Infinite HP
                  00003000 01B4A5EC 000003C4
                  00002000 00000000 0000270F
                  
                  Infinite MP
                  00003000 01B4A5EC 000003CC
                  00002000 00000000 0000270F
                  
                  Infinite Stamina
                  00003000 01B4A5EC 000003D4
                  00002000 00000000 0000270F
                  
                  Infinite Souls
                  00003000 01B4A5EC 000003CC
                  00003000 00000000 0000049C
                  00002000 00000000 3B9AC9FF
                  Yes, I posted prx VSH plugin example for RE Revelations 2, but these examples for executables, it mean EBOOT or SELF must be patched, for example with ingame_loader.exe http://www.ps3hax.net/showthread.php?t=65020&page=16

                  Maybe later I'll post source for hooking unreal engine function, but you can find useful info by searching in google TheFeckless UE3 SDK Generator, on PS3 I use same method like on PC, but without generating sdk.
                  Last edited by dron_3; 12-06-2016, 02:32 AM.
                  http://dron-3.blogspot.com/

                  Comment


                  • #10
                    thanks for your answer.
                    so you have used pointer codes, nice. medo has found an all in one code when my mind serves me right from looking at netcheat code files.

                    about prx loading, i have a different method by using cobra. i have added a prxloader to webman, which can attach prx files to game process with a button combo. only disadvantage here is, there are some games which do not like vsh plugins.

                    edit
                    dron_3 ok, i have got it working with another game. very cool your trainer stuff. thanks alot.

                    another thing, you have to add syscall41 sys_ppu_thread_exit, otherwise the plugin crashes.

                    edit2
                    nevermind. must be the way you are loading it...
                    Last edited by rippchen; 12-06-2016, 02:44 PM.

                    Comment


                    • #11
                      dron_3 Would have for the last of us bcus prx trainer?

                      Comment


                      • #12
                        Originally posted by John007 View Post
                        dron_3 Would have for the last of us bcus prx trainer?
                        i am still messing around with it to make it work for games with "normal" codes, but once i get it done, i can make a trainer for it. that is, if he doesn't mind using his sample with msgdialog

                        Comment


                        • #13
                          Originally posted by John007 View Post
                          dron_3 Would have for the last of us bcus prx trainer?
                          No, and don't plan.
                          http://dron-3.blogspot.com/

                          Comment


                          • #14
                            dron_3

                            have made now a prx trainer for resident evil revelations 2 (but only bles02040) from your sample prx. once again, many thanks for this awesome trainer sample.
                            i haven't verified all codes working though, but no reload health and gun speed working fine.

                            i also have added a ebootloader sprx, so you don't have to modify eboot. but, this will only work with cobra enabled.

                            ebootloader sprx has to be loaded with bootplugins.txt with cobra and has to be placed on dev_hdd0/ebootloader.sprx
                            this sprx txt has to be placed at dev_hdd0/tmp and the rer2.sprx as well. you can modify sprx.txt to your likings and load different sprx to game process.

                            only disadvantage, this game does not like it to load the sprx this way and it will reboot when exiting game. there are also other games where this happens, but besides, it works flawlessly.

                            to load sprx to game process, you have to go to ingame xmb and then press R1+O. you will get a popup saying sprx loaded fine, or sprx load error.
                            when you load this trainer sprx to eboot process (when popup appears), you have to close immediately ingame xmb, otherwise you will be stuck on pause screen when game starts.

                            Code:
                            /*
                            # # # # # # # # # # # # # # # # # # # # # #
                            #                                         #
                            #   Simple PRX trainer                    #
                            #   for Resident Evil Revelations 2 BLES02040 v1.0      #
                            #   with Playstation 3 System GUI         #
                            #                                         #
                            #   by dron_3                             #
                            #                                         #
                            # # # # # # # # # # # # # # # # # # # # # #
                            */
                            
                            #include <cellstatus.h>
                            #include <cell/pad.h>
                            #include <sys/prx.h>
                            #include <sys/ppu_thread.h>
                            #include <sys/timer.h>
                            #include <sys/process.h>
                            #include <sys/memory.h>
                            #include <sys/syscall.h>
                            #include <sysutil/sysutil_msgdialog.h>
                            #include <sysutil/sysutil_oskdialog.h>
                            
                            SYS_MODULE_INFO( Trainer, 0, 1, 1);
                            SYS_MODULE_START( trainer_start );
                            
                            SYS_LIB_DECLARE_WITH_STUB( LIBNAME, SYS_LIB_AUTO_EXPORT, STUBNAME );
                            SYS_LIB_EXPORT( trainer_export_function, LIBNAME );
                            
                            int trainer_export_function(void);
                            int trainer_start(void);
                            
                            //cheat flags
                            #define CHEAT_HP        (1 << 0)
                            #define CHEAT_AMMO        (1 << 1)
                            #define CHEAT_TIMER            (1 << 2)
                            #define CHEAT_CRYSTALS            (1 << 3)
                            #define CHEAT_BOTTLES            (1 << 4)
                            #define CHEAT_BP            (1 << 5)
                            #define CHEAT_SKILL            (1 << 6)
                            // #define CHEAT_KNIFE            (1 << 7)
                            #define CHEAT_GUNS            (1 <<7)
                            
                            int cheatFlags = 0;
                            
                            //dialog state
                            #define    STATE_IDLE        0
                            #define    STATE_MESSAGE    1
                            #define    STATE_OSKLOAD    2
                            #define    STATE_OSK        3
                            #define    STATE_OSKUNLOAD    4
                            #define    STATE_EXITGAME    5
                            
                            int dialogState = STATE_IDLE;
                            
                            //message dialog variables
                            char optionsString[512] = "1. Infinite HP: OFF\n2. No Reload: OFF\n3. Freeze Clear Timer: OFF\n4. Infinite Life Crystals: OFF\n5. Infinite Bottles: OFF\n6. Max BP: OFF\n7. Max Skill: OFF\n8. Gun Speed Up: OFF\n\n\nDo you want to change options?\n";
                            // char optionsString[512] = "1. Infinite HP: OFF\n2. No Reload: OFF\n3. Freeze Clear Timer: OFF\n4. Infinite Life Crystals: OFF\n5. Infinite Bottles: OFF\n6. Max BP: OFF\n7. Max Skill: OFF\n8. Gun Speed Up: OFF\n\n\nMöchtest du die Einstellungen ändern?\n";
                            const int resultNumChars = 4;
                            
                            //on-screen keyboard dialog variables
                            CellOskDialogInputFieldInfo inputFieldInfo;
                            CellOskDialogCallbackReturnParam OutputInfo;
                            CellOskDialogPoint pos;
                            CellOskDialogParam dialogParam;
                            
                            //controller data
                            CellPadData PadData;
                            
                            // An exported function is needed to generate the project's PRX stub export library
                            int trainer_export_function(void)
                            {
                                return CELL_OK;
                            }
                            
                            static inline void _sys_ppu_thread_exit(uint64_t val)
                            {
                                system_call_1(41, val);
                            }
                            
                            static int32_t write_process(uint64_t ea, const void * data, uint32_t size)
                            {
                                system_call_4(905, (uint64_t)sys_process_getpid(), ea, size, (uint64_t)data);
                                return_to_user_prog(int32_t);
                            }
                            
                            //callback function for cellMsgDialogOpen2()
                            static void dialog_callback(int buttonType, void *userData)
                            {
                                switch(buttonType)
                                {
                                case CELL_MSGDIALOG_BUTTON_YES:
                                    dialogState = STATE_OSKLOAD;
                                    break;
                            
                                case CELL_MSGDIALOG_BUTTON_NO:
                                    dialogState = STATE_IDLE;
                                    break;
                            
                                case CELL_MSGDIALOG_BUTTON_ESCAPE:
                                    dialogState = STATE_IDLE;
                                    break;
                                }
                            }
                            
                            //callback function for cellSysutilRegisterCallback()
                            static void sysutil_callback(uint64_t status, uint64_t param, void *userData)
                            {
                                switch(status)
                                {
                                case CELL_SYSUTIL_OSKDIALOG_INPUT_ENTERED:
                                    //get entered string
                                    cellOskDialogGetInputText(&OutputInfo);
                                    cellOskDialogAbort();
                                    break;
                            
                                case CELL_SYSUTIL_OSKDIALOG_INPUT_CANCELED:
                                    cellOskDialogAbort();
                                    break;
                            
                                case CELL_SYSUTIL_OSKDIALOG_FINISHED:
                                    dialogState = STATE_OSKUNLOAD;
                                    break;
                            
                                case CELL_SYSUTIL_REQUEST_EXITGAME:
                                    dialogState = STATE_EXITGAME;
                                    break;
                            
                                default:
                                    break;
                                }
                            }
                            
                            //on-screen keyboard dialog initialization
                            static void dialog_init(void)
                            {
                                //field parameters
                                inputFieldInfo.message = (uint16_t*)L"Enter option number";
                                inputFieldInfo.init_text = (uint16_t*)L"";
                                inputFieldInfo.limit_length = CELL_OSKDIALOG_STRING_SIZE;
                                OutputInfo.result = CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK;
                                OutputInfo.numCharsResultString = resultNumChars;
                                uint16_t resultTextBuffer[CELL_OSKDIALOG_STRING_SIZE + 1];
                                OutputInfo.pResultString = resultTextBuffer;
                            
                                //key layout
                                cellOskDialogSetKeyLayoutOption(CELL_OSKDIALOG_10KEY_PANEL);
                            
                                //activation parameters
                                pos.x = 0.0;
                                pos.y = 0.0;
                                int32_t LayoutMode = CELL_OSKDIALOG_LAYOUTMODE_X_ALIGN_CENTER | CELL_OSKDIALOG_LAYOUTMODE_Y_ALIGN_TOP;
                                cellOskDialogSetLayoutMode(LayoutMode);
                                dialogParam.allowOskPanelFlg = CELL_OSKDIALOG_PANELMODE_NUMERAL;
                                dialogParam.firstViewPanel = CELL_OSKDIALOG_PANELMODE_NUMERAL;
                                dialogParam.controlPoint = pos;
                                dialogParam.prohibitFlgs = 0;
                            
                                //registering callback function
                                cellSysutilRegisterCallback(0, sysutil_callback, 0);
                            }
                            
                            //display cheat menu dialog
                            static int uglycheatmenufunction(void)
                            {
                                //check input text from the on-screen keyboard dialog
                                for(int i = 0; i < OutputInfo.numCharsResultString + 1; i++)
                                {
                                    //check end of string
                                    if((OutputInfo.pResultString[i] & 0xFF) == '\0')
                                        break;
                            
                                    //check and toggle options depending on input text
                                    switch(OutputInfo.pResultString[i] & 0xFF)
                                    {
                                    case '1':
                                        if(cheatFlags & CHEAT_HP)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_HP;
                                            optionsString[17] = 'F';
                                            optionsString[18] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_HP;
                                            optionsString[17] = 'N';
                                            optionsString[18] = ' ';
                                        }
                                        break;
                            
                                    case '2':
                                        if(cheatFlags & CHEAT_AMMO)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_AMMO;
                                            optionsString[35] = 'F';
                                            optionsString[36] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_AMMO;
                                            optionsString[35] = 'N';
                                            optionsString[36] = ' ';
                                        }
                                        break;
                            
                                    case '3':
                                        if(cheatFlags & CHEAT_TIMER)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_TIMER;
                                            optionsString[62] = 'F';
                                            optionsString[63] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_TIMER;
                                            optionsString[62] = 'N';
                                            optionsString[63] = ' ';
                                        }
                                        break;
                            
                                    case '4':
                                        if(cheatFlags & CHEAT_CRYSTALS)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_CRYSTALS;
                                            optionsString[93] = 'F';
                                            optionsString[94] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_CRYSTALS;
                                            optionsString[93] = 'N';
                                            optionsString[94] = ' ';
                                        }
                                        break;
                            
                                    case '5':
                                        if(cheatFlags & CHEAT_BOTTLES)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_BOTTLES;
                                            optionsString[118] = 'F';
                                            optionsString[119] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_BOTTLES;
                                            optionsString[118] = 'N';
                                            optionsString[119] = ' ';
                                        }
                                        break;
                            
                                    case '6':
                                        if(cheatFlags & CHEAT_BP)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_BP;
                                            optionsString[133] = 'F';
                                            optionsString[134] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_BP;
                                            optionsString[133] = 'N';
                                            optionsString[134] = ' ';
                                        }
                                        break;
                            
                                    case '7':
                                        if(cheatFlags & CHEAT_SKILL)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_SKILL;
                                            optionsString[151] = 'F';
                                            optionsString[152] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_SKILL;
                                            optionsString[151] = 'N';
                                            optionsString[152] = ' ';
                                        }
                                        break;
                            
                            /*         case '8':
                                        if(cheatFlags & CHEAT_KNIFE)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_KNIFE;
                                            optionsString[174] = 'F';
                                            optionsString[175] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_KNIFE;
                                            optionsString[174] = 'N';
                                            optionsString[175] = ' ';
                                        }
                                        break; */
                            
                                    case '8':
                                        if(cheatFlags & CHEAT_GUNS)
                                        {
                                            cheatFlags = cheatFlags ^ CHEAT_GUNS;
                                            optionsString[172] = 'F';
                                            optionsString[173] = 'F';
                                        }
                                        else
                                        {
                                            cheatFlags = cheatFlags | CHEAT_GUNS;
                                            optionsString[172] = 'N';
                                            optionsString[173] = ' ';
                                        }
                                        break;
                            
                                    default:
                                        break;
                                    }
                                    //clear input text
                                    OutputInfo.pResultString[0] = 0;
                                }
                            
                                //open message dialog, return 1 if failed
                                if(cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL |
                                                    CELL_MSGDIALOG_TYPE_SE_MUTE_OFF |
                                                    CELL_MSGDIALOG_TYPE_BG_VISIBLE |
                                                    CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO |
                                                    CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_ON |
                                                    CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_YES |
                                                    CELL_MSGDIALOG_TYPE_PROGRESSBAR_NONE,
                                                    optionsString, dialog_callback, 0, 0) != 0)
                                                    
                                                    return 1;
                                return 0;
                            }
                            
                            //cheat thread
                            static void thread_entry(uint64_t arg)
                            {
                                sys_timer_sleep(5);
                            
                                dialog_init();
                            
                                //open intro message
                                cellMsgDialogOpen2(CELL_MSGDIALOG_TYPE_SE_TYPE_NORMAL |
                                                        CELL_MSGDIALOG_TYPE_SE_MUTE_OFF |
                                                        CELL_MSGDIALOG_TYPE_BG_VISIBLE |
                                                        CELL_MSGDIALOG_TYPE_BUTTON_TYPE_NONE |
                                                        CELL_MSGDIALOG_TYPE_DISABLE_CANCEL_OFF |
                                                        CELL_MSGDIALOG_TYPE_DEFAULT_CURSOR_NONE |
                                                        CELL_MSGDIALOG_TYPE_PROGRESSBAR_NONE,
                                                        "PRX trainer by dron_3\nResident Evil Revelations 2 (BLES02040) by rippchen\n\nPress SELECT+START during game\n", dialog_callback, 0, 0);
                                                        // "PRX trainer by dron_3\nResident Evil Revelations 2 (BLES02040) by rippchen\n\nDrücke SELECT+START während dem Spiel\n", dialog_callback, 0, 0);
                            
                                while(1)
                                {
                                    // GameProcessID = GetGameProcessID();
                                    sys_timer_usleep(100000);
                            
                                    //get controller data
                                    cellPadGetData(0, &PadData);
                                    
                                    //check event and call callback
                                    cellSysutilCheckCallback();
                            
                                    //open cheat menu, if SELECT+START pressed
                                    if((PadData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_SELECT) && (PadData.button[CELL_PAD_BTN_OFFSET_DIGITAL1] & CELL_PAD_CTRL_START) && (dialogState == STATE_IDLE))
                                    {
                                        dialogState = STATE_MESSAGE;
                                        sys_timer_sleep(1);
                            
                                        if(uglycheatmenufunction() != 0)
                                            dialogState = STATE_IDLE;
                                    }
                            
                                    //load on-screen keyboard
                                    if(dialogState == STATE_OSKLOAD)
                                    {
                                        dialogState = STATE_OSK;
                                        sys_timer_sleep(1);
                            
                                        if(cellOskDialogLoadAsync(SYS_MEMORY_CONTAINER_ID_INVALID, &dialogParam, &inputFieldInfo) != 0)
                                            dialogState = STATE_IDLE;
                                    }
                            
                                    //unload on-screen keyboard
                                    if(dialogState == STATE_OSKUNLOAD)
                                    {
                                        dialogState = STATE_MESSAGE;
                                        cellOskDialogUnloadAsync(&OutputInfo);
                                        sys_timer_sleep(1);
                            
                                        if(uglycheatmenufunction() != 0)
                                            dialogState = STATE_IDLE;
                                    }
                            
                                    //break cycle during game termination request event
                                    if(dialogState == STATE_EXITGAME)
                                        break;
                            
                                    //write value depending on cheat flags
                                    if(*(uint32_t*)0x004236B8 != 0)
                                    {
                                        if(cheatFlags & CHEAT_HP)
                                        {
                                            unsigned char code_bytes[] = { 0x60, 0x7E, 0x00, 0x00 };
                                            write_process(0x004236B8, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_HP))
                                        {
                                            unsigned char code_bytes[] = { 0x7F, 0xC3, 0xF0, 0x14 };
                                            write_process(0x004236B8, code_bytes, 4);
                                        }
                            
                                        if(cheatFlags & CHEAT_AMMO)
                                        {
                                            unsigned char code_bytes[] = { 0x90, 0xDD, 0x00, 0x0C };
                                            write_process(0x0042C818, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_AMMO))
                                        {
                                            unsigned char code_bytes[] = { 0x90, 0x7D, 0x00, 0x0C };
                                            write_process(0x0042C818, code_bytes, 4);
                                        }
                            
                                        if(cheatFlags & CHEAT_TIMER)
                                        {
                                            unsigned char code_bytes[] = { 0x60, 0x00, 0x00, 0x00 };
                                            write_process(0x007D2140, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_TIMER))
                                        {
                                            unsigned char code_bytes[] = { 0xEC, 0x63, 0x08, 0x2A };
                                            write_process(0x007D2140, code_bytes, 4);
                                        }
                            
                                        if(cheatFlags & CHEAT_CRYSTALS)
                                        {
                                            unsigned char code_bytes[] = { 0x60, 0x00, 0x00, 0x00 };
                                            write_process(0x007DC2EC, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_CRYSTALS))
                                        {
                                            unsigned char code_bytes[] = { 0x7C, 0x84, 0xE0, 0x14 };
                                            write_process(0x007DC2EC, code_bytes, 4);
                                        }
                            
                                        if(cheatFlags & CHEAT_BOTTLES)
                                        {
                                            unsigned char code_bytes[] = { 0x60, 0x00, 0x00, 0x00 };
                                            write_process(0x003F5CF8, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_BOTTLES))
                                        {
                                            unsigned char code_bytes[] = { 0x7C, 0xBD, 0x28, 0x10 };
                                            write_process(0x003F5CF8, code_bytes, 4);
                                        }
                            
                                        if(cheatFlags & CHEAT_BP)
                                        {
                                            unsigned char code_bytes[] = { 0x3C, 0xC0, 0x00, 0x0F, 0x60, 0xC6, 0x42, 0x3F };
                                            write_process(0x007D9B0C, code_bytes, 8);
                                        }
                                        if(!(cheatFlags & CHEAT_BP))
                                        {
                                            unsigned char code_bytes[] = { 0x40, 0x81, 0x00, 0x08, 0x7C, 0xC4, 0x28, 0x10 };
                                            write_process(0x007D9B0C, code_bytes, 8);
                                        }
                            
                                        if(cheatFlags & CHEAT_SKILL)
                                        {
                                            unsigned char code_bytes[] = { 0x60, 0x00, 0x00, 0x00 };
                                            write_process(0x00878DC0, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_SKILL))
                                        {
                                            unsigned char code_bytes[] = { 0x40, 0x81, 0x00, 0x0C };
                                            write_process(0x00878DC0, code_bytes, 4);
                                        }
                            
                            /*             if(cheatFlags & CHEAT_KNIFE)
                                        {
                                            unsigned char code_bytes[] = { 0x40, 0x00, 0x00, 0x00 };
                                            write_process(0x0019AD60, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_KNIFE))
                                        {
                                            unsigned char code_bytes[] = { 0x3F, 0x80, 0x00, 0x00 };
                                            write_process(0x0019AD60, code_bytes, 4);
                                        } */
                            
                                        if(cheatFlags & CHEAT_GUNS)
                                        {
                                            unsigned char code_bytes[] = { 0x40, 0x00, 0x00, 0x00 };
                                            write_process(0x003D14F4, code_bytes, 4);
                                        }
                                        if(!(cheatFlags & CHEAT_GUNS))
                                        {
                                            unsigned char code_bytes[] = { 0x3F, 0x80, 0x00, 0x00 };
                                            write_process(0x003D14F4, code_bytes, 4);
                                        }
                                    }
                                }
                            
                                //exit thread
                                sys_ppu_thread_exit(0);
                            }
                            
                            int trainer_start(void)
                            {
                                //create thread
                                sys_ppu_thread_t thread_id;
                                sys_ppu_thread_create(&thread_id, thread_entry, 0, 1000, 0x1000, 0, "Cheat_Thread");
                            
                                _sys_ppu_thread_exit(0);
                                return SYS_PRX_RESIDENT;
                            }
                            http://www7.zippyshare.com/v/LR1T4Bgf/file.html

                            oh, btw this trainer will only work on dex, because of syscall
                            Last edited by rippchen; 12-17-2016, 03:58 AM.

                            Comment

                            Working...
                            X