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

Disassembly:
push 0x16c
mov eax, 0x10159926
call fcn.1012b6ae
mov esi, dword [ebp + 8]
xor ebx, ebx
push 8
mov dword [ebp - 0x158], ebx
call fcn.10010082
pop ecx
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocStringLen
push esi
test eax, eax
je 0x100501e4
call eax
jmp 0x100501ea
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x178], esi
mov dword [ebp - 4], ebx
cmp esi, 0xffffffff
je 0x100505be
push 0x28
call fcn.10010082
pop ecx
test eax, eax
je 0x10050216
lea ecx, [ebp - 0x170]
push ecx
push esi
call eax
jmp 0x10050224
lea eax, [ebp - 0x170]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x100505be
xor eax, eax
push 9
mov word [ebp - 0x64], ax
call fcn.10010082
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
pop ecx
push ebx
test eax, eax
je 0x10050257
lea ecx, [ebp - 0x158]
push ecx
push 2
lea ecx, [ebp - 0x64]
push ecx
push esi
call eax
jmp 0x10050267
lea eax, [ebp - 0x158]
push eax
push 2
lea eax, [ebp - 0x64]
push eax
push esi
call edi
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], 2
jne 0x100505be
mov eax, 0x5a4d
cmp word [ebp - 0x64], ax
jne 0x100505be
push 0xf
call fcn.10010082
pop ecx
push 1
push ebx
push 0xfffffffffffffffe
push esi
test eax, eax
je 0x100502a1
call eax
jmp 0x100502a7
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x100505be
push 9
call fcn.10010082
pop ecx
push ebx
test eax, eax
je 0x100502cf
lea ecx, [ebp - 0x158]
push ecx
push 0x40
lea ecx, [ebp - 0x64]
push ecx
push esi
call eax
jmp 0x100502df
lea eax, [ebp - 0x158]
push eax
push 0x40
lea eax, [ebp - 0x64]
push eax
push esi
call edi
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], 0x40
jne 0x100505be
mov edi, dword [ebp - 0x28]
lea eax, [edi + 4]
cmp ebx, dword [ebp - 0x16c]
jg 0x100505be
jl 0x10050314
cmp eax, dword [ebp - 0x170]
ja 0x100505be
push 0xf
call fcn.10010082
pop ecx
push ebx
push ebx
push edi
push esi
test eax, eax
je 0x10050328
call eax
jmp 0x1005032e
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x100505be
push 9
call fcn.10010082
pop ecx
push ebx
test eax, eax
je 0x10050359
lea ecx, [ebp - 0x158]
push ecx
push 4
lea ecx, [ebp - 0x164]
push ecx
push esi
call eax
jmp 0x10050370
lea eax, [ebp - 0x158]
push eax
push 4
lea eax, [ebp - 0x164]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], 4
jne 0x100505be
push 9
call fcn.10010082
pop ecx
push ebx
test eax, eax
je 0x100503a4
lea ecx, [ebp - 0x158]
push ecx
push 0x14
lea ecx, [ebp - 0x24]
push ecx
push esi
call eax
jmp 0x100503b8
lea eax, [ebp - 0x158]
push eax
push 0x14
lea eax, [ebp - 0x24]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], 0x14
jne 0x100505be
mov ax, word [ebp - 0x24]
mov ecx, 0x8664
cmp ax, cx
jne 0x100503ea
call fcn.1012998f
cmp dword [eax + 4], 0
jne 0x10050407
mov ax, word [ebp - 0x24]
mov ecx, 0x14c
cmp ax, cx
jne 0x100505be
call fcn.1012998f
cmp dword [eax + 4], 0
jne 0x100505be
push 9
call fcn.10010082
pop ecx
push ebx
test eax, eax
je 0x10050429
lea ecx, [ebp - 0x158]
push ecx
push 2
lea ecx, [ebp - 0x15c]
push ecx
push esi
call eax
jmp 0x10050440
lea eax, [ebp - 0x158]
push eax
push 2
lea eax, [ebp - 0x15c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], 2
jne 0x100505be
mov ecx, 0x10b
mov eax, 0x20b
mov dword [ebp - 0x168], ecx
cmp word [ebp - 0x15c], cx
jne 0x10050473
lea eax, [ecx - 0x2b]
jmp 0x10050485
cmp word [ebp - 0x15c], ax
jne 0x100505be
mov eax, 0xf0
movzx edi, word [ebp - 0x14]
cmp edi, eax
jbe 0x1005048f
mov edi, eax
push 0xf
call fcn.10010082
pop ecx
push 1
push ebx
push 0xfffffffffffffffe
push esi
test eax, eax
je 0x100504a5
call eax
jmp 0x100504ab
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x100505be
push 9
call fcn.10010082
pop ecx
push ebx
test eax, eax
je 0x100504d5
lea ecx, [ebp - 0x158]
push ecx
push edi
lea ecx, [ebp - 0x154]
push ecx
push esi
call eax
jmp 0x100504eb
lea eax, [ebp - 0x158]
push eax
push edi
lea eax, [ebp - 0x154]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100505be
cmp dword [ebp - 0x158], edi
jne 0x100505be
mov ax, word [ebp - 0x15c]
mov ecx, 0x10b
mov edi, 0x20b
cmp ax, cx
je 0x1005051e
cmp ax, di
jne 0x100505be
movzx ecx, word [ebp - 0x110]
cmp ecx, 1
jne 0x100505be
movzx ecx, word [ebp - 0x22]
movzx edx, word [ebp - 0x14]
mov dword [ebp - 0x160], ebx
cmp ax, word [ebp - 0x168]
jne 0x10050572
mov eax, dword [ebp - 0x28]
add edx, 0x18
mov edi, dword [ebp - 0x144]
add eax, edx
push eax
push ecx
lea eax, [ebp - 0x160]
push eax
push 2
push 0x1021bd90
lea eax, [ebp - 0x154]
push eax
push esi
call fcn.10048395
jmp 0x100505a2
cmp ax, di
jne 0x100505be
mov eax, dword [ebp - 0x28]
add edx, 0x18
mov edi, dword [ebp - 0x144]
add eax, edx
push eax
push ecx
lea eax, [ebp - 0x160]
push eax
push 2
push 0x1021bd90
lea eax, [ebp - 0x154]
push eax
push esi
call fcn.1004819a
add esp, 0x1c
cmp dword [ebp - 0x160], 0
je 0x100505b7
xor ebx, ebx
test eax, eax
sete bl
jmp 0x100505be
test edi, edi
je 0x100505be
xor ebx, ebx
inc ebx
or dword [ebp - 4], 0xffffffff
test esi, esi
je 0x100505cd
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, ebx
call fcn.1012b658
ret