Skip to: Site menu | Main content


Welcome to PSP-Programming.com, a place for developers to get together.

Welcome to the forums. Here you can find other user tutorials as well as homebrew releases and the source code repository. You can also ask for help with your code here and post your own homebrew!

PSP-Programming.com Forums
February 10, 2012, 01:45:07 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

News: Welcome to PSP-Programming.com
Home Help Search Shop Login Register
Digg This!
Pages: [1]
Print
Author Topic: Binary Loader by Matiaz  (Read 1458 times)
ZeCoxao
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2
183.19 points

View Inventory
Send Money to ZeCoxao

View Profile
« on: August 20, 2010, 11:06:20 AM »


Could someone explain to me what this code does?
Why is 0x08804000 gripshift's text address ?
(I edited it so it could be shown on the screen, but before it said "gripshift text address is 0x08804000") And what's with the 0x0881s shown on the code ?
Thanks in advance
Logged


mowglisanu

C/C++ Developer
Hero Member
*

Karma: +36/-11
Offline Offline

Posts: 787
0.00 points

View Inventory
Send Money to mowglisanu


View Profile
« Reply #1 on: August 20, 2010, 03:44:33 PM »

Quote
Why is 0x08804000 gripshift's text address ?
Thats where apps are loaded.
Quote
Could someone explain to me what this code does?
well its pretty much spelled out for you.

store the address of the file name in $a0(0xC0 offset from $ra)
store the value of the flags in $a1(O_RDONLY)
store the value of the file mode in $a2(0037, i wonder if this matters since they didn't use 0777)
then call sceIoOpen($a0, $a1, $a2)
store the return of sceIoOpen in $a0
store 0x08810000 in $a1
store 0x10000 in $a2
call sceIoRead($a0, $a1, $a2); so your reading $a2 bytes into buffer located at$a1 from the file specified by $a0store the return of sceIoOpen in $a0
store 0x08810000 in $a0
store 0x10000 in $a1
call sceKernelDcacheInvalidateRange($a0, $a1); so your clearing the cache for address $a0 for $a1 bytes
wait for 2 instuctions
store 0x088100000 in $a0
goto $a0


all thats going on here is that you're loading 0x100000 bytes of data from a file into memory at address 0x088100000, invalidaing the data cache so that none of it is overwritten then executing it.

Logged

Check out my:
 Audio lib
 Pmf Viewer
ZeCoxao
Newbie
*

Karma: +0/-0
Offline Offline

Posts: 2
183.19 points

View Inventory
Send Money to ZeCoxao

View Profile
« Reply #2 on: August 21, 2010, 01:13:57 AM »

Ok thanks for your explanation
Logged
Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.586 seconds with 26 queries.
Sister Sites: Guitar Hero 4   BrokeniTouch.com