diff --git a/ATALoad.a b/ATALoad.a index c197f4e..a55f82d 100644 --- a/ATALoad.a +++ b/ATALoad.a @@ -30,8 +30,8 @@ OriginalFunc NewFunc - link a6,#-4 - movem.l d5,-4(a6) + link a6,#-8 + movem.l a3/d5,-8(a6) ; 16(a6).L = !AfterSystemStartupTime ; 12(a6).L = $0701, the DDMap ID for a Mac driver @@ -51,6 +51,7 @@ NewFunc dc.w $A51E ; _NewPtrSys tst.l A0 beq.s @fail + move.l a0,a3 move.l a0,a1 lea *+2+'At',a0 ; LINKER SCRIPT @@ -70,7 +71,7 @@ NewFunc bset.l #31,d5 ; kAfterSystemStartupTime @rom - jsr 8(a0) ; ATAMgr v2 entry point + jsr 8(a3) ; ATAMgr v2 entry point ; never mind the spec, only set d5 ; move.l d0,a0 @@ -81,7 +82,7 @@ NewFunc @fail move.l #$FFFFDB93,d0 @return - movem.l -4(a6),d5 + movem.l -8(a6),a3/d5 unlk a6 rts diff --git a/ATALoad.a.o b/ATALoad.a.o new file mode 100644 index 0000000..0cc8624 Binary files /dev/null and b/ATALoad.a.o differ diff --git a/ATALoad.dmp b/ATALoad.dmp index ebe36e0..32b2032 100644 --- a/ATALoad.dmp +++ b/ATALoad.dmp @@ -1,5 +1,5 @@ -First: Flags=0 Version=2 +First: Flags=$00 Version=$0002 Dictionary: Flags $00 FirstId 1 1: #0001 @@ -11,7 +11,7 @@ Pad Module: Flags=$10=(Main Local Code) Module="#0001"(1) Segment="Main"(2) Content: Flags $08 -Contents offset $0000 size $008E +Contents offset $0000 size $0090 00000000: 41EF 0010 'A...' LEA $0010(A7),A0 00000004: 2F20 '/ ' MOVE.L -(A0),-(A7) 00000006: 2F20 '/ ' MOVE.L -(A0),-(A7) @@ -26,35 +26,36 @@ Contents offset $0000 size $008E 00000022: 4E73 'Ns' RTE 00000024: 7274 'rt' MOVEQ #$74,D1 ; 't' 00000026: 6000 4944 '`.ID' BRA *+$4946 ; 0000496C -0000002A: 4E56 FFFC 'NV..' LINK A6,#$FFFC -0000002E: 48EE 0020 FFFC 'H.. ..' MOVEM.L D5,-$0004(A6) +0000002A: 4E56 FFF8 'NV..' LINK.W A6,#-$0008 +0000002E: 48EE 0820 FFF8 'H.. ..' MOVEM.L D5/A3,-$0008(A6) 00000034: 0C6E 0701 000E '.n....' CMPI.W #$0701,$000E(A6) -0000003A: 6642 'fB' BNE.S *+$0044 ; 0000007E +0000003A: 6644 'fD' BNE.S *+$0046 ; 00000080 0000003C: 203C 5369 7A65 ' h', cut2 - i) if code[i:i+4] == b'Size': - code[i:i+4] = struct.pack('>l', cut2 - cut1) + code[i:i+4] = struct.pack('>L', len(code) - cut2) if code[i:i+2] == b'ID': # reference to original InitDevice, skipping the mangled 4-byte LINK code[i:i+2] = struct.pack('>h', (InitDevice+4) - i)