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

Disassembly:
sub esp, 0x54
xor eax, eax
xor edx, edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x40], edx
push ebx
push ebp
mov dword [esp + 0x34], eax
mov dword [esp + 0x4c], edx
push esi
push edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x58], edx
xor edi, edi
lea ebx, [ecx + 0x94]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x44], eax
mov dword [esp + 0x5c], edx
push edi
mov ecx, ebx
mov byte [esp + 0x15], 0
mov byte [esp + 0x17], 0
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0x38], edi
mov dword [esp + 0x4c], eax
mov dword [esp + 0x64], edx
mov byte [esp + 0x16], dl
call fcn.00408140
push eax
mov ecx, ebx
call fcn.00408250
mov ecx, dword [esp + 0x68]
mov ebp, eax
mov eax, dword [ecx]
mov dword [esp + 0x30], eax
call dword [eax + 0x10]
cmp ebp, edi
mov esi, eax
je 0x404db7
mov eax, dword [ebp]
mov ecx, ebx
push eax
call fcn.00408250
cmp dword [eax], esi
je 0x404b17
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
cmp dword [eax], esi
jbe 0x404b06
mov edx, dword [ebp + 4]
push edx
jmp 0x404b0a
mov eax, dword [ebp + 8]
push eax
mov ecx, ebx
call fcn.00408250
mov ebp, eax
cmp ebp, edi
jne 0x404ae2
cmp ebp, edi
je 0x404db7
mov ecx, dword [esp + 0x24]
push 1
call fcn.004033a0
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x404b3d
mov byte [esp + 0x11], 0
jmp 0x404db7
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov ecx, 6
mov esi, eax
lea edi, [esp + 0x4c]
rep movsd dword es:[edi], dword [esi]
mov ecx, 6
mov esi, eax
lea edi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
mov esi, dword [esp + 0x6c]
test esi, esi
je 0x404c09
mov edx, dword [ebp]
push 0
push 0
push edx
mov ecx, ebx
call fcn.00408250
mov eax, dword [eax + 0x14]
mov ecx, dword [esp + 0x1c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x404b9b
mov byte [esp + 0x11], 0
jmp 0x404db7
mov edi, dword [esp + 0x5c]
push edi
call fcn.0040a590
add esp, 4
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x404bb9
mov byte [esp + 0x11], al
jmp 0x404db7
lea edx, [esp + 0x18]
push 0
push edx
push edi
push eax
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404d70
cmp dword [esp + 0x18], edi
jb 0x404d70
mov eax, dword [esp + 0x68]
lea ecx, [esp + 0x13]
lea edx, [esp + 0x12]
push ecx
mov ecx, dword [esp + 0x74]
push edx
push eax
lea edx, [esp + 0x40]
push ecx
lea eax, [esp + 0x2c]
push edx
push eax
mov byte [esp + 0x2a], 0
call esi
add esp, 0x18
jmp 0x404c4b
mov esi, dword [esp + 0x68]
mov edx, dword [esp + 0x30]
lea ecx, [esp + 0x28]
push ecx
mov ecx, esi
call dword [edx + 4]
test eax, eax
mov dword [esp + 0x1c], eax
jne 0x404c2c
mov byte [esp + 0x11], al
jmp 0x404db7
mov eax, dword [esp + 0x28]
add esi, 4
mov ecx, 6
lea edi, [esp + 0x34]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x5c]
mov dword [esp + 0x44], eax
mov byte [esp + 0x12], 1
mov al, byte [esp + 0x12]
test al, al
je 0x404d77
cmp dword [esp + 0x44], edi
jbe 0x404c6a
mov ecx, dword [esp + 0x14]
push 2
push 0
push 0
push ecx
jmp 0x404c78
mov edx, dword [esp + 0x60]
mov eax, dword [esp + 0x14]
push 0
push 0
push edx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x48], eax
jne 0x404c91
mov byte [esp + 0x11], 0
jmp 0x404db7
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x1c]
lea ecx, [esp + 0x18]
push 0
push ecx
mov ecx, dword [esp + 0x1c]
push edx
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404d70
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x44]
cmp edx, eax
jb 0x404d70
mov edi, dword [esp + 0x24]
mov ecx, dword [edi + 0x104]
mov eax, dword [ecx]
call dword [eax + 0x18]
and eax, 0xffff
push eax
mov dword [esp + 0x24], eax
call fcn.0040a590
mov esi, eax
add esp, 4
test esi, esi
mov dword [esp + 0x2c], esi
jne 0x404cf9
mov byte [esp + 0x11], al
jmp 0x404db7
mov eax, dword [esp + 0x44]
mov ecx, dword [edi + 0x104]
push esi
push eax
mov eax, dword [esp + 0x24]
mov edx, dword [ecx]
push eax
call dword [edx]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push 0
push ecx
lea edx, [esp + 0x28]
push 4
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404d70
cmp dword [esp + 0x18], 4
jb 0x404d70
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x18]
push 0
push ecx
push edx
push esi
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404d70
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
cmp ecx, eax
jb 0x404d70
mov edx, dword [esp + 0x14]
mov ecx, edi
push edx
call fcn.00405360
test al, al
jne 0x404d77
mov byte [esp + 0x11], al
jmp 0x404db7
mov byte [esp + 0x11], 0
jmp 0x404db7
mov ecx, 0x18
lea edi, [esp + 0x4c]
lea esi, [esp + 0x34]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x404da2
mov ecx, dword [ebp]
push ecx
mov ecx, ebx
call fcn.00408250
mov ecx, 6
lea esi, [esp + 0x34]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x14]
push edx
push 1
call fcn.00403400
mov byte [esp + 0x11], 1
mov eax, dword [esp + 0x1c]
push eax
call fcn.0040a130
mov ecx, dword [esp + 0x30]
add esp, 4
push ecx
call fcn.0040a130
mov al, byte [esp + 0x15]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret 0xc