Page 1 of 1
Import irx functions without symbols
Posted: Sun Jul 08, 2007 11:12 am
by wmspider
Hi,
i was wondering how i could import functions from irx modules that dont have a symbol table (In C programming language). In every tutorial i've read they say "you can easily find the functions and recreate the call in C". The problem is, i don't know how.
Maybe the solution to this problem is obvious or something, but im a newbie to this kind of stuff...
Posted: Sun Jul 08, 2007 12:34 pm
by radad
irx modules have an export table which define by number the functions available. Sometime they have a name as well. But to work out the paramters expected you will have to look at the disassembly of the function. If you are a newbie it may be beyond you.
Posted: Sun Jul 08, 2007 11:39 pm
by wmspider
Sorry, i'll try to put my question clearer: I am a newbie to loading modules, but i know how to program in c/c++ and i know how to dissassemble the module (i already know where the functions are and what arguments they need). the only problem is i don't know how to load the modules and call those funtions in my program if they arent defined in a .h file. i've never worked with external librariens, only with header files...
Posted: Mon Jul 09, 2007 9:39 am
by radad
For those modules that exist in the rom they have been defined in ps2sdk/iop/kernel. For example, take a look at
cdvdman.s and its header
cdvdman.h. You will need to create these files yourself if they don't exist for the module you are trying to import.
For modules created as part of the ps2sdk they have used a different system which are basically just macros to create the same thing as the assembly file above. For example, take a look at
iomamx imports and
irx_imports.h.
Posted: Mon Jul 09, 2007 7:52 pm
by wmspider
Ok, i think i got it. I'll look through
irx.h to see how it works exactly. Thanks!