CODE:00000000 ;
CODE:00000000 ; +-------------------------------------------------------------------------+
CODE:00000000 ; | This file has been generated by The Interactive Disassembler (IDA) |
CODE:00000000 ; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
CODE:00000000 ; +-------------------------------------------------------------------------+
CODE:00000000 ;
CODE:00000000 ; Input MD5 : C8FC68DB2E09E001419486BADFBCCFB5
CODE:00000000
CODE:00000000 ; File Name : SKR_COLD
CODE:00000000 ; Format : Amiga hunk file
CODE:00000000
CODE:00000000
CODE:00000000 ; Processor: 68000
CODE:00000000 ; Target Assembler: 680x0 Assembler in MRI compatible mode
CODE:00000000 ; This file should be compiled with "as -M"
CODE:00000000
CODE:00000000 ; ===========================================================================
CODE:00000000
CODE:00000000 ; Segment type: Pure code
CODE:00000000 ; segment "CODE"
CODE:00000000
CODE:00000000 ; =============== S U B R O U T I N E =======================================
CODE:00000000
CODE:00000000 ; WARNING xxxxx and yyyyy are read in reverse!!!
CODE:00000000 ;
CODE:00000000 ; "ByteKiller 1.3" Algorithm:
CODE:00000000 ; o mult = xxxx xxxx 10
CODE:00000000 ; => repeat sequence of 2 bytes at offset %xxxxxxxx (8 bit)
CODE:00000000 ; o mult = xxx 00
CODE:00000000 ; => read and copy the next %xxx + 1 bytes
CODE:00000000 ; o mult = xxxx xxxx x001
CODE:00000000 ; => repeat sequence of 3 bytes at offset %xxxxxxxxx (9 bit)
CODE:00000000 ; o mult = x xxxx xxxx x101
CODE:00000000 ; => repeat sequence of 4 bytes at offset %xxxxxxxxxx (10 bit)
CODE:00000000 ; o mult =yyy yyyy yyyy yxxx xxxx x011
CODE:00000000 ; => repeat sequence of %xxxxxxxx (8 bit) +1 bytes at offset %yyyyyyyyyyyy (12 bit)
CODE:00000000 ; o mult = xxx xxxx x111
CODE:00000000 ; => read and copy (%xxxxxxxx+9) bytes (8 bit)
CODE:00000000 ;
CODE:00000000
CODE:00000000 start:
CODE:00000000 dest_address_start = a1
CODE:00000000 nb_bits_to_process = d1
CODE:00000000 dest = a2
CODE:00000000 source = a0
CODE:00000000 cur_data = d0
CODE:00000000 nb_bytes = d3
CODE:00000000 lea data,source
CODE:00000004 lea ($50000).l,dest_address_start
CODE:0000000A move.l (source)+,cur_data ; 0x00006f64 (address = 4)
CODE:0000000A ; = size of data minus header
CODE:0000000C move.l (source)+,nb_bits_to_process ; 0x0000DB10 (address = 8)
CODE:0000000C ; size of uncompressed data
CODE:0000000E move.l (source)+,d5 ; 0x06627d1e (address = c)
CODE:00000010 movea.l dest_address_start,dest
CODE:00000012 adda.l cur_data,source ; 0x00006F70 (last address of data?)
CODE:00000014 adda.l nb_bits_to_process,dest ; size of uncompressed data?
CODE:00000016 ; start to read last long
CODE:00000016 move.l -(source),cur_data ; (6F6C) = 0x00014c50
CODE:00000018 eor.l cur_data,d5 ; 0x0663314e
CODE:00000018 ; checksum, removed by Skid Row?
CODE:0000001A
CODE:0000001A big_loop: ; CODE XREF: start+A6j
CODE:0000001A lsr.l #1,cur_data ; nb lsr always adds 0 for MSb
CODE:0000001A ; LSb goes to C and X
CODE:0000001C bne.s skip_read0 ; if this is 0 after a 1 was introduced
CODE:0000001C ; then we can afford to lose last LSb
CODE:0000001E bsr.w read_next ; no more bits to process
CODE:00000022
CODE:00000022 skip_read0: ; CODE XREF: start+1Cj
CODE:00000022 bcs.s _3_bit_mult ; mult = xx1
CODE:00000024 ; _2_bit_mult = x0
CODE:00000024 moveq #8,nb_bits_to_process ; 8 bit offset to pick data to copy from
CODE:00000026 moveq #1,nb_bytes
CODE:00000028 lsr.l #1,cur_data ; second bit out
CODE:0000002A bne.s skip_read1 ; mult = xxxxxxxx10 => read next 8 bits and
CODE:0000002A ; repeat last [0-255] bytes sequence
CODE:0000002C bsr.w read_next ; no more bits to process
CODE:00000030 ; _2_bit_mult = 10 =>
CODE:00000030 ; nb_bits_to_process = 8
CODE:00000030 ; nb_bytes = 1
CODE:00000030
CODE:00000030 skip_read1: ; CODE XREF: start+2Aj
CODE:00000030 bcs.s repeat_n_bytes ; mult = xxxxxxxx10 => read next 8 bits and
CODE:00000030 ; repeat last [0-255] bytes sequence
CODE:00000032 ; _5_bit_mult = xxx00
CODE:00000032 moveq #3,nb_bits_to_process
CODE:00000034 clr.w d4 ; mult = xxx00 => read xxx and copy xxx bytes
CODE:00000036
CODE:00000036
CODE:00000036
CODE:00000036 ; >>>> WRITE N BYTES <<<<
CODE:00000036
CODE:00000036 write_n_bytes: ; CODE XREF: start:in_multxxxxxxxx111j
CODE:00000036 bsr.w clr_d2_n_fill ; => read 3 or 8 more bits
CODE:0000003A move.w d2,nb_bytes
CODE:0000003C add.w d4,nb_bytes ; add 8 if we're reading a 8 bit value
CODE:0000003C ; as nb_bytes [0-7] would have been
CODE:0000003C ; taken care of by a 3 bit value
CODE:0000003E
CODE:0000003E
CODE:0000003E ; >>> ALWAYS READ A BYTE TO COPY TO DEST <<<
CODE:0000003E
CODE:0000003E copy_n_bytes: ; CODE XREF: start+50j
CODE:0000003E moveq #7,nb_bits_to_process
CODE:00000040
CODE:00000040 read_dest_bits_loop: ; CODE XREF: start:write_loopj
CODE:00000040 lsr.l #1,cur_data
CODE:00000042
CODE:00000042 check_skip:
CODE:00000042 bne.s skip_read2
CODE:00000044 bsr.w read_next ; drop the introduced marker if 0
CODE:00000048
CODE:00000048 skip_read2: ; CODE XREF: start:check_skipj
CODE:00000048 roxl.l #1,d2
CODE:0000004A
CODE:0000004A write_loop:
CODE:0000004A dbf nb_bits_to_process,read_dest_bits_loop
CODE:0000004E move.b d2,-(dest) ; <<<< WRITE DEST >>>>
CODE:00000050 dbf nb_bytes,copy_n_bytes
CODE:00000054 bra.w next
CODE:00000058 ; ---------------------------------------------------------------------------
CODE:00000058
CODE:00000058 mult_111: ; CODE XREF: start+70j
CODE:00000058 moveq #8,nb_bits_to_process
CODE:0000005A moveq #8,d4
CODE:0000005C
CODE:0000005C in_multxxxxxxxx111: ; => read 3 or 8 more bits
CODE:0000005C bra.w write_n_bytes
CODE:00000060 ; ---------------------------------------------------------------------------
CODE:00000060
CODE:00000060 _3_bit_mult: ; CODE XREF: start:skip_read0j
CODE:00000060 moveq #2,nb_bits_to_process
CODE:00000062 bsr.w clr_d2_n_fill ; read NEXT 2 bits
CODE:00000066 cmpi.b #2,d2 ; /!\ d2 will come out reversed from multiplier
CODE:0000006A blt.s mult_001_or_101
CODE:0000006C cmpi.b #3,d2
CODE:00000070 beq.s mult_111
CODE:00000072
CODE:00000072 mult_011: ; case 2
CODE:00000072 moveq #8,nb_bits_to_process
CODE:00000074 bsr.w clr_d2_n_fill
CODE:00000078 move.w d2,nb_bytes
CODE:0000007A move.w #$C,nb_bits_to_process ; 12 bit offset to pick data to copy from
CODE:0000007E bra.w repeat_n_bytes
CODE:00000082 ; ---------------------------------------------------------------------------
CODE:00000082
CODE:00000082 mult_001_or_101: ; CODE XREF: start+6Aj
CODE:00000082 move.w #9,nb_bits_to_process
CODE:00000082 d2=00 or d2=01
CODE:00000086 add.w d2,nb_bits_to_process ; d2=00 or d2=01
CODE:00000086 ; 9 or 10 bit offset to pick data from
CODE:00000088 addq.w #2,d2
CODE:0000008A move.w d2,nb_bytes ; 2 or 3 bytes to repeat
CODE:0000008C
CODE:0000008C repeat_n_bytes: ; CODE XREF: start:skip_read1j
CODE:0000008C ; start+7Ej
CODE:0000008C bsr.w clr_d2_n_fill
CODE:00000090
CODE:00000090 repeat_copy: ; CODE XREF: start+96j
CODE:00000090 subq.w #1,dest
CODE:00000092 move.b (dest,d2.w),(dest) ; repeat SEQUENCE of nb_bytes
CODE:00000096 dbf nb_bytes,repeat_copy
CODE:0000009A
CODE:0000009A next: ; CODE XREF: start+54j
CODE:0000009A nop
CODE:0000009C nop ; Skid Row was here ;)
CODE:0000009E nop ; must have been the checksum data!
CODE:000000A0 nop
CODE:000000A2 nop
CODE:000000A4 cmpa.l dest,dest_address_start
CODE:000000A6 blt.w big_loop ; nb lsr always adds 0 for MSb
CODE:000000A6 ; LSb goes to C and X
CODE:000000AA jmp $50000
CODE:000000AA ; End of function start
CODE:000000AA
CODE:000000B0 ; ---------------------------------------------------------------------------
CODE:000000B0 move.w #$FFFF,d0
CODE:000000B4
CODE:000000B4 checksum_error: ; CODE XREF: CODE:000000BAj
CODE:000000B4 move.w d0,($DFF180).l
CODE:000000BA dbf d0,checksum_error
CODE:000000BE moveq #$FFFFFFFF,d0
CODE:000000C0 rts
CODE:000000C2 ; C&X are LSb from read long (rotated)
CODE:000000C2 ; MSb is set to 1
CODE:000000C2
CODE:000000C2 ; =============== S U B R O U T I N E =======================================
CODE:000000C2
CODE:000000C2
CODE:000000C2 read_next: ; CODE XREF: start+1Ep
CODE:000000C2 ; start+2Cp ...
CODE:000000C2 cur_data = d0
CODE:000000C2 source = a0
CODE:000000C2 move.l -(source),cur_data
CODE:000000C4 eor.l cur_data,d5
CODE:000000C6 move #$10,ccr ; set X bit in Condition Code Register
CODE:000000CA roxr.l #1,cur_data ; introduce a marker at MSb
CODE:000000CA ; this ensures that we read 0s too!
CODE:000000CC rts
CODE:000000CC ; End of function read_next
CODE:000000CC
CODE:000000CE
CODE:000000CE ; =============== S U B R O U T I N E =======================================
CODE:000000CE
CODE:000000CE
CODE:000000CE clr_d2_n_fill: ; CODE XREF: start:write_n_bytesp
CODE:000000CE ; start+62p ...
CODE:000000CE nb_bits_to_process = d1
CODE:000000CE cur_data = d0
CODE:000000CE source = a0
CODE:000000CE subq.w #1,nb_bits_to_process
CODE:000000D0 clr.w d2
CODE:000000D2
CODE:000000D2 loop: ; CODE XREF: clr_d2_n_fill+14j
CODE:000000D2 lsr.l #1,cur_data ; LSb[d0] -> X (and lose any existing X or C)
CODE:000000D4 bne.s enough_data ; if this is 0 after a 1 was introduced,
CODE:000000D4 ; then we can afford to lose that 1
CODE:000000D6 move.l -(source),cur_data
CODE:000000D8 eor.l cur_data,d5
CODE:000000DA move #$10,ccr ; rotate data with MSb=1
CODE:000000DA ; => introduce a marker
CODE:000000DE roxr.l #1,cur_data
CODE:000000E0
CODE:000000E0 enough_data: ; CODE XREF: clr_d2_n_fill+6j
CODE:000000E0 roxl.l #1,d2 ; X -> LSb[d1]
CODE:000000E2 dbf nb_bits_to_process,loop ; LSb[d0] -> X (and lose any existing X or C)
CODE:000000E6 rts
CODE:000000E6 ; End of function clr_d2_n_fill
CODE:000000E6
CODE:000000E6 ; ---------------------------------------------------------------------------
CODE:000000E8 data: dc.l $6F64 ; DATA XREF: starto
CODE:000000EC dc.l $DB10
CODE:000000F0 dc.l $6627D1E
CODE:000000F4 dc.l $217F8D8
CODE:000000F8 dc.l $250AA5CC
CODE:000000FC dc.l $7A8C2CA
CODE:00000100 dc.l $D97D828
CODE:00000104 dc.l $E0C3CFEF
CODE:00000108 dc.l $FC100AC8
CODE:0000010C dc.l $805A6F0
CODE:00000110 dc.l $800E48D
CODE:00000114 dc.l $5EF0340
CODE:00000118 dc.l $80286209
CODE:0000011C dc.l $E1A0AE40
CODE:00000120 dc.l $5004B900
CODE:00000124 dc.l $1D106770
CODE:00000128 dc.l $4F9E412F
CODE:0000012C dc.l $FFBEE171
CODE:00000130 dc.l $10400041
CODE:00000134 dc.l $F306136
CODE:00000138 dc.l $4EA20DC5
CODE:0000013C dc.l $9FF9FB1
CODE:00000140 dc.l $70B960
CODE:00000144 dc.l $2060085
CODE:00000148 dc.l $3A86E120
CODE:0000014C dc.l $729F4245
CODE:00000150 dc.l $B033035B
CODE:00000154 dc.l $39E7097E
(...) (...)
CODE:00007020 dc.l $18100C2C
CODE:00007024 dc.l $3D24F0F1
CODE:00007028 dc.l $B1D19049
CODE:0000702C dc.l $840C181
CODE:00007030 dc.l $4041428A
CODE:00007034 dc.l $1605E1E1
CODE:00007038 dc.l $10820A20
CODE:0000703C dc.l $8128184
CODE:00007040 dc.l $200081C4
CODE:00007044 dc.l $64645454
CODE:00007048 dc.l $445082C0
CODE:0000704C dc.l $4F840022
CODE:00007050 dc.l $3000404C
CODE:00007054 dc.l $14C50
CODE:00007054 ; end of 'CODE'
CODE:00007054
BSS:00007060 ; ===========================================================================
BSS:00007060
BSS:00007060 ; Segment type: Uninitialized
BSS:00007060 ; segment "BSS"
BSS:00007060 ds.b 4
BSS:00007060 ; end of 'BSS'
BSS:00007060
BSS:00007060
BSS:00007060 END start