pinwhell / Linux-Process-Library

Toolkit for precise Android/Linux process memory control, enabling reading, writing, module handling, and dynamic code manipulation.
MIT License
88 stars 38 forks source link

MultiLevelPointer problem #2

Closed Ezriral closed 2 years ago

Ezriral commented 2 years ago

Im really happy that i found your project, and i like to use it, but i am stucking at some problem i cannot really figure out how to solve it. I found the pointer for the value in cheatengine.

    uintptr_t libil2cppAddr = p.GetModBaseAddr("libil2cpp.so.2");
    uintptr_t pointAddr = p.FindDMAddy(libil2cppAddr + 0x0014ED90, {0x8CC, 0x830, 0x154, 0x2C, 0x8, 0x184, 0x408});
    int value = p.ReadProcessMemory<int>(pointAddr);

the problem is its not solving the way to the pointer correctly. Here you can see the correct CE way. CE

but over the program its showing different addresses and i have the feeling its also dont find the ModBaseAddress. In the follwing image you can see the path of the address which is calculated by your function "uintptr_t ProcessManager::FindDMAddy(uintptr_t base, std::vector offsets)" i added some lines to show me what the output is for every iteration.

uintptr_t ProcessManager::FindDMAddy(uintptr_t base, std::vector<uintptr_t> offsets)
{
    uintptr_t result = base;

    char hex_string[20];
    int f = reinterpret_cast<std::uintptr_t>(result);
    sprintf(hex_string, "%X", f); //convert number to hex
    printf("Result FindDMAddy: %s \n", hex_string);

    for(int i = 0; i < offsets.size(); i++)
    {
    f = reinterpret_cast<std::uintptr_t>(result);
    sprintf(hex_string, "%X", f); //convert number to hex
    printf("Result Loop FindDMAddy: %s \n", hex_string);

        result = ReadProcessMemory<uintptr_t>(result);
        result += offsets[i];

    printf("Offset Int: %u", offsets[i]);
    f = reinterpret_cast<std::uintptr_t>(offsets[i]);
    sprintf(hex_string, "%X", f); //convert number to hex
    printf(" => Hex %s \n", hex_string);
    }

    return result;
}

NA

So yes, i would be happy if you could tell me whats wrong here, cause i also dont know right now where to post my question. And i guess asking the dev would be the right decesion.

Thank you

pinwhell commented 2 years ago

im happy you found usefull my project, have you checked "libil2cppAddr"? can you try libil2cpp.so?, also, where are you running this, in a emulator or real device, witch device or emulator

Ezriral commented 2 years ago

Im sorry im using MEmu 7.6.6 Android 7.1.2 and yes its a emualtor.

And yes i also changed it to libil2cpp.so before but both are not working, NA2

pinwhell commented 2 years ago

its probably a parsing error, located in the function ParseMapLineSegment , can you send me samples of the maps of the process your trying to access?

pinwhell commented 2 years ago

the parser seems working on this samples properly, need to watch GetMapsBuffer clousely to see if it retrieve the full maps file

Ezriral commented 2 years ago

Yes i alreday checked it and wanna post it right now. it seems like the libi2lcpp.so.2 doesnt exist in the map. I can find the line lib/arm/libil2cpp.so but i cannot find the selected one from CE

Here one with the standard il2cpp and the other one with "so.2" NA2 NA3

pinwhell commented 2 years ago

134217728 -> 0x8000000, witch is correct, 08000000-0b2ca000 r--p 00000000 08:13 294959 /data/app/com.**.***-2/lib/arm/libil2cpp.so, so what about finddmaddy, still having same issue?

pinwhell commented 2 years ago

probably cheat engine gives another name to the librarys(which i didnt see before), to check if libil2cpp.so.2 == libil2cpp.so(in maps), just compare both addresses in memory, if both are 0x08000000, then dont worry about the naming and try using it like that in the lib!

Ezriral commented 2 years ago

Okay i hope i will find a solution, thank you for helping a stranger : ) have a nice day sir.

pinwhell commented 2 years ago

no problem!, hope it helped, anything else we are here to help!