Function at 0x417710
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41f507
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x428004]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov dword [ebp - 0x1c], edi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x20], 0
test esi, esi
je 0x417759
mov dword [esi + 4], 0
mov dword [esi + 8], 0
push 0x4216a0
push edx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll__wfopen]
mov ebx, eax
add esp, 8
mov dword [ebp - 0x14], ebx
test ebx, ebx
jne 0x4177a1
test esi, esi
je 0x41777b
mov dword [esi], 0xa
mov eax, dword [0x4289c8]
mov dword [edi], eax
test eax, eax
je 0x41795c
inc dword [eax + 0x30]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 2
push 0
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_ftell]
add esp, 0x10
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x4177f7
test esi, esi
je 0x4177c7
mov dword [esi], 3
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [0x4289c8]
add esp, 4
mov dword [edi], eax
test eax, eax
je 0x41795c
inc dword [eax + 0x30]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
mov eax, dword [ebp - 0x10]
add eax, 4
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
push dword [ebp - 0x14]
mov ebx, eax
push dword [ebp - 0x10]
push 1
push ebx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push dword [ebp - 0x14]
mov dword [ebp - 0x10], eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov eax, dword [ebp - 0x10]
add esp, 0x24
cmp byte [0x428022], 0
mov dword [ebx + eax], 0
je 0x417880
push 0
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_IsTextUnicode]
test al, al
jne 0x417903
mov al, byte [ebx]
cmp al, 0xef
jne 0x4178ba
cmp byte [ebx + 1], 0xbb
jne 0x4178ba
cmp byte [ebx + 2], 0xbf
jne 0x4178ba
lea ecx, [ebx + 3]
call fcn.00415840
mov esi, eax
mov eax, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call eax
mov ebx, esi
add esp, 4
mov esi, dword [ebp + 0xc]
xor eax, eax
test ebx, ebx
jne 0x41791f
test esi, esi
je 0x417894
mov dword [esi], 0xe
mov eax, dword [0x4289c8]
mov dword [edi], eax
test eax, eax
je 0x41795c
inc dword [eax + 0x30]
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp al, 0xfe
jne 0x4178fc
cmp byte [ebx + 1], 0xff
lea edx, [ebx + 1]
jne 0x4178fc
mov ecx, dword [ebp - 0x10]
mov eax, 2
mov dword [ebp - 0x18], eax
test ecx, ecx
jle 0x417882
lea eax, [ecx - 1]
shr eax, 1
inc eax
mov esi, eax
mov edi, edi
mov cl, byte [edx - 1]
lea edx, [edx + 2]
mov al, byte [edx - 2]
mov byte [edx - 3], al
mov byte [edx - 2], cl
sub esi, 1
jne 0x4178e0
mov esi, dword [ebp + 0xc]
mov eax, dword [ebp - 0x18]
jmp 0x417882
mov ecx, ebx
jmp 0x417869
cmp byte [ebx], 0xff
jne 0x417880
xor eax, eax
mov ecx, 2
cmp byte [ebx + 1], 0xfe
cmove eax, ecx
jmp 0x417882
push esi
push dword [ebp + 8]
lea edx, [ebx + eax]
lea ecx, [ebp + 0xc]
call fcn.00417460
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp + 0xc]
add esp, 0xc
mov dword [edi], eax
test eax, eax
je 0x417944
inc dword [eax + 0x30]
mov dword [ebp - 4], 0
test eax, eax
je 0x41795c
dec dword [eax + 0x30]
lea ecx, [ebp + 0xc]
push 0
call fcn.004180e0
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret