Function at 0x401855
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x34
mov dword [ebp - 0xc], 0
jmp 0x401a8d
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806740
mov eax, dword [eax]
mov dword [esp + 4], 0x4052ca
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4018ad
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806740
mov eax, dword [eax]
mov dword [esp], eax
call sym._perror
mov eax, 0xffffffff
jmp 0x401aa0
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806744
mov eax, dword [eax]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fseek
test eax, eax
je 0x4018f6
mov dword [esp], str.Could_not_seek
call sym._perror
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov eax, 0xffffffff
jmp 0x401aa0
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x80674c
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
jmp 0x401963
mov eax, dword [ebp - 0x10]
add eax, 0x406400
movzx edx, byte [eax]
movzx eax, byte [0x406026]
cmp dl, al
je 0x40195f
movzx eax, byte [0x406026]
movzx ebx, al
mov dword [esp], 2
mov eax, dword [dbg.__acrt_iob_func]
call eax
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Error:_Attempt_to_merge_over_non_empty____0x_02x__content_n
mov dword [esp], eax
call sym._fprintf
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov eax, 0xffffffff
jmp 0x401aa0
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x80674c
mov edx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806748
mov eax, dword [eax]
add edx, eax
mov eax, dword [ebp - 0x10]
cmp edx, eax
ja 0x401908
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806748
mov eax, dword [eax]
mov edx, dword [ebp - 0xc]
shl edx, 4
add edx, 0x80674c
mov edx, dword [edx]
lea ecx, [edx + 0x406400]
mov edx, dword [ebp - 0x14]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov dword [esp], ecx
call sym._fread
cmp eax, 1
je 0x4019e8
mov dword [esp], str.error_reading_merge_source
call sym._perror
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov eax, 0xffffffff
jmp 0x401aa0
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x80674c
mov edx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806748
mov eax, dword [eax]
add edx, eax
mov eax, dword [0x406020]
cmp edx, eax
jbe 0x401a2e
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x80674c
mov edx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806748
mov eax, dword [eax]
add eax, edx
mov dword [0x406020], eax
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x80674c
mov ebx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806744
mov ecx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806740
mov edx, dword [eax]
mov eax, dword [ebp - 0xc]
shl eax, 4
add eax, 0x806748
mov eax, dword [eax]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str.Merged__d_bytes_from__s:0x_06x_to_ROM:0x_06x_n
call sym._printf
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
add dword [ebp - 0xc], 1
mov eax, dword [0x806724]
cmp dword [ebp - 0xc], eax
jl 0x401868
mov eax, 0
add esp, 0x34
pop ebx
pop ebp
ret