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

Disassembly:
mov eax, 0x2724
call fcn.0040cf30
push ebx
mov ebx, dword [esp + 0x2730]
push ebp
mov ebp, dword [sym.imp.MSVCRT.dll__fileno]
push esi
push edi
xor eax, eax
push 0x8000
push ebx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], eax
call ebp
mov esi, dword [sym.imp.MSVCRT.dll__setmode]
add esp, 4
push eax
call esi
add esp, 8
cmp eax, 0xffffffff
jne 0x4031c6
call fcn.00402890
mov edi, dword [esp + 0x2738]
push 0x8000
push edi
call ebp
add esp, 4
push eax
call esi
add esp, 8
cmp eax, 0xffffffff
jne 0x4031e8
call fcn.00402890
test byte [ebx + 0xc], 0x20
jne case.0x4033b9.6
test byte [edi + 0xc], 0x20
jne case.0x4033b9.6
mov eax, dword [esp + 0x14]
xor edx, edx
mov dl, byte [0x4131ea]
lea ecx, [esp + 0x13ac]
push eax
mov eax, dword [0x413610]
push ecx
push edx
push eax
lea ecx, [esp + 0x20]
push edi
push ecx
call fcn.00405c60
mov ebp, eax
test ebp, ebp
je 0x40339e
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x40339e
inc dword [esp + 0x18]
lea edx, [esp + 0x24]
push 0x1388
push edx
lea eax, [esp + 0x18]
push ebp
push eax
call fcn.00405e70
mov ecx, dword [esp + 0x10]
cmp ecx, 0xfffffffb
je 0x403334
test ecx, ecx
je 0x403268
cmp ecx, 4
jne 0x403282
test eax, eax
jle 0x403282
push ebx
push eax
lea ecx, [esp + 0x2c]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ecx, dword [esp + 0x20]
add esp, 0x10
test byte [ebx + 0xc], 0x20
jne case.0x4033b9.6
test ecx, ecx
je 0x40323d
cmp ecx, 4
jne 0x40339e
lea edx, [esp + 0x14]
lea eax, [esp + 0x1c]
push edx
push eax
lea ecx, [esp + 0x18]
push ebp
push ecx
call fcn.00406080
mov eax, dword [esp + 0x10]
test eax, eax
je 0x4032c3
push 0x410488
call fcn.00402850
add esp, 4
mov esi, dword [esp + 0x14]
xor eax, eax
test esi, esi
jle 0x4032f2
mov edi, dword [esp + 0x1c]
lea edx, [esp + 0x13ac]
sub edi, edx
lea ecx, [esp + eax + 0x13ac]
inc eax
cmp eax, esi
mov dl, byte [edi + ecx]
mov byte [ecx], dl
jl 0x4032da
mov edi, dword [esp + 0x2738]
lea eax, [esp + 0x10]
push ebp
push eax
call fcn.00405df0
mov eax, dword [esp + 0x10]
test eax, eax
je 0x403312
push str.decompress:bzReadGetUnused
call fcn.00402850
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4031fc
push edi
call fcn.00402820
add esp, 4
test al, al
jne 0x40348e
jmp 0x4031fc
mov al, byte [0x41361c]
test al, al
je 0x40339e
push edi
call dword [sym.imp.MSVCRT.dll_rewind]
mov esi, dword [sym.imp.MSVCRT.dll_fread]
add esp, 4
push edi
call fcn.00402820
add esp, 4
test al, al
jne 0x40348e
push edi
push 0x1388
lea ecx, [esp + 0x2c]
push 1
push ecx
call esi
mov cl, byte [edi + 0xc]
add esp, 0x10
test cl, 0x20
jne case.0x4033b9.6
test eax, eax
jle 0x403392
push ebx
push eax
lea edx, [esp + 0x2c]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
test byte [ebx + 0xc], 0x20
jne case.0x4033b9.6
jmp 0x40334d
lea eax, [esp + 0x20]
push ebp
push eax
call fcn.00405df0
mov ecx, dword [esp + 0x10]
lea eax, [ecx + 9]
cmp eax, 6
ja case.0x4033b9.8
jmp dword [eax*4 + 0x403558]
call fcn.00402900
push str.decompress:end
call fcn.00402850
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2724
ret
call fcn.00403580
call fcn.004028d0
call fcn.004035b0
mov eax, dword [sym.imp.MSVCRT.dll__iob]
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
cmp edi, eax
je 0x403403
push edi
call esi
add esp, 4
mov edx, dword [sym.imp.MSVCRT.dll__iob]
add edx, 0x20
cmp ebx, edx
je 0x403416
push ebx
call esi
add esp, 4
cmp dword [esp + 0x18], 1
jne 0x40342a
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x2724
ret
mov al, byte [0x4131eb]
test al, al
je 0x403549
mov eax, dword [0x41360c]
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push 0x413200
push eax
add ecx, 0x40
push str._n_s:__s:_trailing_garbage_after_EOF_ignored_n
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2724
ret
push str.decompress:unexpected_error
call fcn.00402850
add esp, 4
push str.decompress:end
call fcn.00402850
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2724
ret
test byte [edi + 0xc], 0x20
jne case.0x4033b9.6
mov edx, dword [sym.imp.MSVCRT.dll__iob]
add edx, 0x20
cmp ebx, edx
je 0x4034b8
push ebx
call dword [sym.imp.MSVCRT.dll__fileno]
add esp, 4
test eax, eax
jl case.0x4033b9.6
push eax
call fcn.00402a70
add esp, 4
mov esi, dword [sym.imp.MSVCRT.dll_fclose]
push edi
call esi
add esp, 4
cmp eax, 0xffffffff
je case.0x4033b9.6
test byte [ebx + 0xc], 0x20
jne case.0x4033b9.6
push ebx
call dword [sym.imp.MSVCRT.dll_fflush]
add esp, 4
test eax, eax
jne case.0x4033b9.6
mov eax, dword [sym.imp.MSVCRT.dll__iob]
add eax, 0x20
cmp ebx, eax
je 0x40351d
push ebx
call esi
add esp, 4
cmp eax, 0xffffffff
mov dword [0x412590], 0
jne 0x40351d
call fcn.00402890
push str.decompress:end
call fcn.00402850
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2724
ret
mov eax, dword [0x413610]
mov dword [0x412590], 0
cmp eax, 2
jl 0x403549
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push 0x4104c0
add ecx, 0x40
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 8
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x2724
ret