Function at 0x41384c
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [0x419010]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
xor edx, edx
push ebx
mov ebx, dword [ebp + 0xc]
inc edx
push esi
mov dword [ebp - 0x2c], eax
xor esi, esi
cmp byte [ecx + 0x13], 0
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x30], eax
mov eax, 0xfde9
push edi
mov dword [ebp - 0x20], ecx
je 0x41388e
mov eax, dword [ebp + 0x10]
shr eax, 1
sub eax, 3
mov dword [ebp - 0x1c], esi
jmp 0x4138a9
cmp word [ecx + 0x10], ax
mov eax, dword [ebp + 0x10]
jne 0x41389f
add eax, 0xfffffffd
mov dword [ebp - 0x1c], edx
jmp 0x4138a9
shr eax, 1
dec eax
mov dword [ebp - 0x1c], 2
push dword [ecx + 0xc]
push eax
push edx
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov edi, eax
add esp, 0x10
test edi, edi
jne 0x4138c5
mov edi, esi
jmp 0x4139cb
cmp dword [ebp - 0x1c], 2
je 0x413924
mov cl, byte [ebx + edi - 1]
movzx eax, cl
movsx eax, byte [eax + 0x4014d8]
cmp byte [eax*8 + 0x4015d9], 1
ja 0x4138eb
and cl, 0xc0
cmp cl, 0x80
jne 0x413924
mov dword [ebp - 0x28], esi
mov eax, dword [ebp - 0x20]
push dword [eax + 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__getc_nolock]
pop ecx
mov dl, al
mov cl, dl
and cl, 0xc0
cmp cl, 0x80
jne 0x413919
mov eax, dword [ebp - 0x28]
mov byte [ebx + edi], dl
inc edi
inc eax
mov dword [ebp - 0x28], eax
cmp eax, 3
jl 0x4138ee
jmp 0x413957
mov eax, dword [ebp - 0x20]
push dword [eax + 0xc]
movsx eax, dl
jmp 0x41394e
cmp byte [ebx + edi - 1], 0xd
jne 0x413957
mov eax, dword [ebp - 0x20]
push dword [eax + 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__getc_nolock]
pop ecx
mov cl, al
cmp cl, 0xa
jne 0x413945
mov byte [ebx + edi], al
inc edi
jmp 0x413957
mov eax, dword [ebp - 0x20]
push dword [eax + 0xc]
movzx eax, cl
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__ungetc_nolock]
pop ecx
pop ecx
mov eax, dword [ebp - 0x1c]
test eax, eax
jne 0x4139ee
lea eax, [ebx + edi]
mov edx, esi
mov dword [ebp - 0x28], eax
mov ecx, ebx
cmp ebx, eax
jae 0x4139c9
mov al, byte [ecx]
test al, al
je 0x4139e6
cmp al, 0x7f
jbe 0x4139ae
movzx eax, al
inc edx
mov dword [ebp - 0x1c], edx
movsx eax, byte [eax + 0x4014d8]
movzx edx, byte [eax*8 + 0x4015d9]
sub edx, 1
je 0x4139e6
lea eax, [edx + ecx]
cmp eax, dword [ebp - 0x28]
jae 0x4139e6
inc ecx
mov al, byte [ecx]
and al, 0xc0
cmp al, 0x80
jne 0x4139e6
sub edx, 1
jne 0x41399d
mov edx, dword [ebp - 0x1c]
inc ecx
lea eax, [ebx + edi]
cmp ecx, eax
jb 0x413970
test edx, edx
je 0x4139c9
mov eax, dword [ebp - 0x20]
mov ecx, 0xfde9
mov dword [eax + 0x10], esi
mov word [eax + 0x10], cx
mov esi, edi
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov dword [eax], edi
mov eax, dword [ebp - 0x30]
pop edi
mov dword [eax], esi
pop esi
pop ebx
call fcn.00414c9a
leave
ret 0x14
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x10], esi
jmp 0x4139f3
cmp eax, 2
jne 0x4139c9
lea eax, [ebp - 0x18]
push eax
lea esi, [ebx + edi]
call fcn.00412d03
push eax
call dword [sym.imp.KERNEL32.dll_GetCPInfo]
cmp dword [ebp - 0x18], 1
jne 0x413a21
lea ecx, [ebx + edi]
mov esi, ebx
cmp ebx, ecx
je 0x413a94
cmp byte [esi], 0
jl 0x413a94
inc esi
cmp esi, ecx
jne 0x413a15
jmp 0x413a94
cmp dword [ebp - 0x18], 2
jne 0x413a94
lea ecx, [ebx + edi]
lea edx, [ecx - 1]
mov dword [ebp - 0x1c], edx
cmp edx, ebx
jb 0x413a51
movsx eax, byte [edx]
push eax
call dword [sym.imp.api_ms_win_crt_multibyte_l1_1_0.dll__ismbblead]
mov edx, dword [ebp - 0x1c]
pop ecx
test eax, eax
je 0x413a4e
dec edx
mov dword [ebp - 0x1c], edx
cmp edx, ebx
jae 0x413a34
lea ecx, [ebx + edi]
mov al, cl
sub al, dl
dec al
and al, 1
mov byte [ebp - 0x21], al
lea eax, [ecx - 1]
cmp edx, eax
jne 0x413a79
mov eax, ebx
cmp ebx, ecx
jae 0x413a7b
cmp byte [eax], 0
jl 0x413a75
inc eax
cmp eax, ecx
jb 0x413a69
jmp 0x413a7b
mov esi, eax
jmp 0x413a7b
mov esi, ebx
cmp byte [ebp - 0x21], 0
je 0x413a94
mov eax, dword [ebp - 0x20]
push dword [eax + 0xc]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__getc_nolock]
pop ecx
lea ecx, [ebx + edi]
inc edi
mov byte [ecx], al
mov ecx, esi
lea eax, [ebx + edi]
sub ecx, ebx
mov dword [ebp - 0x28], ecx
cmp esi, eax
je 0x4139c9
mov ebx, edi
sub ebx, ecx
lea eax, [ebx + 4]
add eax, eax
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
pop ecx
lea ecx, [ebx + 4]
mov dword [ebp - 0x1c], eax
push ecx
push eax
push ebx
push esi
push 8
call fcn.00412d03
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
test eax, eax
jne 0x413af0
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [ebx + 4]
push eax
push dword [ebp - 0x1c]
push ebx
push esi
push 0
call fcn.00412d03
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, dword [ebp - 0x28]
lea edx, [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp + 0x10]
sub eax, ebx
push eax
push esi
call fcn.00404b85
push dword [ebp - 0x1c]
lea esi, [ebx + eax]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 0xc
jmp 0x4139cb