Function at 0x404050
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
nop
mov eax, 0x4c
push eax
call fcn.004097ab
add esp, 4
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
cmp eax, 0
jne 0x404081
mov eax, 0
jmp 0x4042b0
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
push ecx
mov dword [ebp - 0x10], eax
call fcn.004097e4
add esp, 4
mov ecx, dword [ebp - 0x10]
mov dword [ecx], eax
mov eax, dword [ebp - 4]
mov ecx, dword [eax]
cmp ecx, 0
jne 0x4040b0
mov eax, 0
jmp 0x4042b0
mov eax, dword [ebp - 4]
add eax, 0xc
mov ecx, 0x40c01d
push ecx
mov ecx, dword [ebp + 8]
push ecx
mov dword [ebp - 0x14], eax
call fcn.00406a97
add esp, 8
mov ecx, dword [ebp - 0x14]
mov dword [ecx], eax
mov eax, dword [ebp - 4]
add eax, 0xc
mov ecx, dword [eax]
cmp ecx, 0
jne 0x4040eb
mov eax, 0
jmp 0x4042b0
mov eax, dword [ebp - 4]
add eax, 4
mov ecx, dword [ebp - 4]
add ecx, 0xc
mov edx, dword [ecx]
push edx
mov dword [ebp - 0x18], eax
call fcn.00406b01
add esp, 4
mov ecx, dword [ebp - 0x18]
mov dword [ecx], eax
mov eax, dword [ebp - 4]
add eax, 8
mov ecx, dword [ebp - 4]
add ecx, 4
mov edx, dword [ecx]
inc edx
push edx
mov dword [ebp - 0x1c], eax
call fcn.004097ab
add esp, 4
mov ecx, dword [ebp - 0x1c]
mov dword [ecx], eax
mov eax, dword [ebp - 4]
add eax, 0x18
mov ecx, dword [ebp - 4]
add ecx, 8
mov edx, dword [ecx]
mov dword [eax], edx
mov eax, dword [ebp - 4]
add eax, 8
mov ecx, dword [ebp - 4]
add ecx, 4
mov edx, dword [ebp - 4]
add edx, 0xc
mov dword [ebp - 0x20], eax
mov eax, dword [edx]
push eax
mov eax, dword [ecx]
push eax
mov eax, 1
push eax
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
push eax
call sub.msvcrt.dll_fread
add esp, 0x10
mov ecx, dword [ebp - 4]
add ecx, 4
mov edx, dword [ecx]
cmp eax, edx
je 0x404192
mov eax, dword [str.Error_reading_input_file]
push eax
call fcn.00409a13
add esp, 4
mov eax, 0
jmp 0x4042b0
mov eax, dword [ebp - 4]
add eax, 8
mov ecx, dword [ebp - 4]
add ecx, 4
mov edx, dword [ecx]
mov ecx, dword [eax]
add ecx, edx
mov eax, 0
mov byte [ecx], al
mov eax, dword [ebp - 4]
add eax, 0x10
movsx ecx, byte [0x410474]
mov byte [eax], cl
mov eax, dword [ebp - 4]
add eax, 0x28
mov ecx, 0x40c020
push ecx
push eax
call sub.msvcrt.dll_strcpy
add esp, 8
mov eax, dword [ebp - 4]
add eax, 0x14
mov ecx, 0
mov dword [eax], ecx
mov eax, dword [ebp - 4]
add eax, 0xc
mov ecx, dword [eax]
push ecx
call sub.msvcrt.dll_fclose
add esp, 4
mov eax, dword [0x410470]
add eax, 0x4c
mov dword [0x410470], eax
mov eax, dword [ebp + 8]
push eax
call sub.msvcrt.dll_strlen
add esp, 4
inc eax
mov ecx, dword [0x410470]
add ecx, eax
mov dword [0x410470], ecx
mov eax, dword [ebp - 4]
add eax, 4
mov ecx, dword [eax]
inc ecx
mov eax, dword [0x410470]
add eax, ecx
mov dword [0x410470], eax
mov eax, dword [ebp + 8]
push eax
call fcn.00405c49
movzx eax, al
add esp, 4
mov byte [ebp - 9], al
movzx eax, byte [ebp - 9]
shl eax, 2
mov ecx, 0x410040
add ecx, eax
mov eax, dword [ecx]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 8]
cmp eax, 0
jne 0x40427a
movzx eax, byte [ebp - 9]
shl eax, 2
mov ecx, 0x410040
add ecx, eax
mov eax, dword [ebp - 4]
mov dword [ecx], eax
mov eax, dword [ebp - 4]
jmp 0x4042b0
mov eax, dword [ebp - 8]
add eax, 0x14
mov ecx, dword [eax]
cmp ecx, 0
je 0x40429b
mov eax, dword [ebp - 8]
add eax, 0x14
mov ecx, dword [eax]
mov dword [ebp - 8], ecx
jmp 0x4042ae
mov eax, dword [ebp - 8]
add eax, 0x14
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp - 4]
jmp 0x4042b0
jmp 0x40427a
leave
ret