View Single Post
Old 23 September 2014, 17:06   #19
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 50
Posts: 1,090
Quote:
Originally Posted by Jope View Post
Out of curiosity, what kind of encryption was it? I'm guessing just data or address lines swapped around a bit, since the CPU has to execute off the ROMs.
For me Casablanca ROM has only easy software protection.
No hardware protection, only ROM data is stored in PC endian style, easy
enough to understand for everyone who see some protected 68k ROM's data.
Perhaps similar protection (?) has DraCo machine.

Here is full decoding routine:

Code:
 incdir "dh2:include/"
 include 'exec/exec_lib.i'
 include 'dos/dos_lib.i'

 movem.l D0-A6,-(SP)

 lea Buffy,A0
 lea File2,A1
 lea File1,A2

 moveq #4,D0
 swap D0   ; counter
Convert
 move.w (A1)+,D1
 ror.w #8,D1
 move.w D1,(A0)+

 move.w (A2)+,D1
 ror.w #8,D1
 move.w D1,(A0)+

 subq.l #1,D0
 bne.b Convert

 bsr.w DecodeDraCo
 bsr.w DecodeAmiga

 move.l 4.W,A6
 moveq #0,D0   ; version
 lea DosName(PC),A1
 jsr _LVOOpenLibrary(A6)
 tst.l D0
 beq.b Exit
 move.l D0,A6
 lea Path(PC),A0
 move.l A0,D1
 move.l #1006,D2  ; new file
 jsr _LVOOpen(A6)
 move.l D0,D1   ; file handle
 move.l D0,-(SP)
 lea Buffy(PC),A0
 move.l A0,D2
 move.l #BuffyEnd-Buffy,D3 ; save size
 jsr _LVOWrite(A6)
 move.l (SP)+,D1
 jsr _LVOClose(A6)
Exit
 movem.l (SP)+,D0-A6
 moveq #0,D0
 rts

DecodeDraCo
 lea Buffy,A0  ; source
 move.l A0,A1   ; destination
 move.l $10(A0),D0
 addq.l #3,D0
 lsr.l #2,D0
 move.l D0,D2
 move.w #$FF,D0
CopyDraCo
 move.l (A0)+,(A1)+
 dbf D0,CopyDraCo
 move.l D2,D0
 sub.l #$100,D0
 move.l #$6BE92EAA,D3
LoopDraCo
 move.l (A0)+,D1
 mulu.w #$6255,D3
 add.l #$3619,D3
 eor.l D3,D1
 move.l D1,(A1)+
 subq.l #1,D0
 bne.b LoopDraCo
 rts

DecodeAmiga
 lea Buffy+$80000,A0  ; source
 move.l A0,A1   ; destination
 move.l #$20000,D0
 move.l #$D312B64A,D2
LoopAmiga
 move.l (A0)+,D1
 mulu.w #$6255,D2
 add.l #$3619,D2
 eor.l D2,D1
 move.l D1,(A1)+
 subq.l #1,D0
 bne.b LoopAmiga
 rts

Path
 dc.b 'RAM:Casablanca.ROM',0
DosName
 dc.b 'dos.library',0
 cnop 0,4   ; for fastest data access

; Buffy and Spike daughter

Buffy
 ds.b $80000*2
BuffyEnd
File1
 incbin ram:casablancaromu4
File2
 incbin ram:casablancaromu5
Don_Adan is offline  
 
Page generated in 0.04148 seconds with 11 queries