Function at 0x408c50
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
mov eax, 0x23774
call fcn.0041aad0
push ebx
push ebp
push esi
mov esi, dword [esp + 0x23784]
push edi
mov edi, ecx
lea eax, [esp + 0x680]
lea ecx, [esp + 0x16c]
push eax
lea edx, [esp + 0x47c]
push ecx
lea eax, [esp + 0x584]
push edx
push eax
push esi
mov dword [esp + 0x24], edi
call fcn.0041ace0
mov eax, dword [esp + 0x237a0]
push 0
lea ecx, [esp + 0x288]
push 0
lea edx, [esp + 0x390]
push ecx
push edx
push eax
call fcn.0041ace0
add esp, 0x28
lea ecx, [esp + 0x16c]
lea edx, [esp + 0x270]
lea eax, [esp + 0x374]
push ecx
push edx
push eax
lea ecx, [esp + 0x74]
push str._s_s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x14
push 0
push 0x80
push 3
push 0
push 0
push closesocket
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CreateFileA]
call esi
mov ebp, eax
cmp ebp, 0xffffffff
jne 0x408d11
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x23774
ret 8
push 0
push 0x80
push 2
push 0
push 0
lea edx, [esp + 0x7c]
push 0x40000000
push edx
call esi
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x408d40
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x23774
ret 8
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [edi + LockFile], eax
xor eax, eax
mov ecx, 0xc
lea edi, [esp + 0x1c]
push eax
push eax
rep stosd dword es:[edi], eax
lea eax, [esp + 0x24]
push eax
call sub.wz_zp.dll_BZ2_bzDecompressInit
test eax, eax
je 0x408d7b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x23774
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [sym.imp.USER32.dll_PeekMessageA]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x78c]
push 0x3000
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x408e94
mov eax, dword [esp + 0x14]
test eax, eax
je 0x408f09
lea ecx, [esp + 0x784]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], ecx
lea eax, [esp + 0x1c]
lea edx, [esp + 0x3784]
push eax
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], 0x20000
call sub.wz_zp.dll_BZ2_bzDecompress
test eax, eax
je 0x408def
cmp eax, 4
jne 0x408d02
mov eax, dword [esp + 0x30]
cmp eax, 0x20000
jae 0x408e14
mov edx, 0x20000
lea ecx, [esp + 0x18]
push 0
sub edx, eax
push ecx
lea eax, [esp + 0x378c]
push edx
push eax
push ebx
call esi
mov eax, dword [esp + 0x20]
push 1
push 0
push 0
test eax, eax
push 0
je 0x408e57
lea ecx, [esp + 0x5c]
push ecx
call edi
test eax, eax
je 0x408e45
lea edx, [esp + 0x4c]
push edx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
mov ecx, dword [esp + 0x10]
cmp dword [ecx + 0x3faa0], 1
je 0x408eb9
jmp 0x408dc5
lea edx, [esp + 0x5c]
push edx
call edi
test eax, eax
je 0x408e78
lea eax, [esp + 0x4c]
push eax
call dword [sym.imp.USER32.dll_TranslateMessage]
lea ecx, [esp + 0x4c]
push ecx
call dword [sym.imp.USER32.dll_DispatchMessageA]
mov eax, dword [esp + 0x10]
cmp dword [eax + 0x3faa0], 1
je 0x408ee1
mov edx, dword [esp + 0x24]
mov dword [eax + reloc.KERNEL32.dll_LockFile], edx
jmp 0x408d87
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
lea eax, [esp + 0x1c]
push eax
call sub.wz_zp.dll_BZ2_bzDecompressEnd
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x23774
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
lea ecx, [esp + 0x68]
push ecx
call fcn.0041ab7c
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x23774
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
lea edx, [esp + 0x68]
push edx
call fcn.0041ab7c
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x23774
ret 8
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebp
call esi
push ebx
call esi
lea eax, [esp + 0x1c]
push eax
call sub.wz_zp.dll_BZ2_bzDecompressEnd
neg eax
pop edi
pop esi
sbb eax, eax
pop ebp
inc eax
pop ebx
add esp, 0x23774
ret 8