Last active
December 29, 2015 10:28
-
-
Save 173210/7656903 to your computer and use it in GitHub Desktop.
Binary Loader excluding NULL character for PSP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* by 173210 (adapted from valentine-hbl) */ | |
.set noat | |
.set noreorder | |
addiu $a0, $ra, 0x180 /* filename. If you change this value, move it in the savegame */ | |
li $a1, 258 | |
addiu $a2, $a1, -227 | |
jal sceIoOpen /* sceIoOpen */ | |
addiu $a1, $a1, -257 | |
xori $s0, $v0, 0xFFFF /* backup the return value of the function */ | |
xori $a0, $s0, 0xFFFF /* set the return value of the function for arg0 of the next function */ | |
lui $a1, 0x08C0 /* arg1 is 0x08C00000, load address of the binary file */ | |
jal sceIoRead /* sceIoRead */ | |
li $a2, 0xFFFF /* arg2, read 0xFFFF bytes from the file */ | |
jal sceIoClose /* sceIoClose */ | |
xori $a0, $s0, 0xFFFF /* restore the return value of the function for arg0 of the next function */ | |
j sceKernelDcacheWritebackInvalidateAll /* sceKernelDcacheWritebackInvalidateAll */ | |
lui $ra, 0x08C0 /* return address is 0x08C00000, load address of the binary file */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment