Function at 0x1002c56
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2018
call fcn.01002fd0
mov eax, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 0x14]
push edi
xor edi, edi
mov dword [eax], edi
mov eax, dword [ebp + 0x10]
push 0x10018a4
push dword [ebp + 8]
mov dword [eax], edi
mov dword [ebp - 4], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 0x14], edi
mov dword [esi], edi
call dword [sym.imp.msvcrt.dll__wfopen]
cmp eax, edi
pop ecx
pop ecx
mov dword [ebp + 0x14], eax
jne 0x1002ca4
push 2
pop eax
jmp 0x1002e4b
mov edi, 0x10011b8
push dword [ebp + 0x14]
lea eax, [ebp - 0x2018]
push 0x1000
push eax
call dword [sym.imp.msvcrt.dll_fgetws]
add esp, 0xc
test eax, eax
je 0x1002dc2
push edi
call dword [sym.imp.msvcrt.dll_wcslen]
push eax
lea eax, [ebp - 0x2018]
push edi
push eax
call dword [sym.imp.msvcrt.dll_wcsncmp]
add esp, 0x10
test eax, eax
jne 0x1002ca9
push ebx
push esi
mov esi, dword [sym.imp.msvcrt.dll_fwscanf]
mov ebx, 0x100189c
push ebx
push dword [ebp + 0x14]
call esi
push dword [ebp + 0x14]
mov edi, dword [sym.imp.msvcrt.dll_fgetwc]
call edi
lea eax, [ebp - 4]
push eax
push 0x1001894
push dword [ebp + 0x14]
call esi
push dword [ebp + 0x14]
call edi
lea eax, [ebp - 0x14]
push eax
push ebx
push dword [ebp + 0x14]
call esi
push dword [ebp + 0x14]
call edi
mov eax, dword [ebp - 0x14]
add dword [ebp - 4], eax
lea eax, [ebp - 0xc]
push eax
push ebx
push dword [ebp + 0x14]
call esi
push dword [ebp + 0x14]
call edi
mov ebx, dword [ebp - 4]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
add esp, 0x40
lea ebx, [ebx + ebx + 4]
push ebx
push 8
call edi
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call esi
push ebx
push 8
pop ebx
push ebx
mov dword [ebp + 8], eax
call edi
push eax
call esi
cmp dword [ebp + 8], 0
mov esi, eax
je 0x1002e12
test esi, esi
je 0x1002e12
push dword [ebp + 0x14]
push dword [ebp - 4]
push 2
push dword [ebp + 8]
call dword [sym.imp.msvcrt.dll_fread]
mov ecx, dword [ebp - 4]
add esp, 0x10
cmp eax, ecx
je 0x1002da3
lea edx, [ecx - 1]
cmp eax, edx
je 0x1002da3
lea edx, [ecx - 2]
cmp eax, edx
jne 0x1002dfd
xor ebx, ebx
xor edx, edx
cmp ecx, ebx
jbe 0x1002de9
mov eax, dword [ebp + 8]
mov ax, word [eax + edx*2]
cmp ax, 0xd
je 0x1002de4
cmp ax, 0xa
jne 0x1002dcb
xor ecx, ecx
jmp 0x1002dce
mov dword [ebp - 8], 0xd
jmp 0x1002e3e
movzx ecx, ax
mov eax, dword [ebp - 0x10]
mov word [esi + eax*2], cx
mov ecx, dword [ebp - 4]
inc eax
mov dword [ebp - 0x10], eax
movzx eax, word [esi + eax*2 - 2]
xor dword [ebp - 0xc], eax
inc edx
cmp edx, ecx
jb 0x1002dab
mov eax, dword [ebp - 0x10]
mov word [esi + eax*2], bx
lea eax, [eax + eax + 2]
mov word [eax + esi], bx
cmp dword [ebp - 0xc], ebx
je 0x1002e06
mov dword [ebp - 8], 0xd
jmp 0x1002e15
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
mov eax, dword [ebp + 0x10]
mov dword [eax], esi
jmp 0x1002e15
mov dword [ebp - 8], ebx
test esi, esi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
je 0x1002e2d
cmp dword [ebp - 8], 0
je 0x1002e2d
push esi
push 0
call edi
push eax
call ebx
cmp dword [ebp + 8], 0
je 0x1002e3d
push dword [ebp + 8]
push 0
call edi
push eax
call ebx
pop ebx
push dword [ebp + 0x14]
call dword [sym.imp.msvcrt.dll_fclose]
mov eax, dword [ebp - 8]
pop ecx
pop edi
pop esi
leave
ret 0x10