Function at 0x4be5e0
Capabilities:
Access peb ldr_data
Check if file exists
Get file size
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x595aec
mov eax, dword fs:[0]
push eax
mov eax, 0x4220
call fcn.00515150
mov eax, dword [0x61e69c]
xor eax, esp
mov dword [esp + 0x4218], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x61e69c]
xor eax, esp
push eax
lea eax, [esp + 0x4234]
mov dword fs:[0], eax
mov eax, dword [esp + 0x4244]
xor ecx, ecx
push 0x206
push ecx
lea edx, [esp + 0x402e]
push edx
mov dword [esp + 0x30], eax
mov word [esp + 0x4030], cx
call fcn.004fe380
add esp, 0xc
push 0x208
lea eax, [esp + 0x4028]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [esp + 0x4024]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov edx, dword [0x6285c4]
mov eax, dword [edx + 0xc]
mov ecx, 0x6285c4
call eax
add eax, 0x10
mov dword [esp + 0x18], eax
push str.MobileInfo1.dat
lea ecx, [esp + 0x4028]
push ecx
push 0x5d7f74
lea edi, [esp + 0x24]
mov dword [esp + 0x4248], 0
call fcn.00407710
mov esi, dword [esp + 0x24]
add esp, 0xc
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4be6ea
lea eax, [esi - 0x10]
mov dword [esp + 0x423c], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x4be6e3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x4be93d
push 0
push 0x80
push 3
push 0
push 0
push bind
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x4be911
push 0
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 4
push 0x1000
push 4
mov ebx, eax
push 0
mov dword [esp + 0x3c], ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [sym.imp.KERNEL32.dll_VirtualFree]
mov edi, eax
mov edx, edi
lea esi, [esp + 0x30]
call fcn.0048f560
push 0
lea ecx, [esp + 0x20]
push ecx
push 4
push edi
push ebp
mov byte [esp + 0x4250], 1
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4be8f9
cmp dword [esp + 0x1c], 4
jne 0x4be8f9
mov edi, dword [edi]
cmp edi, 0x3fc8
je 0x4be799
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, esi
push edx
call fcn.0048f650
add esp, 4
lea ecx, [esp + 0x18]
call fcn.00406760
xor eax, eax
jmp 0x4be93d
add ebx, 0xfffffffc
mov edi, 4
cmp ebx, 0x3fc8
jb 0x4be8f9
push 0
push 0
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp edi, eax
jne 0x4be967
lea eax, [esp + 0x5c]
call fcn.0041a520
push 4
push 0x1000
push 0x3fc8
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 0
mov esi, eax
lea eax, [esp + 0x20]
push eax
push 0x3fc8
push esi
push ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4be978
cmp dword [esp + 0x1c], 0x3fc8
jne 0x4be978
push 0x3fc8
lea ecx, [esp + 0x60]
push esi
push ecx
call fcn.00500790
add esp, 0xc
push 0
call fcn.004f8fbf
add esp, 4
sub eax, dword [esp + 0x396c]
sbb edx, dword [esp + 0x3970]
mov dword [esp + 0x48], edx
js 0x4be84f
jg 0x4be844
cmp eax, 0x15180
jb 0x4be84f
add edi, 0x3fc8
jmp 0x4be8e7
lea eax, [esp + 0x9c]
add edi, 0x3fc8
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4be860
sub eax, edx
sar eax, 1
lea ecx, [esp + 0x5c]
je 0x4be8b1
lea edx, [esp + 0x20]
push edx
call fcn.004066b0
mov ebx, dword [esp + 0x24]
push 0x3fc8
lea eax, [esp + 0x60]
push eax
lea ecx, [esp + 0x28]
push ecx
add ebx, 0x40
mov byte [esp + 0x4248], 2
call fcn.004c0840
push eax
call fcn.00500790
add esp, 0xc
lea ecx, [esp + 0x20]
jmp 0x4be8da
lea edx, [esp + 0x28]
push edx
call fcn.004066b0
mov ecx, dword [esp + 0x24]
lea eax, [esp + 0x28]
push eax
push ecx
lea ebx, [esp + 0x58]
mov byte [esp + 0x4244], 3
call fcn.0042ce60
lea ecx, [esp + 0x28]
mov byte [esp + 0x423c], 1
call fcn.00406760
mov edx, dword [esp + 0x2c]
sub edx, edi
cmp edx, 0x3fc8
jae 0x4be7ad
lea edx, [esp + 0x30]
push edx
call fcn.0048f650
add esp, 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [esp + 0x18]
lea eax, [esi - 0x10]
mov dword [esp + 0x423c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4be938
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x4234]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4218]
xor ecx, esp
call fcn.004f673f
add esp, 0x422c
ret 4
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x30]
push eax
jmp 0x4be781
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [esp + 0x30]
push ecx
jmp 0x4be781