Function at 0x100be650
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1012d3ad
mov eax, dword fs:[0]
push eax
sub esp, 0x1d8
mov eax, dword [0x10167c60]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x1d0], ecx
mov esi, dword [ebp + 0xc]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push esi
mov dword [ebp - 0x1c8], esi
mov dword [ebp - 0x1c0], 0
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x100beba8
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
test edi, edi
jle 0x100be702
lea esi, [edi + 8]
push esi
call fcn.100c4998
push esi
push 0
push eax
mov dword [ebp - 0x1c0], eax
call fcn.100e67c0
add esp, 0x10
lea eax, [ebp - 0x1e0]
push 0
push eax
push edi
push dword [ebp - 0x1c0]
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, dword [ebp - 0x1c8]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x1c0], 0
je 0x100beba8
test edi, edi
je 0x100beba8
push esi
lea ecx, [ebp - 0x1d4]
call fcn.100079a0
lea ecx, [ebp - 0x1c9]
mov dword [ebp - 4], 0
call fcn.100bcff0
mov ecx, eax
test ecx, ecx
jne 0x100be74e
mov dword [ebp - 0x1c4], 0xffffffff
jmp 0x100be790
mov eax, dword [ebp - 0x1d4]
cmp dword [eax - 0xc], 0
jge 0x100be766
mov dword [ebp - 0x1c4], 0xffffffff
jmp 0x100be790
push ecx
push eax
call fcn.100e6a12
mov ebx, eax
add esp, 8
test ebx, ebx
jne 0x100be782
mov dword [ebp - 0x1c4], 0xffffffff
jmp 0x100be790
sub ebx, dword [ebp - 0x1d4]
sar ebx, 1
mov dword [ebp - 0x1c4], ebx
mov edi, dword [ebp - 0x1c0]
push edi
call fcn.10097680
mov esi, eax
add esp, 4
mov dword [ebp - 0x1d8], esi
test esi, esi
je 0x100beb7a
mov dword [ebp - 0x1e4], esi
push esi
call fcn.100975a0
mov ecx, eax
add esp, 4
xor eax, eax
mov dword [ebp - 0x1dc], ecx
mov dword [ebp - 0x1c8], eax
test ecx, ecx
jle 0x100beb71
mov ebx, dword [ebp - 0x1d0]
nop dword [eax]
push eax
push esi
call fcn.10097580
mov edi, eax
add esp, 8
test edi, edi
je 0x100beb52
lea ecx, [ebp - 0xb8]
call fcn.100bca30
push 0x10130784
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 2
call fcn.10007a50
push 0x1013d964
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 3
call fcn.10007a50
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 4
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10098930
add esp, 0x10
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 5
jb 0x100be846
mov eax, dword [eax]
push 0
push eax
lea ecx, [ebp - 0x1bc]
call fcn.100078d0
mov edx, dword [eax]
mov ecx, edx
mov byte [ebp - 4], 6
lea esi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100be860
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0xb8]
call fcn.1000c9f0
mov eax, dword [ebp - 0x1bc]
lea ecx, [ebp - 0x1b8]
cmp eax, ecx
je 0x100be895
push eax
call fcn.100e9f68
add esp, 4
lea ecx, [ebp - 0x58]
call fcn.10007e60
lea ecx, [ebp - 0x28]
call fcn.10007e60
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 2
call fcn.10007e60
push 0x10130784
lea ecx, [ebp - 0x28]
call fcn.10007a50
push 0x101367dc
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 7
call fcn.10007a50
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 8
push eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10098930
add esp, 0x10
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 9
jb 0x100be8f4
mov eax, dword [eax]
push 0
push eax
lea ecx, [ebp - 0x1bc]
call fcn.100078d0
mov edx, dword [eax]
mov ecx, edx
mov byte [ebp - 4], 0xa
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100be910
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0xa0]
call fcn.1000c9f0
mov eax, dword [ebp - 0x1bc]
lea ecx, [ebp - 0x1b8]
cmp eax, ecx
je 0x100be945
push eax
call fcn.100e9f68
add esp, 4
lea ecx, [ebp - 0x58]
call fcn.10007e60
lea ecx, [ebp - 0x40]
call fcn.10007e60
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.10007e60
push 0x10130784
lea ecx, [ebp - 0x28]
call fcn.10007a50
push str.BUrl
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 0xb
call fcn.10007a50
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xc
push eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10098930
add esp, 0x10
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 0xd
jb 0x100be9a4
mov eax, dword [eax]
push 0
push eax
lea ecx, [ebp - 0x1bc]
call fcn.100078d0
mov edx, dword [eax]
mov ecx, edx
mov byte [ebp - 4], 0xe
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100be9c0
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x88]
call fcn.1000c9f0
mov eax, dword [ebp - 0x1bc]
lea ecx, [ebp - 0x1b8]
cmp eax, ecx
je 0x100be9f5
push eax
call fcn.100e9f68
add esp, 4
lea ecx, [ebp - 0x58]
call fcn.10007e60
lea ecx, [ebp - 0x40]
call fcn.10007e60
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.10007e60
push 0x10130784
lea ecx, [ebp - 0x28]
call fcn.10007a50
push str.SUrl
lea ecx, [ebp - 0x40]
mov byte [ebp - 4], 0xf
call fcn.10007a50
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0x10
push eax
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x58]
push edi
push eax
call fcn.10098930
add esp, 0x10
cmp dword [eax + 0x14], 0x10
mov byte [ebp - 4], 0x11
jb 0x100bea54
mov eax, dword [eax]
push 0
push eax
lea ecx, [ebp - 0x1bc]
call fcn.100078d0
mov edx, dword [eax]
mov ecx, edx
mov byte [ebp - 4], 0x12
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100bea70
sub ecx, esi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x70]
call fcn.1000c9f0
mov eax, dword [ebp - 0x1bc]
lea ecx, [ebp - 0x1b8]
cmp eax, ecx
je 0x100beaa2
push eax
call fcn.100e9f68
add esp, 4
lea ecx, [ebp - 0x58]
call fcn.10007e60
lea ecx, [ebp - 0x40]
call fcn.10007e60
lea ecx, [ebp - 0x28]
mov byte [ebp - 4], 2
call fcn.10007e60
mov esi, dword [ebp + 8]
cmp esi, 1
jne 0x100beaf3
cmp dword [ebp - 0x1c4], 0xffffffff
je 0x100beaee
mov ecx, dword [ebp - 0x1d0]
push esi
lea eax, [ecx + 0x28]
push eax
lea eax, [ebp - 0xb8]
push eax
call fcn.100bd2e0
mov ebx, dword [ebp - 0x1d0]
jmp 0x100beb41
lea ecx, [ebx + 0x28]
jmp 0x100beb35
cmp esi, 3
jne 0x100beb2d
cmp dword [ebp - 0x74], 8
lea eax, [ebp - 0x88]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmovae eax, dword [ebp - 0x88]
push eax
call esi
test eax, eax
je 0x100beb41
cmp dword [ebp - 0x5c], 8
lea eax, [ebp - 0x70]
cmovae eax, dword [ebp - 0x70]
push eax
call esi
test eax, eax
je 0x100beb41
lea ecx, [ebx + 0x40]
jmp 0x100beb35
cmp esi, 2
jne 0x100beb41
lea ecx, [ebx + 8]
lea eax, [ebp - 0xb8]
push eax
call fcn.100bf3b0
lea ecx, [ebp - 0xb8]
call fcn.10068940
mov esi, dword [ebp - 0x1d8]
mov eax, dword [ebp - 0x1c8]
inc eax
mov dword [ebp - 0x1c8], eax
cmp eax, dword [ebp - 0x1dc]
jl 0x100be7e0
mov edi, dword [ebp - 0x1c0]
push esi
call fcn.10097510
add esp, 4
push edi
call fcn.100c49a1
mov edx, dword [ebp - 0x1d4]
add esp, 4
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x100beba8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.100c495f
mov esp, ebp
pop ebp
ret 8