2020-05-20 21:41:02 +02:00
|
|
|
include '..\..\..\macros.inc'
|
2007-02-04 02:47:46 +01:00
|
|
|
use32
|
|
|
|
db 'MENUET01'
|
|
|
|
dd 1
|
|
|
|
dd start
|
|
|
|
dd i_end
|
|
|
|
dd mem, mem
|
|
|
|
dd 0, 0
|
|
|
|
|
|
|
|
start:
|
|
|
|
push 70
|
|
|
|
pop eax
|
|
|
|
mov ebx, fileinfo
|
2007-05-10 15:48:35 +02:00
|
|
|
mcall
|
2007-02-04 02:47:46 +01:00
|
|
|
cmp ebx, max_file_size
|
|
|
|
jz exit
|
|
|
|
cmp ebx, -1
|
|
|
|
jnz @f
|
|
|
|
exit:
|
|
|
|
or eax, -1
|
2007-05-10 15:48:35 +02:00
|
|
|
mcall
|
2007-02-04 02:47:46 +01:00
|
|
|
@@:
|
|
|
|
mov esi, filebuf
|
|
|
|
xor ecx, ecx
|
|
|
|
scan1l1:
|
|
|
|
or edi, -1
|
|
|
|
scan1:
|
|
|
|
inc edi
|
|
|
|
lodsb
|
|
|
|
test al, al
|
|
|
|
jz scan1done
|
|
|
|
cmp al, 13
|
|
|
|
jz newline
|
|
|
|
cmp al, 10
|
|
|
|
jnz scan1
|
|
|
|
newline:
|
|
|
|
test edi, edi
|
|
|
|
jz scan1l1
|
|
|
|
inc ecx
|
|
|
|
jmp scan1l1
|
|
|
|
scan1done:
|
|
|
|
test edi, edi
|
|
|
|
jz @f
|
|
|
|
inc ecx
|
|
|
|
@@:
|
|
|
|
jecxz exit
|
|
|
|
push 3
|
|
|
|
pop eax
|
2007-05-10 15:48:35 +02:00
|
|
|
mcall
|
2007-02-04 02:47:46 +01:00
|
|
|
ror eax, 16
|
|
|
|
mov edx, 1024
|
|
|
|
@@:
|
|
|
|
sub eax, 0x43ab45b5
|
|
|
|
ror eax, 1
|
|
|
|
xor eax, 0x32c4324f
|
|
|
|
ror eax, 1
|
|
|
|
dec edx
|
|
|
|
jnz @b
|
|
|
|
div ecx
|
|
|
|
; use edx as random index
|
|
|
|
mov esi, filebuf
|
|
|
|
scan2l1:
|
|
|
|
push esi
|
|
|
|
or edi, -1
|
|
|
|
scan2:
|
|
|
|
inc edi
|
|
|
|
lodsb
|
|
|
|
test al, al
|
|
|
|
jz newline2
|
|
|
|
cmp al, 13
|
|
|
|
jz newline2
|
|
|
|
cmp al, 10
|
|
|
|
jnz scan2
|
|
|
|
newline2:
|
|
|
|
pop eax
|
|
|
|
test edi, edi
|
|
|
|
jz scan2l1
|
|
|
|
dec edx
|
|
|
|
jns scan2l1
|
|
|
|
mov byte [esi-1], 0
|
|
|
|
; set eax (-> ASCIIZ string) as skin
|
2007-05-25 11:40:17 +02:00
|
|
|
mov ecx, eax
|
2007-02-04 02:47:46 +01:00
|
|
|
push 48
|
|
|
|
pop eax
|
|
|
|
mov bl, 8
|
2007-05-10 15:48:35 +02:00
|
|
|
mcall
|
2007-02-04 02:47:46 +01:00
|
|
|
jmp exit
|
|
|
|
|
|
|
|
fileinfo:
|
|
|
|
dd 0
|
|
|
|
dq 0
|
|
|
|
dd max_file_size
|
|
|
|
dd filebuf
|
2007-05-30 16:45:45 +02:00
|
|
|
db '/sys/skinsel.dat',0
|
2007-02-04 02:47:46 +01:00
|
|
|
i_end:
|
|
|
|
max_file_size = 0x1000 - 0x40 - $
|
|
|
|
filebuf:
|
|
|
|
rb max_file_size
|
|
|
|
; stack
|
|
|
|
rb 0x40
|
|
|
|
mem:
|