adrs of the .rodata.sceModuleInfo file offset in prx

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

adrs of the .rodata.sceModuleInfo file offset in prx

Post by sauron_le_noir »

i'm currently writting a elf,prx dumper according to the information found in http://hitmen.c02.at/files/yapspd/psp_d ... ml#sec26.2 the adrs of the .rodata.sceModuleInfo file offset
can be found in the Program segment header in variable p_paddr (in elf format this is use for the physical adress).
according to hitmen if the prx is a kernel prx the most significant bit must be set.
Is this true with firmware > 1.5 because the doc is very outdated and if i understand good when it is a kernel prx to have the offset i must do this p_paddr & 0x7fffffff

Code: Select all

here is some output of my elf/prx dumper for this program

#include <pspkernel.h>

PSP_MODULE_INFO&#40;"dummyprx", 0, 1, 2&#41;;


int main&#40;&#41; 
&#123;
printf&#40;"Hello world"&#41;;
return 0;
&#125; 



******************
*     Header     *
******************
Magic header                      &#58;ELF
Class                             &#58;1 --> 32 bits objects
data encoding                     &#58;1 --> little endian
Version                           &#58;1
OS ABI identification             &#58;0 --> Unix System V ABI
EI_ABIVERSION                     &#58;0
Object file type                  &#58;FFA0 --> PSP PRX Executable file
Architecture                      &#58;8 --> MIPS R3000 big-endian
Entry point virtual address       &#58;AC
Program header table file offset  &#58;52
Section header table file offset  &#58;66100
Processor-specific flags          &#58;10A23001
ELF header size in bytes          &#58;52
Program header table entry size   &#58;32
Program header table entry count  &#58;1
Section header table entry size   &#58;40
Section header table entry count  &#58;35
Section header string table index &#58;34
********************************
*     Program Table Header     *
********************************
p_type                            &#58; 1 --> Loadable program segment
p_flags                           &#58; 5 --> segment is executable readable 
.rodata.sceModuleInfo file offset &#58; 60640
**********************
*     Module info    *
**********************
Module attribute &#58; 0
Module version   &#58; 2.1
Module name      &#58; dummyprx
Value of GP      &#58; 181C0
prx dump
Last edited by sauron_le_noir on Wed Sep 02, 2009 5:00 am, edited 1 time in total.
sauron_le_noir
Posts: 203
Joined: Sat Jul 05, 2008 8:03 am

Post by sauron_le_noir »

Responding myself to the question if prx is a kernel prx the offset must be anded with 0x7fffffff

Code: Select all

******************
*     Header     *
******************
Magic header                      &#58;ELF
Class                             &#58;1 --> 32 bits objects
data encoding                     &#58;1 --> little endian
Version                           &#58;1
OS ABI identification             &#58;0 --> Unix System V ABI
EI_ABIVERSION                     &#58;0
Object file type                  &#58;FFA0 --> PSP PRX Executable file
Architecture                      &#58;8 --> MIPS R3000 big-endian
Entry point virtual address       &#58;AC
Program header table file offset  &#58;52
Section header table file offset  &#58;66100
Processor-specific flags          &#58;10A23001
ELF header size in bytes          &#58;52
Program header table entry size   &#58;32
Program header table entry count  &#58;1
Section header table entry size   &#58;40
Section header table entry count  &#58;35
Section header string table index &#58;34
********************************
*     Program Table Header     *
********************************
p_type                            &#58; 1 --> Loadable program segment
p_flags                           &#58; 5 --> segment is executable readable 
p_offset                          &#58; 96
p_vaddr                           &#58; 0
p_filesz                          &#58; 66004
p_memsiz                          &#58; 91736
p_align                           &#58; 16
.rodata.sceModuleInfo file offset &#58; -2147423008
**********************
*     Module info    *
**********************
Module attribute                  &#58; 1000
Module version                    &#58; 2.1
Module name                       &#58; dummyprx
Value of GP                       &#58; 0x181C0 98752
Adrs lib.ent                      &#58; 0xEBFC 60412
Adrs lib.ent_btm                  &#58; 0xEC0C 60428
Adrs lib.stub                     &#58; 0xEC14 60436
Adrs lib.stub.btm                 &#58; 0xEC78 60536

prx dump

Post Reply