mirror of
https://github.com/BertoldVdb/ms-tools.git
synced 2025-12-10 07:44:46 +01:00
Fix support for completely empty device
This commit is contained in:
parent
7427e3746a
commit
e917920a12
1 changed files with 5 additions and 0 deletions
|
|
@ -56,10 +56,15 @@ func patchTrampolineEncode(orig []byte, origAddr int, R0Value byte, hookAddr int
|
|||
0xD0, 0x7,
|
||||
}
|
||||
|
||||
/* Add snippet of replaced code */
|
||||
result = append(result, orig...)
|
||||
|
||||
if origAddr != 0 {
|
||||
/* Jump to rest of original code */
|
||||
result = append(result, []byte{0x02, byte(origAddr >> 8), byte(origAddr)}...)
|
||||
} else {
|
||||
/* Just return if no origAddr */
|
||||
result = append(result, 0x22)
|
||||
}
|
||||
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue