Function at 0x1005840
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push edi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 7
push 0x120089
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x1005871
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1005b65
push esi
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
jne 0x1005893
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1005b64
push 4
push 0x1000
lea eax, [esi + esi + 2]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
mov dword [ebp - 0x10], eax
je 0x10058ff
push 0
lea ecx, [ebp - 0x14]
push ecx
push esi
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1005907
cmp dword [ebp - 0x14], esi
je 0x10058cb
push 0x26
pop ebx
jmp 0x10058ed
mov eax, dword [ebp + 0xc]
add eax, 4
push eax
xor ebx, ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileTime]
test eax, eax
jne 0x10058e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
je 0x1005907
push 0x8000
push 0
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x1005907
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x1005919
mov eax, ebx
jmp 0x1005b64
mov ebx, dword [ebp - 0x10]
push 0
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_IsTextUnicode]
test eax, eax
jne 0x100594d
push esi
lea edi, [ebx + esi]
push ebx
push edi
call dword [sym.imp.msvcrt.dll_memmove]
add esp, 0xc
push esi
push ebx
push edi
call fcn.0100491e
test eax, eax
mov dword [ebp - 8], eax
jne 0x1005967
jmp 0x1005888
mov ax, word [ebx]
shr esi, 1
cmp ax, 0xfeff
mov dword [ebp - 8], esi
je 0x1005961
cmp ax, 0xfffe
jne 0x1005967
add ebx, 2
dec dword [ebp - 8]
mov edx, dword [ebp - 0x10]
xor ecx, ecx
cmp dword [ebp - 8], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 4], ecx
jbe 0x1005b3c
test ecx, ecx
jbe 0x1005a66
cmp word [ebx - 2], 0x5c
jne 0x1005a66
mov ax, word [ebx]
cmp ax, 0xd
je 0x10059a1
cmp ax, 0xa
jne 0x1005a66
lea eax, [edx - 2]
cmp word [eax], 0x5c
jne 0x10059b7
jmp 0x10059b5
lea eax, [edx - 2]
cmp word [eax], 0x20
ja 0x10059bc
mov edx, eax
cmp edx, dword [ebp - 0x10]
ja 0x10059ac
cmp word [edx], 0x20
jne 0x10059c4
inc edx
inc edx
xor esi, esi
cmp ecx, dword [ebp - 8]
jae 0x1005a2d
inc ecx
mov ax, word [ebx]
cmp ax, 0xa
jne 0x10059dd
inc dword [ebp - 4]
inc ecx
inc ebx
inc ebx
jmp 0x10059f8
cmp ax, 0xd
jne 0x1005a01
cmp ecx, dword [ebp - 8]
jae 0x1005a01
cmp word [ebx + 2], 0xa
jne 0x1005a01
add dword [ebp - 4], 2
inc ecx
inc ecx
add ebx, 4
mov eax, dword [ebp - 8]
inc esi
cmp dword [ebp - 4], eax
jb 0x10059cc
cmp esi, 1
jbe 0x1005a2d
add dword [ebp - 0xc], esi
je 0x1005a55
mov ecx, dword [ebp - 0xc]
mov esi, ecx
shr ecx, 1
mov edi, edx
mov eax, 0xa000a
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov eax, esi
lea edx, [edx + eax*2]
dec dword [ebp - 0xc]
dec esi
jne 0x1005a25
jmp 0x1005a55
mov ecx, dword [ebp - 8]
inc dword [ebp - 0xc]
cmp dword [ebp - 4], ecx
jae 0x1005b20
mov ax, word [ebx]
cmp ax, 0x20
je 0x1005a4b
cmp ax, 9
jne 0x1005a55
inc dword [ebp - 4]
inc ebx
inc ebx
cmp dword [ebp - 4], ecx
jb 0x1005a3c
mov eax, dword [ebp - 8]
cmp dword [ebp - 4], eax
jae 0x1005b20
jmp 0x1005b14
mov ax, word [ebx]
cmp ax, 0xd
jne 0x1005a76
cmp word [ebx + 2], 0xa
je 0x1005a80
cmp ax, 0xa
jne 0x1005b09
mov edi, dword [ebp - 4]
jmp 0x1005a9a
mov ax, word [ebx]
cmp ax, 0xd
je 0x1005a94
cmp ax, 0xa
jne 0x1005a9f
inc edi
inc ebx
mov dword [ebp - 4], edi
inc ebx
cmp edi, dword [ebp - 8]
jb 0x1005a85
cmp edi, dword [ebp - 8]
mov eax, ebx
jae 0x1005acf
mov cx, word [eax]
cmp cx, 0x20
je 0x1005ab5
cmp cx, 9
jne 0x1005abd
inc edi
inc eax
inc eax
cmp edi, dword [ebp - 8]
jb 0x1005aa6
cmp edi, dword [ebp - 8]
jae 0x1005acf
cmp word [eax], 0xd
jne 0x1005acf
cmp word [eax + 2], 0xa
je 0x1005ad5
cmp word [eax], 0xa
jne 0x1005adc
mov ebx, eax
mov dword [ebp - 4], edi
jmp 0x1005a80
mov ecx, dword [ebp - 0xc]
test ecx, ecx
je 0x1005b00
mov esi, ecx
shr ecx, 1
mov edi, edx
mov eax, 0xa000a
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov eax, esi
lea edx, [edx + eax*2]
dec dword [ebp - 0xc]
dec esi
jne 0x1005afa
mov word [edx], 0xa
inc edx
inc edx
jmp 0x1005b14
inc ecx
mov word [edx], ax
inc edx
inc edx
inc ebx
mov dword [ebp - 4], ecx
inc ebx
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp - 8]
jb 0x100597b
mov esi, dword [ebp - 0xc]
test esi, esi
je 0x1005b3c
mov ecx, esi
shr ecx, 1
mov edi, edx
mov eax, 0xa000a
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
lea edx, [edx + esi*2]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
mov word [edx], 0xa
inc edx
inc edx
and word [edx], 0
mov dword [eax], ecx
mov ecx, dword [ebp - 0x10]
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], ecx
mov dword [eax + 0x18], 1
xor eax, eax
pop esi
pop edi
pop ebx
leave
ret 8