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

Disassembly:
push ebp
mov eax, 0x40218
lea ebp, [esp - 0x40198]
call fcn.00403eb0
mov eax, dword [0x405038]
push ebx
push esi
push edi
mov dword [ebp + 0x40194], eax
xor edi, edi
push edi
lea eax, [ebp - 0x7c]
push eax
mov esi, 0x200
push esi
lea eax, [ebp + 0x3ff94]
mov ebx, ecx
push eax
push dword [ebx]
mov byte [ebp - 0x6d], 1
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4025e8
cmp dword [ebp - 0x7c], esi
jne 0x4025e8
push 4
mov esi, 0x404290
lea eax, [ebp + 0x40095]
pop ecx
mov dl, byte [eax]
cmp dl, byte [esi]
jne 0x402458
inc eax
inc esi
dec ecx
jne 0x40244d
movzx eax, byte [eax]
movzx ecx, byte [esi]
sub eax, ecx
mov dword [ebp - 0x80], eax
jne 0x402475
mov eax, dword [ebp + 0x401a0]
mov byte [eax], 1
mov al, 1
jmp 0x4025ea
push 4
mov esi, 0x404288
lea eax, [ebp + 0x40095]
pop ecx
mov dl, byte [eax]
cmp dl, byte [esi]
jne 0x40248e
inc eax
inc esi
dec ecx
jne 0x402483
movzx eax, byte [eax]
movzx ecx, byte [esi]
sub eax, ecx
mov dword [ebp + 0x401a0], eax
jne 0x4025e8
mov esi, dword [ebx + 4]
sub esi, 0x10
call fcn.0040219e
add eax, 0x10
mov dword [ebp + 0x401a0], eax
mov eax, 0x404284
lea ecx, [ebp + 0x401a0]
call fcn.00402602
lea eax, [ebp + 0x3ff94]
lea ecx, [ebp + 0x401a0]
call fcn.00402602
push edi
push pe_nt_image_headers32
push 2
push edi
push edi
push 0x40000000
push dword [ebp + 0x401a0]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x80], eax
jne 0x402501
xor bl, bl
jmp 0x4025d6
push edi
push edi
lea eax, [ebp + 0x40010]
push eax
push 8
pop eax
call fcn.004028f5
add esp, 0xc
push 1
push edi
push edi
push dword [ebx]
mov esi, eax
mov dword [ebp - 0x74], esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
add eax, dword [ebp - 0x74]
neg esi
and esi, 0x1ff
add esi, eax
cmp dword [ebp - 0x74], edi
jbe 0x402589
mov ecx, dword [ebp - 0x74]
mov eax, 0x40000
cmp ecx, eax
mov dword [ebp - 0x78], eax
jae 0x40254a
mov dword [ebp - 0x78], ecx
push edi
lea eax, [ebp - 0x7c]
push eax
push dword [ebp - 0x78]
lea eax, [ebp - 0x6c]
push eax
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x402585
push edi
lea eax, [ebp - 0x7c]
push eax
push dword [ebp - 0x78]
lea eax, [ebp - 0x6c]
push eax
push dword [ebp - 0x80]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402585
mov eax, dword [ebp - 0x78]
sub dword [ebp - 0x74], eax
jne 0x402538
jmp 0x402589
mov byte [ebp - 0x6d], 0
push dword [ebp - 0x80]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x6d], 0
je 0x4025c3
cmp byte [ebx + 8], 0
je 0x4025af
lea eax, [ebp + 0x401a0]
push eax
lea edi, [ebx + 0xc]
call fcn.00401f11
xor edi, edi
mov eax, dword [ebx + 0x18]
cmp eax, edi
je 0x4025c3
push dword [ebp + 0x401a0]
push dword [ebx + 0x1c]
call eax
pop ecx
pop ecx
cmp esi, 0xffffffff
je 0x4025d3
push edi
push edi
push esi
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov bl, byte [ebp - 0x6d]
mov eax, dword [ebp + 0x401a0]
add eax, 0xfffffff0
call fcn.004012cc
mov al, bl
jmp 0x4025ea
xor al, al
mov ecx, dword [ebp + 0x40194]
pop edi
pop esi
pop ebx
call fcn.00402a68
add ebp, 0x40198
leave
ret 4