Adjust crt0 for NROs

This commit is contained in:
shinyquagsire23 2017-11-13 17:39:11 -07:00
parent 116da355bb
commit 14b56cd3de
2 changed files with 3 additions and 2 deletions

View File

@ -3,8 +3,10 @@
_start:
bl startup
.word 0
.ascii "HOMEBREW"
.org _start+0x80
startup:
// get aslr base
sub x28, x30, #4

View File

@ -163,8 +163,7 @@ int main(int argc, char* argv[]) {
fwrite(buf[i], nro_hdr.Segments[i].Size, 1, out);
}
fseek(out, 0, SEEK_SET);
fwrite(&nro_start, sizeof(nro_start), 1, out);
fseek(out, sizeof(nro_start), SEEK_SET);
fwrite(&nro_hdr, sizeof(nro_hdr), 1, out);
return EXIT_SUCCESS;