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

Disassembly:
push 0xffffffffffffffff
push 0x41e656
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x44
mov eax, dword [esp + 0x54]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x68]
xor ebp, ebp
push edi
mov edi, dword [esp + 0x68]
push ebp
push esi
push edi
mov ebx, ecx
push eax
call fcn.00407150
mov ecx, dword [esp + 0x88]
push ebp
push ebp
push ebp
push ecx
call fcn.00407150
mov eax, dword [esp + 0x90]
add esp, 0x20
sub eax, edi
mov edi, dword [esp + 0x74]
sbb edi, esi
mov dword [esp + 0x38], eax
cmp edi, ebp
mov dword [esp + 0x3c], edi
jg 0x40e290
jl 0x40e289
cmp eax, ebp
jae 0x40e290
xor eax, eax
jmp 0x40e710
mov eax, dword [ebx + 0x181c]
cmp eax, 1
je 0x40e2cd
cmp eax, 3
je 0x40e2cd
cmp eax, 2
je 0x40e2aa
cmp eax, 4
jne 0x40e2fe
push 8
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x68], eax
cmp eax, ebp
mov dword [esp + 0x5c], 1
je 0x40e2ec
mov ecx, eax
call fcn.00401b20
jmp 0x40e2ee
push 8
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [esp + 0x68], eax
cmp eax, ebp
mov dword [esp + 0x5c], ebp
je 0x40e2ec
mov ecx, eax
call fcn.00401820
jmp 0x40e2ee
xor eax, eax
cmp eax, ebp
mov dword [esp + 0x5c], 0xffffffff
mov dword [esp + 0x68], eax
jne 0x40e305
xor eax, eax
jmp 0x40e710
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], ebp
mov esi, dword [esp + 0x38]
xor ebx, ebx
cmp esi, 0x10000
mov dword [esp + 0x5c], 2
mov dword [esp + 0x34], ebp
mov dword [esp + 0x10], ebp
mov dword [esp + 0x70], 0x10000
jg 0x40e337
mov dword [esp + 0x70], esi
lea ecx, [esp + 0x40]
call fcn.00401000
mov eax, dword [esp + 0x70]
lea ecx, [esp + 0x40]
push eax
mov byte [esp + 0x60], 3
lea edx, [eax + eax*4]
push edx
call fcn.00401020
lea ecx, [esp + 0x40]
call fcn.00401110
mov edx, dword [esp + 0x70]
lea ecx, [esp + 0x10]
push ebp
push ecx
push edx
push eax
mov eax, dword [esp + 0x74]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [esp + 0x34], edi
jg 0x40e542
jl 0x40e38b
cmp ebx, esi
jae 0x40e542
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x34]
add ebx, edx
mov eax, edi
adc ecx, ebp
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ecx
mov ecx, esi
sub ecx, ebx
sbb eax, dword [esp + 0x34]
cmp eax, ebp
jg 0x40e3bf
jl 0x40e3b7
cmp ecx, 0x10000
jae 0x40e3bf
mov eax, esi
sub eax, ebx
mov dword [esp + 0x70], eax
push edx
lea ecx, [esp + 0x44]
call fcn.00401120
lea ecx, [esp + 0x14]
mov dword [esp + 0x14], ebp
push ecx
lea ecx, [esp + 0x44]
call fcn.00401140
mov ecx, dword [esp + 0x14]
cmp ecx, ebp
jle 0x40e357
mov edx, dword [esp + 0x68]
lea edi, [esp + 0x28]
push ebp
push edi
mov esi, dword [edx]
push ecx
push eax
mov ecx, edx
mov dword [esp + 0x30], ebp
call dword [esi + 4]
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x24], eax
cmp edi, ebp
jle 0x40e527
mov edx, dword [esp + 0x28]
mov dword [esp + 0x18], edi
cmp edx, ebp
mov eax, edx
lea ecx, [edi - 1]
je 0x40e42b
cmp ecx, ebp
jle 0x40e42d
mov eax, dword [eax + 4]
dec ecx
cmp eax, ebp
jne 0x40e41f
cmp ecx, ebp
jne 0x40e4a2
cmp eax, ebp
je 0x40e4a2
mov esi, dword [eax]
cmp esi, ebp
je 0x40e4a2
mov ebx, dword [esp + 0x7c]
cmp ebx, ebp
je 0x40e47a
push 0x10
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edx, dword [esi]
mov edi, eax
push 8
mov dword [edi], edx
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
mov ecx, dword [esi + 8]
mov dword [edi + 8], ecx
mov edx, dword [esi + 0x10]
mov dword [edi + 0xc], edx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov dword [eax], edi
mov ecx, dword [ebx]
mov dword [eax + 4], ecx
mov dword [ebx], eax
mov eax, dword [ebx + 4]
add esp, 8
inc eax
mov dword [ebx + 4], eax
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0xc]
lea edx, [esp + 0x20]
push ebp
push edx
mov edx, dword [esp + 0x80]
push eax
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
mov ebx, dword [esp + 0x30]
cmp edi, 1
jne 0x40e4d1
mov eax, dword [edx]
cmp eax, ebp
je 0x40e4ba
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov edx, dword [esp + 0x2c]
add esp, 4
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor edx, edx
xor edi, edi
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], edi
jmp 0x40e518
cmp edx, ebp
mov esi, edx
lea eax, [edi - 2]
je 0x40e4e6
cmp eax, ebp
jle 0x40e4e6
mov esi, dword [esi + 4]
dec eax
cmp esi, ebp
jne 0x40e4da
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x40e518
mov eax, dword [eax]
cmp eax, ebp
je 0x40e4fc
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esi + 4]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov dword [esi + 4], ebp
mov edi, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
add esp, 4
dec edi
mov dword [esp + 0x2c], edi
mov eax, dword [esp + 0x18]
dec eax
mov dword [esp + 0x18], eax
jne 0x40e416
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x38]
push ecx
lea ecx, [esp + 0x44]
call fcn.004010b0
mov edi, dword [esp + 0x3c]
jmp 0x40e357
lea edx, [esp + 0x1c]
lea ecx, [esp + 0x40]
push edx
mov dword [esp + 0x20], ebp
call fcn.00401140
mov ecx, dword [esp + 0x1c]
cmp ecx, ebp
jle 0x40e6af
mov esi, dword [esp + 0x68]
lea edi, [esp + 0x28]
push 1
push edi
mov edx, dword [esi]
push ecx
push eax
mov ecx, esi
mov dword [esp + 0x80], ebp
call dword [edx + 4]
mov edi, dword [esp + 0x2c]
mov ebx, eax
cmp edi, ebp
jle 0x40e6a3
mov edx, dword [esp + 0x28]
mov dword [esp + 0x64], edi
cmp edx, ebp
mov eax, edx
lea ecx, [edi - 1]
je 0x40e5a6
cmp ecx, ebp
jle 0x40e5a8
mov eax, dword [eax + 4]
dec ecx
cmp eax, ebp
jne 0x40e59a
cmp ecx, ebp
jne 0x40e61a
cmp eax, ebp
je 0x40e61a
mov esi, dword [eax]
cmp esi, ebp
je 0x40e61a
cmp dword [esp + 0x7c], ebp
je 0x40e5f6
push 0x10
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
mov eax, dword [esi]
push 8
mov dword [edi], eax
mov ecx, dword [esi + 4]
mov dword [edi + 4], ecx
mov edx, dword [esi + 8]
mov dword [edi + 8], edx
mov eax, dword [esi + 0x10]
mov dword [edi + 0xc], eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ecx, dword [esp + 0x84]
mov dword [eax], edi
add esp, 8
mov edx, dword [ecx]
mov dword [eax + 4], edx
mov dword [ecx], eax
inc dword [ecx + 4]
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
lea eax, [esp + 0x70]
push ebp
push eax
mov eax, dword [esp + 0x80]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
cmp edi, 1
jne 0x40e649
mov eax, dword [edx]
cmp eax, ebp
je 0x40e632
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov edx, dword [esp + 0x2c]
add esp, 4
push edx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
xor edx, edx
xor edi, edi
mov dword [esp + 0x28], edx
mov dword [esp + 0x2c], edi
jmp 0x40e690
cmp edx, ebp
mov esi, edx
lea eax, [edi - 2]
je 0x40e65e
cmp eax, ebp
jle 0x40e65e
mov esi, dword [esi + 4]
dec eax
cmp esi, ebp
jne 0x40e652
mov eax, dword [esi + 4]
cmp eax, ebp
je 0x40e690
mov eax, dword [eax]
cmp eax, ebp
je 0x40e674
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
mov eax, dword [esi + 4]
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov dword [esi + 4], ebp
mov edi, dword [esp + 0x30]
mov edx, dword [esp + 0x2c]
add esp, 4
dec edi
mov dword [esp + 0x2c], edi
mov eax, dword [esp + 0x64]
dec eax
mov dword [esp + 0x64], eax
jne 0x40e591
mov esi, dword [esp + 0x68]
push ebx
lea ecx, [esp + 0x44]
call fcn.004010b0
jmp 0x40e6b3
mov esi, dword [esp + 0x68]
lea ecx, [esp + 0x40]
call fcn.00401080
mov edx, dword [esi]
push 1
mov ecx, esi
call dword [edx]
lea ecx, [esp + 0x40]
mov byte [esp + 0x5c], 2
call fcn.0041d4b0
mov eax, dword [esp + 0x28]
mov dword [esp + 0x5c], 0xffffffff
cmp eax, ebp
je 0x40e70b
mov esi, eax
mov eax, dword [eax + 4]
mov dword [esp + 0x28], eax
mov eax, dword [esi]
cmp eax, ebp
je 0x40e6fa
push eax
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
add esp, 4
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [esp + 0x2c]
add esp, 4
cmp eax, ebp
jne 0x40e6e2
mov eax, 1
mov ecx, dword [esp + 0x54]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x50
ret 0x1c