S16v3: add sp un-leak
This commit is contained in:
+7
-5
@@ -393,12 +393,14 @@ def main():
|
||||
mu.mem_write(0x08006964, bytes.fromhex(
|
||||
"04c09de50c309fe5002093e5022082e3002083e51eff2fe1"
|
||||
"00a17300"))
|
||||
# S16-stublet (b25, 44B @0x08006CC0): smart return for B66 bx ip.
|
||||
# ip odd + top 8 (DDRLOW/DDRHIGH code) => bx ip (legit pushed-lr
|
||||
# return); else default (restore r7, jump poll resumption 0x8007779).
|
||||
# S16-stublet (b27, 50B @0x08006CC0): smart return for B66 bx ip.
|
||||
# ip odd + top 8 (code) => add sp,#8 (pop the helper frame it
|
||||
# skipped!) + bx ip (legit pushed-lr return, un-leaks the stack);
|
||||
# else default (restore r7, jump poll resumption 0x8007779).
|
||||
mu.mem_write(0x08006CC0, bytes.fromhex(
|
||||
"1cf0010f09d05fea1c63082b00d160475fea1c73082b00d"
|
||||
"160474af20007c0f2730747f2797cc0f6000c6047"))
|
||||
"ddf804c01cf0010f0bd05fea1c63082b00d102b06047"
|
||||
"5fea1c73082b00d160474af20007c0f2730747f2797c"
|
||||
"c0f6000c6047"))
|
||||
# stack zone fill (STUBV odd)
|
||||
mu.mem_write(0x085F0000, struct.pack("<I", STUBV) * (0x10000 // 4))
|
||||
# pop-site slots (sp values from traces)
|
||||
|
||||
Reference in New Issue
Block a user