Function at 0x404512
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x45fa30
call fcn.00444db8
sub esp, 0x20c
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, ecx
test esi, esi
push edi
mov dword [ebp - 0x10], ebx
je 0x4047b2
mov edi, dword [ebp + 0xc]
and dword [edi], 0
mov eax, dword [esi + 4]
test eax, eax
jne 0x404554
cmp byte [esi + 0xe], 0x11
jne 0x404554
push edi
push esi
call fcn.00404d41
jmp 0x4047ca
cmp dword [esi + 0x24], 0
je 0x404561
mov dword [edi], eax
jmp 0x4047c7
cmp word [ebx + 0x10e], 2
jne 0x4046e6
test eax, eax
jne 0x404585
push dword [esi + 0x1c]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
jmp 0x40459f
movsx eax, word [esi + 0xc]
push eax
lea eax, [ebp - 0x218]
push str._u.res
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x114]
push eax
push ebx
call fcn.004092fa
lea eax, [ebp - 0x114]
push 1
push eax
call fcn.00409392
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x114]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov ebx, dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push 0x80
push 3
push 0
push 1
lea eax, [ebp - 0x114]
push SysReAllocStringLen
push eax
call ebx
mov dword [ebp + 0x10], eax
and dword [ebp - 4], 0
cmp eax, 0xffffffff
jne 0x40463c
mov ecx, dword [ebp - 0x10]
lea eax, [ebp - 0x218]
push eax
movsx eax, word [esi + 0xc]
push eax
call fcn.00404e43
push 0
push 0x80
push 3
push 0
push 1
lea eax, [ebp - 0x114]
push SysReAllocStringLen
push eax
call ebx
mov ebx, eax
push 0xffffffffffffffff
cmp ebx, 0xffffffff
je 0x4046b2
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp + 0x10], ebx
mov ax, word [esi + 0x10]
mov ecx, eax
or ecx, 2
cmp ax, cx
jne 0x40464e
mov eax, dword [esi]
jmp 0x404651
mov eax, dword [esi + 4]
mov dword [edi], eax
inc eax
push eax
call fcn.00444e5b
pop ecx
mov dword [esi + 0x24], eax
lea ecx, [ebp + 8]
push 0
push ecx
push dword [edi]
push eax
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp + 8]
cmp eax, dword [edi]
jne 0x4046a5
mov ax, word [esi + 0x10]
mov ecx, eax
or ecx, 2
cmp ax, cx
jne 0x4046ce
mov eax, dword [ebp - 0x10]
mov ax, word [eax + 0x110]
push eax
push dword [esi + 4]
push edi
push dword [esi + 0x24]
call fcn.0040584d
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4046bd
cmp dword [ebp + 0x10], 0
je 0x4047b2
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4047b2
mov eax, dword [edi]
push dword [esi + 0x24]
mov dword [esi + 4], eax
call fcn.00444382
pop ecx
mov dword [esi + 0x24], ebx
cmp dword [ebp + 0x10], 0
je 0x4047c7
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4047c7
push dword [esi + 0x20]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
test eax, eax
je 0x40472b
xor eax, eax
cmp byte [esi + 0xe], 0x11
jne 0x404704
cmp byte [esi + 0xf], 2
je 0x404704
push 0xe
pop eax
push edi
push eax
push dword [ebp + 0x10]
mov ecx, ebx
push dword [esi + 0x1c]
push dword [esi + 0x20]
call fcn.00404eed
cmp dword [ebp + 0x10], 1
mov dword [esi + 0x24], eax
je 0x4047b2
test eax, eax
jne 0x4047c7
mov eax, dword [ebx + 0x1c0]
cmp eax, 0xffffffff
je 0x4047b2
push 0
push 0
push dword [esi + 8]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4047b2
mov ax, word [esi + 0x10]
mov ecx, eax
or ecx, 2
cmp ax, cx
jne 0x40475b
mov eax, dword [esi]
jmp 0x40475e
mov eax, dword [esi + 4]
mov dword [edi], eax
inc eax
push eax
call fcn.00444e5b
pop ecx
mov dword [esi + 0x24], eax
lea ecx, [ebp + 0x10]
push 0
push ecx
push dword [edi]
push eax
push dword [ebx + 0x1c0]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp + 0x10]
cmp eax, dword [edi]
jne 0x4047b2
mov ax, word [esi + 0x10]
mov ecx, eax
or ecx, 2
cmp ax, cx
jne 0x4047c7
mov ax, word [ebx + 0x110]
push eax
push dword [esi + 4]
push edi
push dword [esi + 0x24]
call fcn.0040584d
mov ebx, eax
add esp, 0x10
test ebx, ebx
jne 0x4047b6
xor eax, eax
jmp 0x4047ca
mov eax, dword [edi]
push dword [esi + 0x24]
mov dword [esi + 4], eax
call fcn.00444382
pop ecx
mov dword [esi + 0x24], ebx
mov eax, dword [esi + 0x24]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 0xc