support Polarware anti-tamper check

This commit is contained in:
4am 2018-01-28 13:11:15 -05:00
parent 31666546f6
commit 13b6061bc1
5 changed files with 41 additions and 14 deletions

View File

@ -53,6 +53,11 @@ FIRSTFILTER
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in patchers/f7f6
;gPolarwareTamperCheck
!byte FALSE ; 0=true, 1=false
; reset before each operation
; set in patchers/polarware
; used to avoid an expensive search
;gIsTrillium
!byte FALSE ; 0=true, 1=false
; reset before each operation

View File

@ -85,7 +85,8 @@ gIsSierra = gIsDatasoft-$01 ; byte
gIsSierra13 = gIsSierra-$01 ; byte
gIsF7F6 = gIsSierra13-$01 ; byte
gIsTrillium = gIsF7F6-$01 ; byte
gForceDiskVol = gIsTrillium-$01 ; byte
gPolarwareTamperCheck = gIsTrillium-$01 ; byte
gForceDiskVol = gPolarwareTamperCheck-$01 ; byte
;LASTFILTER ; add new gIs* above this line
gOnAClearDayYouCanReadForever = gForceDiskVol-$01 ; byte
@ -152,6 +153,7 @@ ConstructStandardDelivery = jConstructStandardDelivery
!warn "gIsSierra13=",gIsSierra13
!warn "gIsF7F6=",gIsF7F6
!warn "gIsTrillium=",gIsTrillium
!warn "gPolarwareTamperCheck=",gPolarwareTamperCheck
!warn "gForceDiskVol=",gIsForceDiskVol
!warn "gOnAClearDayYouCanReadForever=",gOnAClearDayYouCanReadForever
!warn "gUsingRAMDisk=",gUsingRAMDisk

View File

@ -25,10 +25,10 @@
lda gIsProDOS ; only seen this protection on ProDOS disks
bne .exit
ldy #$06
jsr SearchTrack
!byte $39,$FD
!byte $2F,$FB
!byte $39,$FC
jsr SearchTrack ; (all bytes are XOR #$FF)
!byte $39,$FD ; DEC $02
!byte $2F,$FB ; BNE +4
!byte $39,$FC ; DEC $03
bcs .exit
inx
inx
@ -40,6 +40,6 @@
pla
ldy #$01
jsr modify
!byte $A2
!byte $A2 ; change encrypted BNE +4 to +5D so code exits with Death Counter > 0
.exit
}

View File

@ -1,6 +1,6 @@
;-------------------------------
; #POLARWARE
; a delayed secondary protection check
; a delayed secondary protection check and anti-tamper check
; seen on Polarware games
; similar to #FBFFENCRYPTED but the encryption key is different
; and the routine ultimately returns regardless of success or failure
@ -18,11 +18,11 @@
lda gIsProDOS ; only seen this protection on ProDOS disks
bne .exit
ldy #$06
jsr SearchTrack
!byte $29,$6D
!byte $3F,$EB
!byte $29,$60
bcs .exit
jsr SearchTrack ; (all bytes are XOR #$EF)
!byte $29,$6D ; DEC $82
!byte $3F,$EB ; BNE +4
!byte $29,$60 ; DEC $8F
bcs .tamper
inx
inx
inx
@ -33,6 +33,26 @@
pla
ldy #$01
jsr modify
!byte $B2
!byte $B2 ; change encrypted BNE +4 to +5D so code exits with Death Counter > 0
lda #TRUE
sta gPolarwareTamperCheck
.tamper lda gPolarwareTamperCheck
bne .exit
ldy #$0C
jsr SearchTrack
!byte $01,$02,$03,$03,$03,$03;prologue marker (not code)
!byte $EC,WILDCARD,WILDCARD ; CPX absolute
!byte $F0,$09 ; BEQ +9
!byte $AE ; LDX
bcs .exit
pha
txa
adc #$09
tax
stx gDisplayBytes
pla
ldy #$01
jsr modify
!byte $50 ; change BEQ to BVC which acts as a branch-always
.exit
}

View File

@ -138,7 +138,7 @@ StringTable
; can be set directly before calling PrintByID.
;
.header
!text "Passport by 4am 2018-01-26",$00
!text "Passport by 4am 2018-01-28",$00
.mainmenu
!text "________________________________________",$8D,$8D,$8D,$8D,$8D,$8D,$8D
!text " "