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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
push ebx
push esi
push edi
push 0x2711
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
test eax, eax
setne bl
mov byte [ebp - 4], bl
push 0x86
push dword [ebp - 4]
mov dword [ebp - 0x10], eax
call fcn.004020b1
add esp, 0xc
test bl, bl
je 0x401dac
push dword [ebp + 8]
mov edi, 0x2710
push edi
push 1
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fread]
mov esi, dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
mov dword [ebp - 8], eax
cmp dword [ebp - 8], edi
jne 0x401d82
push dword [ebp + 0xc]
push edi
push 1
push dword [ebp - 0x10]
call esi
cmp eax, edi
push 0x8f
sete bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
push dword [ebp + 8]
push edi
push 1
push dword [ebp - 0x10]
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x28
mov dword [ebp - 8], eax
test bl, bl
jne 0x401d44
test bl, bl
je 0x401dac
push dword [ebp + 0xc]
push dword [ebp - 8]
push 1
push dword [ebp - 0x10]
call esi
cmp eax, dword [ebp - 8]
push 0x96
sete bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
add esp, 0x18
xor esi, esi
cmp dword [ebp + 0xc], esi
je 0x401dbd
push dword [ebp + 0xc]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
cmp dword [ebp + 8], esi
je 0x401dcc
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
test bl, bl
je 0x40209b
push 0x4066d0
mov dword [ebp - 8], esi
push dword [ebp + 0x10]
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
push 0xac
cmp edi, esi
mov dword [ebp + 0xc], edi
setne bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
mov esi, dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0x10
test bl, bl
je 0x401f5f
push 2
push 0
push edi
call esi
mov ebx, eax
push 0xb2
neg ebx
sbb bl, bl
inc bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
add esp, 0x14
test bl, bl
je 0x401f5f
push edi
call dword [sym.imp.MSVCRT.dll_ftell]
mov edi, eax
push 0xb9
test edi, edi
setne bl
mov byte [ebp - 4], bl
mov dword [ebp - 0xc], edi
push dword [ebp - 4]
call fcn.004020b1
add esp, 0xc
test bl, bl
je 0x401f62
lea eax, [edi - 8]
push 0
push eax
push dword [ebp + 0xc]
call esi
mov ebx, eax
push 0xbf
neg ebx
sbb bl, bl
inc bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
add esp, 0x14
test bl, bl
je 0x401f62
and byte [ebp - 0x24], 0
xor eax, eax
lea edi, [ebp - 0x23]
push dword [ebp + 0xc]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push 8
lea eax, [ebp - 0x24]
push 1
push eax
call edi
add esp, 0x10
test eax, eax
je 0x401ecd
lea eax, [ebp - 0x24]
push eax
call dword [sym.imp.MSVCRT.dll_atol]
pop ecx
mov dword [ebp + 8], eax
jmp 0x401edd
push 0xca
push 0
xor bl, bl
call fcn.004020b1
pop ecx
pop ecx
test bl, bl
je 0x401f5f
push dword [ebp + 8]
call dword [sym.imp.MSVCRT.dll_malloc]
test eax, eax
setne bl
mov byte [ebp - 4], bl
push 0xd2
push dword [ebp - 4]
mov dword [ebp - 8], eax
call fcn.004020b1
add esp, 0xc
test bl, bl
je 0x401f5f
mov eax, dword [ebp - 0xc]
push 0
sub eax, dword [ebp + 8]
sub eax, 8
push eax
push dword [ebp + 0xc]
call esi
mov ebx, eax
push 0xd8
neg ebx
sbb bl, bl
inc bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
add esp, 0x14
test bl, bl
je 0x401f5f
push dword [ebp + 0xc]
push dword [ebp + 8]
push 1
push dword [ebp - 8]
call edi
cmp eax, dword [ebp + 8]
push 0xde
sete bl
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
add esp, 0x18
mov edi, dword [ebp - 0xc]
and dword [ebp - 0xc], 0
test bl, bl
je 0x402049
push str.cabinet.dll
lea eax, [ebp - 0x22c]
push dword [ebp + 0x14]
push str._s_s
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x22c]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x401fd4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x22c]
push eax
push str.CreateFile__s_error__d
push str.Extract
call fcn.00401000
add esp, 0x10
xor bl, bl
test bl, bl
je 0x402049
lea eax, [ebp - 0x14]
push 0
push eax
push dword [ebp + 8]
push dword [ebp - 8]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x402013
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x22c]
push eax
push str.WriteFile__s_error__d
push str.Extract
call fcn.00401000
add esp, 0x10
xor bl, bl
test bl, bl
je 0x402049
push 0
push 0
push dword [ebp + 0xc]
call esi
sub edi, dword [ebp + 8]
add esp, 0xc
sub edi, 8
push edi
push dword [ebp + 0xc]
call fcn.00402660
test eax, eax
setne bl
mov byte [ebp - 4], bl
push 0xfe
push dword [ebp - 4]
call fcn.004020b1
pop ecx
pop ecx
cmp dword [ebp - 8], 0
je 0x402059
push dword [ebp - 8]
call dword [sym.imp.MSVCRT.dll_free]
pop ecx
cmp dword [ebp + 0xc], 0
je 0x402069
push dword [ebp + 0xc]
call dword [sym.imp.MSVCRT.dll_fclose]
pop ecx
cmp dword [ebp - 0xc], 0
je 0x402078
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test bl, bl
je 0x40209b
push dword [ebp + 0x14]
push dword [ebp + 0x10]
call fcn.00402f50
mov bl, al
push 0x112
mov byte [ebp - 4], bl
push dword [ebp - 4]
call fcn.004020b1
pop ecx
pop ecx
cmp dword [ebp - 0x10], 0
je 0x4020aa
push dword [ebp - 0x10]
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
pop ecx
pop edi
mov al, bl
pop esi
pop ebx
leave
ret