Function at 0x412390
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0x38], ecx
cmp dword [ebp + 8], 0
jne 0x4123b6
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x38]
call fcn.00417c50
xor al, al
jmp 0x4126a0
mov ecx, dword [ebp - 0x38]
call fcn.00410de0
mov ecx, dword [ebp - 0x38]
add ecx, 4
call fcn.00414180
mov dword [ebp - 8], 0
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00513071
add esp, 0xc
mov ecx, dword [ebp + 8]
push ecx
call fcn.00512f82
add esp, 4
mov dword [ebp - 8], eax
push 0
push 0
mov edx, dword [ebp + 8]
push edx
call fcn.00513071
add esp, 0xc
cmp dword [ebp - 8], 0
jg 0x41241c
push 0
push 0
push 0
push 0xc
mov ecx, dword [ebp - 0x38]
call fcn.00417c50
xor al, al
jmp 0x4126a0
mov eax, dword [ebp - 8]
add eax, 1
push eax
call fcn.004c8580
add esp, 4
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x10]
mov byte [edx], 0
mov eax, dword [ebp + 8]
push eax
push 1
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x10]
push edx
call fcn.00512dd1
add esp, 0x10
cmp eax, 1
je 0x41247e
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp - 0x20]
push ecx
call fcn.005124eb
add esp, 4
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x38]
call fcn.00417c50
xor al, al
jmp 0x4126a0
cmp dword [ebp + 0xc], 3
je 0x4124a8
mov edx, dword [ebp - 0x10]
movzx eax, byte [edx]
cmp eax, 0xff
jne 0x4125da
mov ecx, dword [ebp - 0x10]
movzx edx, byte [ecx + 1]
cmp edx, 0xfe
jne 0x4125da
mov dword [ebp + 0xc], 0
mov eax, dword [ebp - 0x38]
mov byte [eax + 0x75], 1
mov eax, dword [ebp - 8]
cdq
sub eax, edx
sar eax, 1
add eax, 1
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004c8580
add esp, 4
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 8]
cdq
sub eax, edx
sar eax, 1
lea ecx, [eax + eax + 2]
push ecx
push 0
mov edx, dword [ebp - 0x18]
push edx
call fcn.00512af0
add esp, 0xc
mov eax, dword [ebp - 0x10]
movzx ecx, byte [eax]
cmp ecx, 0xff
jne 0x412536
mov edx, dword [ebp - 0x10]
movzx eax, byte [edx + 1]
cmp eax, 0xfe
jne 0x412536
mov ecx, dword [ebp - 8]
sub ecx, 2
push ecx
mov edx, dword [ebp - 0x10]
add edx, 2
push edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.00511ce0
add esp, 0xc
jmp 0x41254a
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov eax, dword [ebp - 0x18]
push eax
call fcn.00511ce0
add esp, 0xc
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x28], ecx
mov edx, dword [ebp - 0x28]
push edx
call fcn.005124eb
add esp, 4
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
mov eax, dword [ebp - 0x18]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 8]
add ecx, 1
push ecx
call fcn.004c8580
add esp, 4
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x2c]
mov dword [ebp - 0x10], edx
mov eax, dword [ebp - 8]
add eax, 1
push eax
push 0
mov ecx, dword [ebp - 0x10]
push ecx
call fcn.00512af0
add esp, 0xc
push 0
push 0
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x10]
push eax
push 0xffffffffffffffff
mov ecx, dword [ebp - 0x18]
push ecx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edx, dword [ebp - 0x18]
mov dword [ebp - 0x30], edx
mov eax, dword [ebp - 0x30]
push eax
call fcn.005124eb
add esp, 4
jmp 0x4125e1
mov ecx, dword [ebp - 0x38]
mov byte [ecx + 0x75], 0
mov edx, dword [ebp - 0x10]
mov dword [ebp - 4], edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0xc], eax
mov byte [ebp - 0x12], 0xd
mov byte [ebp - 0x11], 0xa
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 8]
mov byte [ecx], 0
mov edx, dword [ebp - 4]
movsx eax, byte [edx]
test eax, eax
je 0x41265f
mov ecx, dword [ebp - 4]
movsx edx, byte [ecx]
cmp edx, 0xd
jne 0x412641
mov eax, dword [ebp - 0xc]
mov byte [eax], 0xa
mov ecx, dword [ebp - 0xc]
add ecx, 1
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
movsx ecx, byte [eax]
cmp ecx, 0xa
jne 0x41263f
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
jmp 0x41265d
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
mov dl, byte [ecx]
mov byte [eax], dl
mov eax, dword [ebp - 0xc]
add eax, 1
mov dword [ebp - 0xc], eax
mov ecx, dword [ebp - 4]
add ecx, 1
mov dword [ebp - 4], ecx
jmp 0x4125fe
mov edx, dword [ebp - 0xc]
mov byte [edx], 0
mov eax, dword [ebp + 0xc]
push eax
push 0
mov ecx, dword [ebp - 0x10]
push ecx
mov edx, dword [ebp - 0x38]
mov eax, dword [edx]
mov ecx, dword [ebp - 0x38]
mov edx, dword [eax + 8]
call edx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
push ecx
call fcn.005124eb
add esp, 4
mov ecx, dword [ebp - 0x38]
call fcn.004145d0
movzx eax, al
neg eax
sbb eax, eax
add eax, 1
mov esp, ebp
pop ebp
ret 8