Commit c2546b43 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix to unsqueeze recent apps requiring patching

Squeeze 5.11 and later inserts a dummy signature to convince ROL's UnSqueezeAIF to let it pass, however the Unsqueeze command inside !Patch didn't get updated to expect that and merrily branched into the dummy one, ending up with an abort at whatever was in R4.

Having found a signature match, check at +20 to see if this was a dummy (in line with the logic of UnSqzAIF-0_09). This version can afford to be more simplistic since it never wants to run the resulting application, it doesn't really matter if the StrongARM cache flush code is right or not, so there's only 2 to choose from.
Update the Squeeze binary to squeeze-5_13.
Tested with a few binaries from 5.08 and some from 5.13.
Fixes ticket #403.

Version 1.38. Tagged as 'Patch-1_38'
parent 34058611
No preview for this file type
/* (1.37)
/* (1.38)
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
#define Module_MajorVersion_CMHG 1.37
#define Module_MajorVersion_CMHG 1.38
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 22 Nov 2014
#define Module_Date_CMHG 29 Mar 2015
#define Module_MajorVersion "1.37"
#define Module_Version 137
#define Module_MajorVersion "1.38"
#define Module_Version 138
#define Module_MinorVersion ""
#define Module_Date "22 Nov 2014"
#define Module_Date "29 Mar 2015"
#define Module_ApplicationDate "22-Nov-14"
#define Module_ApplicationDate "29-Mar-15"
#define Module_ComponentName "Patch"
#define Module_ComponentPath "castle/RiscOS/Sources/Utilities/Patches/Patch"
#define Module_FullVersion "1.37"
#define Module_HelpVersion "1.37 (22 Nov 2014)"
#define Module_LibraryVersionInfo "1:37"
#define Module_FullVersion "1.38"
#define Module_HelpVersion "1.38 (29 Mar 2015)"
#define Module_LibraryVersionInfo "1:38"
......@@ -16,7 +16,7 @@
; Unsqueezes a file that has had squeeze applied to it. Works on both
; AIF and non AIF images. Can only unsqueeze if recognises unsqueezer
; code (this new vrsion has to be much more careful, and use
; code (this new version has to be much more careful, and use
; OS_SynchroniseCodeAreas)
; --------------------------------------------------------------------------
......@@ -62,7 +62,7 @@ UnSqueeze_Title
DCB "UnSqueeze", 0
DCB "UnSqueeze", 9, "1.27 (13 May 2013)", 0
DCB "UnSqueeze", 9, "1.28 (29 Mar 2015)", 0
GET TokHelpSrc.s
......@@ -451,20 +451,37 @@ patch_unsqueeze ROUT
SUBS r6,r6,#4
;matched whole sig, but it could be a dummy one (squeeze 5.11+)
ADD lr,r0,#20
CMP lr,r1
BHS %BT02 ;nah, too near the end
ADR r3,UnsqSignature
MOV r6,#UnsqSigSize
LDR r2,[lr],#4
LDR r7,[r3],#4
TEQ r2,r7
BNE %FT06 ;not a dummy, use it
SUBS r6,r6,#4
MOV r0,lr ;it was a dummy, this next one is the real one
; Fall through
;matched whole sig, patch next word
LDR r7,mov_pc_8000
STR r7,[r0,#0]
;now find the MOV PC,R8 and patch it
LDR r5,mov_pc_r8
ADD r1,r1,#UnsqSigSize-4
LDR r2,[r0],#4
CMP r2,r5
CMP r0,r1
B %BT02
LDR r7,mov_pc_8000
STR r7,[r0,#-4]
......@@ -482,7 +499,7 @@ UnsqSigSize * 4*4
; --------------------------------------------------------------------------
after_decomp ROUT
MOV r1, r11
MOV r11, #&8000 ; Workspace
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment