S16v4: reject STUBV return
This commit is contained in:
+14
-12
@@ -751,20 +751,22 @@ static void saimaa_machine_init(MachineState *machine)
|
||||
cpu_physical_memory_write(0x08006964 + k, &word, 4);
|
||||
}
|
||||
}
|
||||
/* S16-stublet (b27, 50B @0x08006CC0): smart return for the
|
||||
* B66 bx-ip chain. ip odd + top 8 => add sp,#8 (pop the
|
||||
* helper frame B66 skipped!) + bx ip (legit pushed-lr,
|
||||
* un-leaks the stack); else default (restore r7, jump poll
|
||||
* resumption 0x8007779 via ip). */
|
||||
/* S16-stublet (b27, 64B @0x08006CC0): smart return for the
|
||||
* B66 bx-ip chain. ip==STUBV (fill/maze, never legit) =>
|
||||
* default; ip odd + top 8 => add sp,#8 (pop the helper
|
||||
* frame B66 skipped!) + bx ip (legit pushed-lr, un-leaks);
|
||||
* else default (restore r7, jump poll resumption 0x8007779
|
||||
* via ip). */
|
||||
{
|
||||
static const uint8_t s16[] = {
|
||||
0xdd, 0xf8, 0x04, 0xc0, 0x1c, 0xf0, 0x01, 0x0f,
|
||||
0x0b, 0xd0, 0x5f, 0xea, 0x1c, 0x63, 0x08, 0x2b,
|
||||
0x00, 0xd1, 0x02, 0xb0, 0x60, 0x47, 0x5f, 0xea,
|
||||
0x1c, 0x73, 0x08, 0x2b, 0x00, 0xd1, 0x60, 0x47,
|
||||
0x4a, 0xf2, 0x00, 0x07, 0xc0, 0xf2, 0x73, 0x07,
|
||||
0x47, 0xf2, 0x79, 0x7c, 0xc0, 0xf6, 0x00, 0x0c,
|
||||
0x60, 0x47,
|
||||
0xdd, 0xf8, 0x04, 0xc0, 0x46, 0xf6, 0x8d, 0x33,
|
||||
0xc0, 0xf6, 0x00, 0x03, 0x9c, 0x45, 0x0e, 0xd0,
|
||||
0x1c, 0xf0, 0x01, 0x0f, 0x0b, 0xd0, 0x5f, 0xea,
|
||||
0x1c, 0x63, 0x08, 0x2b, 0x01, 0xd1, 0x02, 0xb0,
|
||||
0x60, 0x47, 0x5f, 0xea, 0x1c, 0x73, 0x08, 0x2b,
|
||||
0x01, 0xd1, 0x02, 0xb0, 0x60, 0x47, 0x4a, 0xf2,
|
||||
0x00, 0x07, 0xc0, 0xf2, 0x73, 0x07, 0x47, 0xf2,
|
||||
0x79, 0x7c, 0xc0, 0xf6, 0x00, 0x0c, 0x60, 0x47,
|
||||
};
|
||||
size_t k;
|
||||
for (k = 0; k < sizeof(s16); k += 4) {
|
||||
|
||||
Reference in New Issue
Block a user