Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DWARF] Use MIPS register names for DWARF dumped from MIPS binaries #88

Open
1superchip opened this issue Feb 3, 2025 · 0 comments
Open

Comments

@1superchip
Copy link
Contributor

1superchip commented Feb 3, 2025

DTK was designed around PPC but it also supports LE DWARF info which allows it to be used for PS2 binaries that contain DWARF v1. When dumping DWARF info from MIPS binaries, the register names used are PPC names. Using the MIPS names for registers would help when decompiling rather than seeing the PPC names.

Related source:

pub const REGISTER_NAMES: [&str; 109] = [

MIPS register names: https://en.wikibooks.org/wiki/MIPS_Assembly/Register_File

In the following code, r29 is actually sp for MIPS.

/*
    Compile unit: C:\work\sf33rd\AcrSDK\ps2\flps2vram.c
    Producer: MW MIPS C Compiler
    Language: C
    Code range: 0x003FC830 -> 0x003FC968
*/
// Range: 0x3FC830 -> 0x3FC968
static void PageConv4to32(unsigned char * p_input /* r29+0xB0 */, unsigned char * p_output /* r29+0xC0 */, signed int p_page_w /* r29+0xD0 */) {
    // Blocks
    /* anonymous block */ {
        // Range: 0x3FC830 -> 0x3FC968
        signed int i; // r17
        signed int j; // r16
        signed int nb; // r18
        signed int * tbl; // r19
        unsigned char * pi; // r29+0xAC
        unsigned char * po; // r30
        signed int n_width; // r23
        signed int n_height; // r22
        signed int i_size; // r21
        signed int o_size; // r20
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant