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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
xor esi, esi
push esi
push 0x80
push 3
push esi
push 1
push SysReAllocString
push dword [ebp + 8]
mov dword [eax], esi
xor ebx, ebx
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x14], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
mov edi, 0x80070000
je 0x107ba1c
push esi
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, 0xffffffff
mov dword [ebp - 0xc], eax
jne 0x107ba38
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
jle 0x107ba2d
and eax, 0xffff
or eax, edi
mov ebx, eax
cmp ebx, esi
jl 0x107ba38
mov ebx, 0x80004005
cmp ebx, esi
mov byte [ebp + 0xb], 1
jl 0x107bd36
push 2
pop esi
cmp dword [ebp - 0xc], esi
jbe 0x107bb94
push 0
lea eax, [ebp - 0x14]
push eax
push esi
lea eax, [ebp - 8]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x107ba87
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x107ba7c
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
test ebx, ebx
jl 0x107ba87
mov ebx, 0x80004005
cmp dword [ebp - 0x14], esi
je 0x107ba91
mov ebx, 0x80004005
test ebx, ebx
jl 0x107bd36
cmp word [ebp - 8], 0xfeff
jne 0x107baad
sub dword [ebp - 0xc], esi
mov byte [ebp + 0xb], 0
jmp 0x107bb94
cmp dword [ebp - 0xc], 3
jbe 0x107bb5e
mov ecx, esi
mov edi, 0x1031984
lea esi, [ebp - 8]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x107bacc
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x107bb5e
xor esi, esi
push esi
lea eax, [ebp - 0x14]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x107bb0d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
jle 0x107bb02
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
cmp ebx, esi
jl 0x107bb0d
mov ebx, 0x80004005
cmp dword [ebp - 0x14], 1
je 0x107bb18
mov ebx, 0x80004005
cmp ebx, esi
jl 0x107bd36
cmp byte [ebp - 1], 0xbf
jne 0x107bb33
sub dword [ebp - 0xc], 3
mov dword [ebp + 0x14], 0xfde9
jmp 0x107bb94
push esi
push esi
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x107bb94
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, esi
jle 0x107bb58
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
cmp ebx, esi
jmp 0x107bb89
xor eax, eax
push eax
push eax
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x107bb94
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x107bb85
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
test ebx, ebx
jl 0x107bd36
mov ebx, 0x80004005
xor edi, edi
cmp ebx, edi
jl 0x107bd36
cmp byte [ebp + 0xb], 0
je 0x107bcbe
mov esi, dword [ebp - 0xc]
lea eax, [esi + 1]
push eax
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
cmp eax, edi
pop ecx
mov dword [ebp - 0xc], eax
jne 0x107bbc1
mov ebx, 0x8007000e
cmp ebx, edi
jl 0x107bd36
push edi
lea ecx, [ebp + 8]
push ecx
push esi
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x107bc00
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x107bbf1
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
cmp ebx, edi
jl 0x107bcb3
mov ebx, 0x80004005
cmp ebx, edi
jl 0x107bcb3
mov esi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
xor eax, eax
push eax
push eax
push dword [ebp + 8]
push dword [ebp - 0xc]
push eax
push dword [ebp + 0x14]
call esi
mov edi, eax
cmp edi, 0x7ffffffe
ja 0x107bc38
lea eax, [edi + 1]
push eax
call fcn.01079e6d
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
jmp 0x107bc3e
mov eax, dword [ebp + 0xc]
and dword [eax], 0
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
test eax, eax
jne 0x107bc4c
mov ebx, 0x8007000e
test ebx, ebx
jl 0x107bcb3
and dword [ebp - 8], 0
cmp dword [ebp + 8], 0
jbe 0x107bc8f
push edi
push eax
push dword [ebp + 8]
push dword [ebp - 0xc]
push 0
push dword [ebp + 0x14]
call esi
test eax, eax
mov dword [ebp - 8], eax
jne 0x107bc8f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x107bc84
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
test ebx, ebx
jl 0x107bcab
mov ebx, 0x80004005
test ebx, ebx
jl 0x107bcab
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
and word [eax + edi*2], 0
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x107bcb3
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
jmp 0x107bcb3
push dword [ebp + 0xc]
call fcn.01079ed3
push dword [ebp - 0xc]
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
jmp 0x107bd36
mov eax, dword [ebp - 0xc]
shr eax, 1
inc eax
push eax
call fcn.01079e6d
cmp eax, edi
mov esi, dword [ebp + 0xc]
mov dword [esi], eax
jne 0x107bcd8
mov ebx, 0x8007000e
cmp ebx, edi
jl 0x107bd36
push edi
lea ecx, [ebp + 0xc]
push ecx
push dword [ebp - 0xc]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x107bd11
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, edi
jle 0x107bd06
and eax, 0xffff
or eax, 0x80070000
mov ebx, eax
cmp ebx, edi
jl 0x107bd30
mov ebx, 0x80004005
cmp ebx, edi
jl 0x107bd30
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi]
shr eax, 1
mov word [ecx + eax*2], di
mov eax, dword [ebp + 0x10]
cmp eax, edi
je 0x107bd36
mov ecx, dword [ebp + 0xc]
shr ecx, 1
mov dword [eax], ecx
jmp 0x107bd36
push esi
call fcn.01079ed3
cmp dword [ebp - 0x10], 0xffffffff
je 0x107bd45
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret 0x10