I need help for make a if (*(char*)

0

i need help

I make a SPRX (plugin PS3) and i want if the offset contain the hex / char it's can enable my code

My exemple:

if (*(char*)0x00000000 == 0x00) {
//CODE
}

This exemple work it's read the offset on my memory but, i want add more hex like 0x00, 0x00

When i try that, it's not work

I don't know if something like this can work:

char HEX[] = { 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80 };

if (*(char*)0x00000000 == HEX) {
//CODE
}

Thanks for your help !

c++
asked on Stack Overflow Mar 10, 2020 by Sakira57

1 Answer

0

I updated my answer to reflect your new information in the comment:

    char hex[]{ 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x00, 0x3F, 0x80 };

    //Check if array equal to another array at address
    char* addr = (char*)0x30000ABE4;
    bool same = true;
    for (int i = 0; i < 9; ++i) {
        if (addr[i] != hex[i]) {
            same = false;
        }
    }
    if (same) {
        cout << "RUN CODE" << endl;
    }
answered on Stack Overflow Mar 10, 2020 by Alex • edited Mar 10, 2020 by Alex

User contributions licensed under CC BY-SA 3.0