Function at 0x401820
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0xcc
mov eax, dword [esp + 0xe0]
mov edx, dword [esp + 0xe4]
mov esi, dword [esp + 0xe8]
mov dword [esp + 0x60], eax
mov eax, dword [0x418030]
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0xec]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], edx
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edx, dword [esp + 0x3c]
mov dword [esp], edx
mov dword [esp + 0x48], eax
call sub.msvcrt.dll_malloc
mov dword [esp + 0xb0], 0
mov dword [esp + 0xb4], 0
mov dword [esp + 0xb8], 0
mov dword [esp + 0xbc], 0
test eax, eax
mov dword [esp + 0x4c], eax
je 0x401e39
mov edi, dword [esp + 0x48]
test edi, edi
je 0x401e39
mov eax, dword [esp + 0x48]
lea edx, [esp + 0x78]
mov dword [esp + 0x98], 0
mov dword [esp + 0x9c], 0
mov dword [esp + 0xa0], 0
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x7c], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x88], 0
mov dword [esp + 0x84], eax
mov dword [esp + 0xc], 0x38
mov dword [esp + 8], 0x4130d5
mov dword [esp + 4], 0xfffffff1
mov dword [esp], edx
call fcn.004058f0
test eax, eax
jne 0x401e6d
test byte [esi + 3], 8
lea ebp, [esi + 0xa]
je 0x40194a
mov dword [esp], ebp
call sub.msvcrt.dll_strlen
lea ebp, [ebp + eax + 1]
mov edx, dword [esp + 0x40]
mov edi, ebp
sub edi, esi
lea eax, [edi + edi + 1]
mov dword [esp], eax
sub edx, edi
mov dword [esp + 0x30], edx
call sub.msvcrt.dll_malloc
test edi, edi
mov dword [0x418034], eax
jle 0x401998
xor ebx, ebx
jmp 0x401976
mov eax, dword [0x418034]
movzx edx, byte [esi + ebx]
lea eax, [eax + ebx*2]
add ebx, 1
mov dword [esp + 4], str._02x
mov dword [esp], eax
mov dword [esp + 8], edx
call sub.msvcrt.dll_sprintf
cmp ebx, edi
jne 0x401971
mov edx, dword [esp + 0x30]
cmp dword [esp + 0x3c], edx
jb 0x401e09
mov eax, dword [esp + 0x48]
shl edi, 3
mov dword [esp + 8], edx
mov dword [esp + 4], ebp
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov edx, dword [esp + 0x30]
mov dword [esp + 0x7c], edx
mov edx, dword [esp + 0x40]
cmp dword [esp + 0x3c], edx
ja 0x401d30
call fcn.00403bf0
test eax, eax
mov dword [0x418038], eax
je 0x401e79
mov eax, dword [esp + 0x8c]
mov edx, edi
xor ebx, ebx
sar edx, 0x1f
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0x34]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 4], edx
lea edx, [esp + 0xb8]
mov dword [esp], eax
lea eax, [esp + 0xb0]
call fcn.00401550
mov eax, dword [0x418030]
mov ebp, dword [esp + 0x48]
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x88], eax
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov esi, dword [esp + 0x7c]
test esi, esi
jne 0x401aa0
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], 1
mov dword [esp], ebp
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
call sub.msvcrt.dll_fread
cmp eax, 0
jl 0x401dbd
je 0x401dd5
mov dword [esp + 0x78], ebp
mov dword [esp + 0x7c], eax
lea edx, [esp + 0x78]
mov dword [esp + 4], 5
mov dword [esp], edx
call fcn.00405d00
test eax, eax
jne 0x401b70
xor edi, edi
cmp eax, 1
mov edx, dword [esp + 0x88]
sete al
mov esi, eax
je 0x401cd0
test edx, edx
je 0x401cd0
mov edx, esi
mov ecx, dword [esp + 0xa4]
test dl, dl
jne 0x401c40
test cl, 0x80
jne 0x401c40
test ebx, ebx
jne 0x401bc0
test edi, edi
nop
je 0x401a61
mov eax, dword [esp + 0x8c]
xor edx, edx
add dword [0x418028], eax
adc dword [0x41802c], edx
mov edx, dword [esp + 0x64]
mov dword [esp], 0xa
mov dword [esp + 4], edx
call sub.msvcrt.dll_fputc
mov eax, dword [0x418038]
mov dword [esp], eax
call sub.msvcrt.dll_rewind
lea eax, [esp + 0x78]
mov dword [esp], eax
call fcn.00407a10
mov eax, dword [esp + 0x48]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, dword [esp + 0x4c]
mov dword [esp + 0xe0], eax
add esp, 0xcc
pop ebx
pop esi
pop edi
pop ebp
jmp sub.msvcrt.dll_free
cmp eax, 1
je 0x401bb0
cmp eax, 0xfffffffb
je 0x401abc
mov eax, dword [esp + 0x90]
mov dword [esp + 4], str.zlib_error__s_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 1
call sub.msvcrt.dll_exit
lea esi, [esi]
mov edi, 1
jmp 0x401abe
lea eax, [esp + 0x78]
mov ebx, 1
mov dword [esp], eax
call fcn.00408020
test eax, eax
je 0x401afd
mov eax, dword [esp + 0xa4]
xor ebx, ebx
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x44]
mov dword [esp + 0x6c], 0
and eax, 0x3f
shld ebx, ecx, 3
mov dword [esp + 0x68], eax
shl ecx, 3
sub ecx, dword [esp + 0x68]
sbb ebx, dword [esp + 0x6c]
add ecx, dword [esp + 0x30]
adc ebx, dword [esp + 0x34]
or edx, dword [esp + 0x40]
jne 0x401d76
mov eax, dword [esp + 0x8c]
xor edx, edx
mov dword [esp + 0x44], ebx
xor ebx, ebx
mov dword [esp + 0x54], edx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x50], eax
jmp 0x401afd
mov edx, dword [esp + 0x8c]
and ecx, 0x3f
mov eax, dword [esp + 0x80]
mov dword [esp + 0x58], ecx
mov dword [esp + 0x5c], 0
mov dword [esp + 8], edx
xor edx, edx
shld edx, eax, 3
shl eax, 3
sub eax, dword [esp + 0x58]
sbb edx, dword [esp + 0x5c]
add eax, dword [esp + 0x30]
adc edx, dword [esp + 0x34]
xor ebx, ebx
mov dword [esp + 0x10], 1
mov dword [esp], eax
lea eax, [esp + 0xb0]
mov dword [esp + 4], edx
lea edx, [esp + 0xb8]
mov dword [esp + 0xc], 0
call fcn.00401550
mov dword [esp + 0x50], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
jmp 0x401afd
mov eax, dword [0x418030]
mov ebx, 1
mov dword [esp], 0x418420
sub eax, edx
mov dword [esp + 8], eax
mov eax, dword [esp + 0x4c]
mov dword [esp + 4], eax
call fcn.0040e680
mov edx, dword [0x418030]
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x64]
sub edx, dword [esp + 0x88]
call fcn.00401730
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x84], eax
mov eax, dword [0x418030]
mov dword [esp + 0x88], eax
jmp 0x401adb
mov eax, dword [esp + 0x60]
test edi, edi
mov edx, dword [esp + 0x3c]
mov dword [esp + 4], 1
mov dword [esp + 0xc], eax
lea eax, [edi + 7]
cmovns eax, edi
sub edx, dword [esp + 0x30]
sar eax, 3
sub edx, eax
mov eax, dword [esp + 0x48]
add eax, dword [esp + 0x30]
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.msvcrt.dll_fread
add eax, dword [esp + 0x30]
mov dword [esp + 0x7c], eax
jmp 0x4019d3
mov eax, dword [esp + 0x50]
mov edx, dword [esp + 0x54]
mov dword [esp + 0x2c], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [esp + 0xc], edx
mov edx, dword [esp + 0x44]
mov dword [esp], eax
lea eax, [esp + 0xb0]
mov dword [esp + 4], edx
lea edx, [esp + 0xb8]
call fcn.00401550
mov ecx, dword [esp + 0x2c]
jmp 0x401c1d
mov dword [esp], str.read
call sub.msvcrt.dll_perror
mov dword [esp], 2
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x22
mov dword [esp + 4], 1
mov dword [esp], str.Premature_end_of_compressed_data._n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov eax, dword [esp + 0x3c]
mov dword [esp + 8], edx
mov dword [esp + 4], str.internal_failure___Iu____Iu_input_buffer_available_n
mov dword [esp + 0xc], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call sub.msvcrt.dll_exit
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1a
mov dword [esp + 4], 1
mov dword [esp], str.memory_allocation_failure_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sub.msvcrt.dll_fwrite
mov dword [esp], 1
call sub.msvcrt.dll_exit
mov dword [esp], 0xffffffff
call sub.msvcrt.dll_exit
mov dword [esp], str.tmpfile
call sub.msvcrt.dll_perror
mov dword [esp], 2
call sub.msvcrt.dll_exit
jmp fcn.00401ea0