Function at 0x4f2900
Capabilities:
Check if file exists
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4fc68c
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xe94
push ebx
push ebp
push esi
mov dword [esp + 0x24], ecx
push edi
add ecx, 0x28
push 0x51b1ec
push ecx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov ebx, eax
add esp, 8
test ebx, ebx
mov dword [esp + 0x3c], ebx
je 0x4f2e62
mov edi, dword [sym.imp.MSVCRT.dll_fseek]
push 2
push 0
push ebx
call edi
push ebx
call dword [sym.imp.MSVCRT.dll_ftell]
push 0
push 0
push ebx
mov esi, eax
call edi
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push ebx
push 1
lea eax, [esp + 0x50]
push 4
push eax
mov dword [esp + 0x58], 0
call edi
mov eax, dword [esp + 0x58]
add esp, 0x2c
cmp eax, 1
je 0x4f2997
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
jmp 0x4f2e62
lea ecx, [esp + 0x290]
call fcn.004f2fb0
push ebx
push 1
lea ecx, [esp + 0x298]
push 0x414
push ecx
call edi
lea edi, [esi + 1]
push edi
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov ebp, eax
add esp, 0x14
test ebp, ebp
mov dword [esp + 0x38], ebp
jne 0x4f29dc
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
xor eax, eax
jmp 0x4f2e62
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebp
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push ebx
and ecx, 3
push esi
push 1
push ebp
rep stosb byte es:[edi], al
call dword [sym.imp.MSVCRT.dll_fread]
add esi, 0xfffffbe8
add esp, 0x10
cmp eax, esi
je 0x4f2a1f
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
push ebp
call fcn.004ba355
add esp, 8
xor eax, eax
jmp 0x4f2e62
mov eax, dword [0x529688]
mov ecx, ebp
shr ecx, 0x10
mov dword [esp + 0x14], eax
jne 0x4f2a42
mov eax, ebp
lea ecx, [esp + 0x14]
and eax, 0xffff
push eax
call fcn.004da050
jmp 0x4f2a76
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
xor edi, edi
cmp esi, edi
je 0x4f2a78
push esi
lea ecx, [esp + 0x18]
call fcn.004d7960
test eax, eax
je 0x4f2a78
mov edi, dword [esp + 0x14]
lea ecx, [esi + esi]
mov edx, ecx
mov esi, ebp
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor edi, edi
push edi
push 0x529994
lea ecx, [esp + 0x1c]
mov dword [esp + 0xeb4], edi
mov dword [esp + 0x38], edi
call fcn.00456830
mov esi, eax
mov dword [esp + 0x20], edi
mov word [esp + 0x6a4], di
mov ecx, 0x1ff
xor eax, eax
lea edi, [esp + 0x6a6]
rep stosd dword es:[edi], eax
test esi, esi
stosw word es:[edi], ax
jl 0x4f2e2e
mov dword [esp + 0x34], 0
jmp 0x4f2ac8
mov esi, dword [esp + 0x24]
mov eax, dword [esp + 0x30]
mov ecx, esi
sub ecx, eax
lea edx, [esp + 0x18]
push ecx
push eax
push edx
lea ecx, [esp + 0x20]
call fcn.004d91d0
mov edi, dword [sym.imp.MSVCRT.dll_wcslen]
push 0x529994
mov byte [esp + 0xeb0], 1
call edi
add eax, esi
add esp, 4
mov ecx, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x30], ecx
cmp ecx, dword [eax - 8]
jle 0x4f2b13
mov dword [esp + 0x24], 0xffffffff
jmp 0x4f2b3d
lea eax, [eax + ecx*2]
push 0x529994
push eax
call dword [sym.imp.MSVCRT.dll_wcsstr]
add esp, 8
test eax, eax
jne 0x4f2b33
mov dword [esp + 0x24], 0xffffffff
jmp 0x4f2b3d
sub eax, dword [esp + 0x14]
sar eax, 1
mov dword [esp + 0x24], eax
push 0
push 0x52998c
lea ecx, [esp + 0x20]
call fcn.00456830
mov esi, eax
lea eax, [esp + 0x10]
push esi
push 0
push eax
lea ecx, [esp + 0x24]
call fcn.004d91d0
push 0x52998c
mov byte [esp + 0xeb0], 2
call edi
add esp, 4
add esi, eax
mov ecx, 0
lea edx, [esp + 0x1c]
sets cl
dec ecx
and ecx, esi
push ecx
push esi
push edx
lea ecx, [esp + 0x24]
call fcn.004d91d0
push SysReAllocString
push 0
lea eax, [esp + 0x6ac]
push 0x400
push eax
mov byte [esp + 0xebc], 3
call fcn.004f2f40
test eax, eax
jl 0x4f2bd5
mov ecx, dword [esp + 0xeb4]
push SysReAllocString
push ecx
push 0
lea edx, [esp + 0x6b0]
push 0x400
push edx
call fcn.004f1fc0
mov eax, dword [esp + 0x10]
mov ebp, dword [eax - 8]
cmp ebp, 1
jl 0x4f2e7d
mov edx, dword [eax - 0xc]
lea ebx, [eax - 0xc]
mov ecx, 1
cmp edx, ecx
jg 0x4f2bf9
cmp dword [eax - 4], ecx
jge 0x4f2c38
cmp ebp, 1
jle 0x4f2c00
mov ecx, ebp
push ecx
lea ecx, [esp + 0x14]
call fcn.004d7960
test eax, eax
je 0x4f2c38
mov edi, dword [esp + 0x10]
lea ecx, [ebp + ebp + 2]
mov eax, ecx
lea esi, [ebx + 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x14]
mov dword [ecx - 8], ebp
call fcn.004d91a0
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x6a4]
push eax
push edx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov ecx, 0x93
xor eax, eax
lea edi, [esp + 0x44]
mov dword [esp + 0x40], 0
rep stosd dword es:[edi], eax
lea eax, [esp + 0x40]
lea ecx, [esp + 0x6a4]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileW]
test eax, eax
jne 0x4f2d1b
mov eax, dword [esp + 0x1c]
mov ecx, dword [0x52968c]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x4f2caa
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2cb0
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff4
push eax
call fcn.004ba355
add esp, 4
jmp 0x4f2cb0
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [esp + 0x10]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4f2cdb
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2cdb
mov edx, dword [esp + 0x10]
lea eax, [edx - 0xc]
push eax
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x18]
mov edx, dword [0x52968c]
mov byte [esp + 0xeac], 0
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4f2e1a
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2e1a
mov edx, dword [esp + 0x18]
lea eax, [edx - 0xc]
push eax
call fcn.004ba355
add esp, 4
jmp 0x4f2e1a
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
mov esi, dword [esp + 0x40]
not esi
shr esi, 4
and esi, 1
je 0x4f2d4c
mov edi, dword [esp + 0x28]
lea eax, [esp + 0x6a4]
push eax
mov ecx, edi
call fcn.004f27b0
test eax, eax
jne 0x4f2d50
jmp 0x4f2de7
mov edi, dword [esp + 0x28]
push 1
lea ecx, [esp + 0x20]
call fcn.004d7ab0
push eax
call dword [sym.imp.MSVCRT.dll__wtoi]
add esp, 4
lea ecx, [esp + 0x6a4]
mov dword [esp + 0x6a0], eax
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4f2de7
mov edx, dword [esp + 0x20]
mov eax, dword [edi + 0xc]
cmp edx, eax
jge 0x4f2de7
mov ebx, dword [esp + 0x34]
mov edx, dword [edi + 0x10]
mov eax, ebx
lea ecx, [edi + 0x828]
add eax, edx
mov edx, dword [esp + 0xeb4]
push edx
mov dword [eax], ecx
add eax, 0x181a
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
mov eax, dword [esp + 0x6a8]
add esp, 8
lea ecx, [esp + 0x10]
push eax
push esi
push 1
call fcn.004d7ab0
mov edx, dword [edi + 0x10]
mov ecx, ebx
push eax
add ecx, edx
call fcn.004f2030
mov ecx, dword [esp + 0x20]
inc ecx
add ebx, 0x3864
mov dword [esp + 0x20], ecx
mov dword [esp + 0x34], ebx
lea ecx, [esp + 0x1c]
mov byte [esp + 0xeac], 2
call fcn.004d79f0
lea ecx, [esp + 0x10]
mov byte [esp + 0xeac], 1
call fcn.004d79f0
lea ecx, [esp + 0x18]
mov byte [esp + 0xeac], 0
call fcn.004d79f0
mov eax, dword [esp + 0x24]
test eax, eax
jge 0x4f2ac4
mov ebx, dword [esp + 0x3c]
mov ebp, dword [esp + 0x38]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
push ebp
mov dword [eax + 0x18], ecx
call fcn.004ba355
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
lea ecx, [esp + 0x14]
mov dword [esp + 0xeac], 0xffffffff
call fcn.004d79f0
mov eax, 1
mov ecx, dword [esp + 0xea4]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0xea0
ret 4
mov ecx, dword [esp + 0x1c]
mov esi, dword [0x52968c]
lea edx, [ecx - 0xc]
cmp edx, esi
je 0x4f2eb4
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
add ecx, 0xfffffff4
push ecx
call esi
test eax, eax
jg 0x4f2eae
mov eax, dword [esp + 0x1c]
add eax, 0xfffffff4
push eax
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x10]
jmp 0x4f2eba
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4f2ee1
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2ee1
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x18]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4f2f0c
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2f0c
mov edx, dword [esp + 0x18]
add edx, 0xfffffff4
push edx
call fcn.004ba355
add esp, 4
mov eax, dword [esp + 0x14]
mov edx, dword [0x52968c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x4f2f37
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x4f2f37
mov edx, dword [esp + 0x14]
add edx, 0xfffffff4
push edx
call fcn.004ba355
add esp, 4
xor eax, eax
jmp 0x4f2e62