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

Disassembly:
sub esp, 0x30
push ebx
push ebp
mov ebp, dword [esp + 0x40]
xor eax, eax
mov ebx, ecx
mov dword [esp + 0xc], eax
mov ecx, dword [0x410084]
mov byte [esp + 0xa], al
mov byte [esp + 0xb], al
mov dword [esp + 0x14], eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 4]
push esi
push edi
mov edi, dword [esp + 0x54]
cmp eax, ecx
mov dword [esp + 0x24], ebx
je 0x404f2d
mov ecx, dword [esp + 0x60]
mov edx, dword [esp + 0x5c]
push ecx
mov ecx, dword [esp + 0x5c]
push edx
mov edx, dword [esp + 0x58]
push ecx
mov ecx, dword [esp + 0x58]
push edi
push edx
push ecx
push eax
lea ecx, [ebx + 0x94]
call fcn.00408250
mov esi, dword [esp + 0x5c]
push eax
push esi
mov ecx, ebx
call fcn.00404eb0
cmp al, 1
jne 0x404f31
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 0x20
mov esi, dword [esp + 0x44]
mov eax, dword [ebp + 8]
mov ecx, dword [0x410084]
cmp eax, ecx
je 0x404f7b
mov edx, dword [esp + 0x60]
mov ecx, dword [esp + 0x5c]
push edx
mov edx, dword [esp + 0x5c]
push ecx
mov ecx, dword [esp + 0x58]
push edx
mov edx, dword [esp + 0x58]
push edi
push ecx
push edx
push eax
lea ecx, [ebx + 0x94]
call fcn.00408250
push eax
push esi
mov ecx, ebx
call fcn.00404eb0
cmp al, 1
jne 0x404f7b
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 0x20
mov eax, dword [ebp]
add ebx, 0x94
push eax
mov ecx, ebx
call fcn.00408250
test byte [eax + 8], 1
je 0x404f99
test byte [esp + 0x58], 8
jne 0x404fb9
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
test byte [eax + 8], 1
jne 0x4052b5
test byte [esp + 0x58], 0x10
je 0x4052b5
cmp edi, 0xffffffff
je 0x404fd2
mov edx, dword [ebp]
mov ecx, ebx
push edx
call fcn.00408250
cmp edi, dword [eax + 4]
jne 0x4052b5
mov eax, dword [ebp]
push 0
push 0
push eax
mov ecx, ebx
call fcn.00408250
mov ecx, dword [eax + 0x14]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4052b0
mov edx, dword [ebp]
mov ecx, ebx
push edx
call fcn.00408250
mov eax, dword [eax + 0x10]
push eax
call fcn.0040a590
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
je 0x4052b0
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov edi, dword [eax + 0x10]
mov eax, dword [esp + 0x1c]
lea edx, [esp + 0x14]
push 0
push edx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4052b0
cmp dword [esp + 0x14], edi
jb 0x4052b0
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x20]
push 4
push edx
push esi
call edi
test eax, eax
je 0x4052b0
cmp dword [esp + 0x14], 4
jb 0x4052b0
mov eax, dword [esp + 0x18]
push eax
call fcn.0040a590
add esp, 4
mov dword [esp + 0x20], eax
test eax, eax
je 0x4052b0
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push 0
push ecx
push edx
push eax
push esi
call edi
test eax, eax
je 0x4052b0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
cmp eax, ecx
jb 0x4052b0
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov edx, dword [esp + 0x5c]
mov ecx, 6
mov esi, eax
lea edi, [esp + 0x28]
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x50]
lea eax, [esp + 0x13]
push edx
push eax
lea edx, [esp + 0x30]
push ecx
lea eax, [esp + 0x28]
push edx
push eax
mov byte [esp + 0x27], 0
call dword [esp + 0x60]
mov al, byte [esp + 0x27]
add esp, 0x14
cmp al, 1
jne 0x405255
test byte [esp + 0x58], 1
jne 0x405255
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov edx, dword [esp + 0x38]
mov ecx, dword [eax + 0x10]
cmp edx, ecx
jbe 0x405158
mov eax, dword [ebp]
mov ecx, ebx
push eax
call fcn.00408250
mov ecx, 6
lea esi, [esp + 0x28]
mov edi, eax
push 2
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x48]
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x3c], eax
jne 0x40519f
jmp 0x4052b0
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov ecx, 6
lea esi, [esp + 0x28]
mov edi, eax
push 0
rep movsd dword es:[edi], dword [esi]
mov edx, dword [ebp]
push 0
push edx
mov ecx, ebx
call fcn.00408250
mov eax, dword [eax + 0x14]
mov ecx, dword [esp + 0x4c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x3c], eax
je 0x4052b0
mov esi, dword [esp + 0x44]
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x14]
push 0
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4052b0
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x38]
cmp edx, eax
jb 0x4052b0
mov edi, dword [esp + 0x24]
mov ecx, dword [edi + 0x104]
mov eax, dword [ecx]
call dword [eax + 0x18]
mov ecx, dword [edi + 0x104]
and eax, 0xffff
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x20]
mov edx, dword [ecx]
push eax
mov eax, dword [esp + 0x3c]
push eax
mov eax, dword [esp + 0x24]
push eax
call dword [edx]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [esp + 0x14]
push 0
push ecx
lea edx, [esp + 0x20]
push 4
push edx
push esi
call edi
test eax, eax
je 0x4052b0
cmp dword [esp + 0x14], 4
jb 0x4052b0
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
lea eax, [esp + 0x14]
push 0
push eax
push ecx
push edx
push esi
call edi
test eax, eax
je 0x4052b0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
cmp eax, ecx
jb 0x4052b0
mov ecx, dword [esp + 0x60]
mov byte [ecx], 1
mov edx, dword [ebp]
mov ecx, ebx
push edx
call fcn.00408250
mov edi, eax
lea esi, [esp + 0x28]
mov ecx, 0x18
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x405290
test byte [esp + 0x58], 1
jne 0x405290
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov ecx, 6
lea esi, [esp + 0x28]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov edx, dword [esp + 0x5c]
mov al, byte [edx]
cmp al, 1
jne 0x4052a5
test byte [esp + 0x58], 2
je 0x4052a5
mov byte [esp + 0x12], al
test al, al
jne 0x4052b5
test byte [esp + 0x58], 4
je 0x4052b5
mov byte [esp + 0x12], 1
mov eax, dword [esp + 0x1c]
push eax
call fcn.0040a130
mov ecx, dword [esp + 0x24]
add esp, 4
push ecx
call fcn.0040a130
mov al, byte [esp + 0x16]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret 0x20