Function at 0x405d40
Capabilities:
Print debug messages
Read file on windows

Disassembly:
sub esp, 0x2c
push ebx
push esi
mov esi, dword [esp + 0x38]
push edi
push ebp
xor ebp, ebp
mov dword [esp + 0x18], ebp
cmp esi, ebp
jne 0x405d61
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x2c
ret 0xc
mov eax, dword [0x417a10]
test eax, eax
jne 0x405d86
push 0
push str.Debug
push 0x417a80
call dword [sym.imp.KERNEL32.dll_GetProfileIntA]
or eax, 0x1000
mov dword [0x417a10], eax
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x44]
test ah, 0x10
je 0x405dfa
mov ebx, esi
test eax, 0x2000000
je 0x405da4
mov ebx, dword [esi]
cmp ebx, 0xffffffff
je 0x405e48
mov al, byte [0x417a10]
cmp al, 1
jne 0x405de7
lea eax, [esp + 0x2c]
push 0xa
push eax
push ebx
call fcn.0040b860
add esp, 0xc
push str.SmackOpen___file_handle:
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x417aa4
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 1
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esp + 0x10], eax
jmp 0x405e43
mov al, byte [0x417a10]
cmp al, 1
jne 0x405e20
push str.SmackOpen___file:
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push esi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x417abc
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0
push 0x8000080
push 3
push 0
push 1
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [esp + 0x10], 0
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x405e65
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062f2
push str.Couldnt_open_the_Smacker_file_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4062f2
mov eax, dword [esp + 0x44]
test eax, 0x2000000
jne 0x405e9d
push 0x4c8
call fcn.00401000
mov esi, eax
test esi, esi
jne 0x405e9d
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062e2
push str.Couldnt_allocate_Smack_structure_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4062e2
mov edi, esi
xor eax, eax
mov ecx, 0x132
rep stosd dword es:[edi], eax
mov dword [esi + 0x480], 0x4c8
mov dword [esi + 0x3b0], ebx
mov eax, dword [esp + 0x10]
mov dword [esi + 0x3cc], eax
mov ecx, dword [esp + 0x44]
test ch, 8
je 0x405ed6
mov eax, dword [0x4179f8]
mov dword [esi + 0x4c4], eax
mov dword [esp + 0x10], 0
push 0x68
mov dword [esi], 0
push esi
push esi
call fcn.00406780
add esp, 0xc
mov eax, dword [esi]
cmp eax, 0x324b4d53
je 0x405f16
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062cb
push str.Wasnt_a_Smacker_file_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4062cb
mov eax, dword [esp + 0x44]
test al, 0x80
je 0x405f26
mov eax, dword [0x4179fc]
mov dword [esi + 0x10], eax
mov ecx, dword [esi + 0x10]
test ecx, ecx
jl 0x405f3e
shl ecx, 2
lea eax, [ecx + ecx*4]
lea edx, [eax + eax*4]
mov dword [esi + 0x424], edx
jmp 0x405f46
neg ecx
mov dword [esi + 0x424], ecx
mov ecx, dword [esi + 0x424]
test ecx, ecx
je 0x405f5f
mov eax, 0x186a0
sub edx, edx
div ecx
mov dword [esp + 0x14], eax
jmp 0x405f67
mov dword [esp + 0x14], 0x186a0
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x405f74
inc eax
mov dword [esp + 0x14], eax
mov eax, dword [esi + 0x14]
mov ecx, dword [esi + 0xc]
and eax, 1
add eax, ecx
mov dword [esp + 0x10], eax
lea eax, [eax + eax*4]
add eax, 4
push eax
push esi
call fcn.00406620
add esp, 8
mov dword [esi + 0x3e0], eax
test eax, eax
jne 0x405fba
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062cb
push str.Couldnt_allocate_track_table_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4062cb
add eax, dword [esp + 0x10]
mov dword [esi + 0x3dc], eax
mov ecx, dword [esp + 0x10]
shl ecx, 2
push ecx
push eax
push esi
call fcn.00406780
mov ecx, dword [esp + 0x1c]
add esp, 0xc
mov edx, dword [esi + 0x3e0]
nop
push ecx
push edx
push esi
call fcn.00406780
mov ecx, dword [esp + 0x1c]
add esp, 0xc
mov eax, dword [esi + 0x3cc]
lea edx, [ecx + ecx*4]
add eax, edx
mov dword [esi + 0x3cc], eax
call fcn.0040e490
mov ecx, dword [esi + 0x38]
mov edx, dword [esi + 0x3c]
add ecx, edx
mov edi, dword [esi + 0x40]
add ecx, edi
mov edx, dword [esi + 0x44]
add ecx, edx
add ecx, eax
push ecx
push esi
call fcn.00406620
add esp, 8
mov dword [esi + 0x3b8], eax
test eax, eax
je 0x4062bf
mov ebx, dword [esi + 0x34]
add ebx, 0x1003
and ebx, 0xfffffffc
cmp ebx, 0x2000
mov eax, ebx
ja 0x40604d
mov eax, 0x2000
push eax
push esi
call fcn.00406620
add esp, 8
mov edi, eax
test edi, edi
jne 0x40607a
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062b3
push str.Couldnt_allocate_input_buffer_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4062b3
mov eax, dword [esi + 0x34]
lea ecx, [edi + 0x1000]
push eax
push ecx
push esi
call fcn.00406780
add esp, 0xc
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x40]
mov eax, dword [esi + 0x3c]
push ecx
push edx
push eax
mov ecx, dword [esi + 0x38]
push ecx
mov edx, dword [esi + 0x3b8]
push edx
push edi
call fcn.0040e4a0
add esp, 0x18
push edi
call fcn.00401040
mov eax, dword [esi + 0x34]
mov ecx, dword [esi + 0x480]
add eax, 0x1000
sub ecx, eax
mov dword [esi + 0x480], ecx
mov eax, dword [esi + 0x34]
mov edx, dword [esi + 0x3cc]
add eax, 0x68
add edx, eax
mov dword [esi + 0x3cc], edx
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 0xc]
and eax, 1
add eax, ebx
xor ebx, ebx
dec eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
mov edx, dword [esi + 0x3dc]
mov edi, dword [esp + 0x10]
mov ecx, edx
cmp edi, eax
jae 0x406136
lea eax, [edi + 1]
mov dword [esp + 0x20], ebx
mov ebx, eax
mov edx, dword [ecx]
mov edi, dword [esp + 0x1c]
add edi, edx
mov dword [esp + 0x1c], edi
mov edi, dword [esp + 0x18]
cmp edx, edi
jbe 0x406129
mov dword [esp + 0x18], edx
add ebp, edx
add ecx, 4
dec eax
jne 0x406111
jmp 0x4061c3
xor edi, edi
mov eax, dword [esp + 0x14]
cmp eax, edi
je 0x40614a
mov ebx, dword [ecx]
add ecx, 4
add edi, ebx
dec eax
jne 0x406140
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
sub eax, ecx
xor ebx, ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], esi
mov eax, dword [esp + 0x1c]
cmp edi, eax
jbe 0x406172
test ebx, ebx
je 0x406172
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], ebx
mov ecx, dword [edx]
mov eax, dword [esp + 0x14]
sub edi, ecx
nop
mov esi, dword [edx + eax*4]
mov eax, dword [esp + 0x18]
add edi, esi
cmp ecx, eax
jbe 0x40618c
mov dword [esp + 0x18], ecx
add ebp, ecx
add edx, 4
inc ebx
mov esi, dword [esp + 0x2c]
cmp ebx, esi
jbe 0x40615e
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x10]
cmp ebx, eax
ja 0x4061c3
mov ecx, eax
sub ecx, ebx
inc ecx
add ebx, ecx
mov eax, dword [edx]
mov edi, dword [esp + 0x18]
cmp eax, edi
jbe 0x4061bb
mov dword [esp + 0x18], eax
add ebp, eax
add edx, 4
dec ecx
jne 0x4061ad
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
sub edx, edx
mov dword [esi + 0x39c], eax
mov eax, dword [esp + 0x20]
mov dword [esi + 0x3a0], ecx
inc eax
mov dword [esi + 0x3a4], eax
mov eax, ebp
div ebx
mov dword [esi + 0x4bc], eax
mov edx, dword [esp + 0x44]
test dh, 2
jne 0x406266
mov ecx, dword [esp + 0x48]
cmp ecx, 0xffffffff
jne 0x40622d
mov eax, dword [esi + 0x424]
mov ecx, 0x3000
test eax, eax
je 0x406215
mov ecx, dword [esi + 0x3a0]
mov eax, ebp
shr eax, 2
cmp ecx, eax
jbe 0x406220
mov ecx, eax
cmp ecx, 0x3000
jae 0x40622d
mov ecx, 0x3000
add ecx, 0xfff
and ecx, 0xfffff000
cmp ecx, 0x2000
jae 0x406246
mov ecx, 0x2000
lea eax, [ebp*4]
mov edi, 5
sub edx, edx
div edi
cmp eax, ecx
ja 0x4062fe
or dword [esp + 0x44], 0x200
mov dword [esi + 0x3b4], ebp
lea edi, [esi + 0x3b4]
mov eax, dword [edi]
add eax, 8
push eax
push esi
call fcn.00406620
add esp, 8
mov dword [esi + 0x3d0], eax
test eax, eax
jne 0x40635b
mov al, byte [0x417a10]
cmp al, 1
jne 0x4062a3
push str.Couldnt_allocate_I_O_buffer_r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [esi + 0x450]
test eax, eax
je 0x4062b3
push eax
call fcn.00401040
mov eax, dword [esi + 0x3b8]
push eax
call fcn.00401040
mov eax, dword [esi + 0x3e0]
push eax
call fcn.00401040
mov eax, dword [esp + 0x44]
test eax, 0x2000000
jne 0x4062e2
mov ebx, dword [esi + 0x3b0]
push esi
call fcn.00401040
mov eax, dword [esp + 0x44]
test ah, 0x10
jne 0x4062f2
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x2c
ret 0xc
lea edi, [esi + 0x3b4]
mov eax, dword [esp + 0x18]
test ecx, ecx
mov dword [edi], eax
mov dword [esi + 0x464], ecx
je 0x406272
add ecx, 0x1000
push ecx
push esi
call fcn.00406620
add esp, 8
mov dword [esi + 0x450], eax
mov dword [esi + 0x458], eax
mov dword [esi + 0x45c], eax
mov eax, dword [esi + 0x450]
test eax, eax
je 0x4062b3
mov ecx, dword [esi + 0x464]
add ecx, eax
mov dword [esi + 0x454], ecx
jmp 0x406272
mov eax, dword [esi + 0x3cc]
mov dword [esi + 0x468], eax
mov ecx, dword [esp + 0x44]
test ch, 2
je 0x4063af
push ebp
mov eax, dword [esi + 0x3d0]
push eax
push esi
call fcn.00406780
mov eax, dword [esp + 0x50]
add esp, 0xc
test ah, 0x10
jne 0x406397
mov eax, dword [esi + 0x3b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esi + 0x3b0], 0xffffffff
mov eax, dword [esi + 0x3d0]
mov dword [esi + 0x3d4], eax
jmp 0x40640c
mov eax, dword [esi + 0x3cc]
and eax, 0xfff
mov dword [esp + 0x10], eax
je 0x406403
lea eax, [esp + 0x10]
push 0
mov ecx, dword [esp + 0x14]
push eax
mov eax, 0x1000
mov edx, dword [esi + 0x450]
sub eax, ecx
push eax
push edx
mov eax, dword [esi + 0x3b0]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esi + 0x450]
mov ecx, dword [esp + 0x10]
add eax, ecx
mov dword [esi + 0x45c], eax
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x460], ecx
push esi
call fcn.00406a30
add esp, 4
mov edi, 0xffffffff
push esi
mov dword [esi + 0x3d8], edi
call fcn.00406a80
add esp, 4
mov dword [esi + 0x444], edi
mov edi, 0xfe000
mov eax, dword [esp + 0x44]
and eax, 0xffc01fff
mov dword [esi + 0x390], eax
mov eax, dword [esp + 0x44]
test edi, eax
je 0x4064e5
lea eax, [esp + 0x44]
push eax
call fcn.00406fd0
add esp, 4
xor ecx, ecx
mov cl, al
mov dword [esp + 0x10], ecx
push 0x90
push esi
call fcn.00406620
mov ecx, dword [esp + 0x18]
add esp, 8
mov dword [esi + ecx*4 + 0x428], eax
mov ecx, dword [esp + 0x10]
mov eax, dword [esi + ecx*4 + 0x428]
test eax, eax
je 0x4064d9
push ecx
push esi
call fcn.00407000
add esp, 8
test al, al
je 0x4064af
mov eax, 1
mov ecx, dword [esp + 0x10]
add cl, 0xd
mov edx, dword [esi + 0x390]
shl eax, cl
or edx, eax
mov dword [esi + 0x390], edx
jmp 0x4064d9
mov eax, dword [esp + 0x10]
mov ecx, dword [esi + eax*4 + 0x428]
push ecx
call fcn.00401040
sub dword [esi + 0x480], 0x90
mov edx, dword [esp + 0x10]
mov dword [esi + edx*4 + 0x428], 0
mov eax, dword [esp + 0x44]
test edi, eax
jne 0x406446
mov dword [esi + 0x420], 0xffffffff
mov eax, dword [esp + 0x44]
test ah, 1
je 0x406505
push esi
call fcn.00406650
add esp, 4
test eax, eax
jne 0x4064f8
mov eax, dword [esp + 0x44]
and eax, 0x300000
cmp eax, 0x100000
je 0x406525
cmp eax, 0x200000
je 0x406530
cmp eax, 0x300000
je 0x40653b
jmp 0x406544
mov eax, dword [esi + 0x14]
and eax, 0xfffffffb
or eax, 2
jmp 0x406541
mov eax, dword [esi + 0x14]
and eax, 0xfffffffd
or eax, 4
jmp 0x406541
mov eax, dword [esi + 0x14]
and eax, 0xfffffff9
mov dword [esi + 0x14], eax
mov eax, dword [esi + 0x14]
and eax, 6
cmp eax, 2
je 0x406556
cmp eax, 4
je 0x406563
jmp 0x406574
mov eax, dword [esi + 0x390]
or eax, 0x100000
jmp 0x40656e
mov eax, dword [esi + 0x390]
or eax, 0x200000
mov dword [esi + 0x390], eax
mov eax, dword [esi + 0x390]
test eax, 0x300000
je 0x406589
mov eax, dword [esi + 8]
add eax, eax
mov dword [esi + 8], eax
call dword [sym.imp.WINMM.dll_timeGetTime]
sub eax, dword [esp + 0x28]
mov dword [esi + 0x494], eax
mov edx, dword [esi + 0x478]
mov ebx, dword [esi + 0x470]
add ebx, edx
mov dword [esi + 0x470], ebx
mov eax, dword [esi + 0x474]
mov ebp, dword [esi + 0x46c]
add ebp, eax
mov dword [esi + 0x46c], ebp
mov dword [esi + 0x478], 0
mov ebx, dword [esi + 0x470]
mov dword [esi + 0x498], ebx
mov al, byte [0x417a10]
cmp al, 1
jne 0x406611
lea eax, [esp + 0x2c]
push 0xa
push eax
push esi
call fcn.0040b860
add esp, 0xc
push str.SmackOpen_returned:
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea eax, [esp + 0x2c]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x417b9c
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, esi
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x2c
ret 0xc