Function at 0x403860
Capabilities:
Check if file exists
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x4f2500]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x4f70d8
mov dword [0x4f70d0], 0x4cb7c8
mov dword [0x4f70d4], 0x4cb7b8
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x4f36ec]
mov edx, dword [eax + 0xc]
xor esi, esi
mov ecx, 0x4f36ec
mov dword [0x4f70f0], esi
mov dword [0x4f70f4], esi
mov dword [0x4f70f8], esi
call edx
add eax, 0x10
push 0x206
mov dword [0x4f7100], eax
lea ecx, [ebp - 0x20a]
xor eax, eax
push esi
push ecx
mov dword [0x4f7104], 1
mov word [ebp - 0x20c], ax
call fcn.004276b0
add esp, 0xc
push 0x104
lea edx, [ebp - 0x20c]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x20c]
lea edx, [eax + 2]
jmp 0x403910
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x403910
sub eax, edx
sar eax, 1
mov edx, eax
lea eax, [edx - 1]
mov ecx, 0x5c
lea esp, [esp]
cmp word [ebp + eax*2 - 0x20c], cx
je 0x40393d
dec eax
jmp 0x403930
inc eax
cmp eax, edx
ja 0x403963
lea ecx, [ebp - 0x20c]
jmp 0x403950
mov di, word [ebp + eax*2 - 0x20c]
mov word [ecx], di
inc eax
add ecx, 2
cmp eax, edx
jbe 0x403950
push 0x4cb450
push esi
call fcn.00424a5a
mov eax, dword [0x4f36ec]
mov edx, dword [eax + 0xc]
add esp, 8
mov ecx, 0x4f36ec
call edx
add eax, 0x10
push 0x208
mov dword [ebp - 0x620], eax
lea eax, [ebp - 0x414]
push esi
push eax
call fcn.004276b0
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x414]
push ecx
push 0x4cb454
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edx, [ebp - 0x414]
push edx
push str._sGamePPSdk_app.log.on
lea edi, [ebp - 0x620]
call fcn.00404650
mov eax, dword [ebp - 0x620]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 8
push eax
call esi
lea ecx, [ebp - 0x414]
push ecx
push str._sGamePPSdk_app.log1.on
mov dword [0x4f6d14], eax
call fcn.00404650
mov edx, dword [ebp - 0x620]
add esp, 8
push edx
call esi
mov dword [0x4f6d20], eax
lea eax, [ebp - 0x414]
push eax
push str._sGamePPSdk_app.ext.log.on
call fcn.00404650
mov ecx, dword [ebp - 0x620]
add esp, 8
push ecx
call esi
lea edx, [ebp - 0x414]
push edx
push str._sGamePPSdk_app.dbg.on
mov dword [0x4f6d18], eax
call fcn.00404650
mov ebx, dword [ebp - 0x620]
add esp, 8
push ebx
call esi
push 0x208
mov dword [0x4f6d1c], eax
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.004276b0
add esp, 0xc
lea ecx, [ebp - 0x620]
push ecx
push 0x403830
push 6
mov dword [ebp - 0x620], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleExW]
mov eax, dword [ebp - 0x620]
push 0x104
lea edx, [ebp - 0x61c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.PSAPI.DLL_GetModuleBaseNameW]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea ecx, [ebp - 0x61c]
push ecx
lea edx, [ebp - 0x20c]
push edx
lea eax, [ebp - 0x414]
push eax
push str._sGamePPSdkLogs_s__s__d.log
mov edi, 0x4f7100
call fcn.00404650
lea eax, [ebx - 0x10]
add esp, 0x14
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
pop edi
pop esi
pop ebx
test edx, edx
jg 0x403aea
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
mov eax, 0x4f70d0
call fcn.0042292e
mov esp, ebp
pop ebp
ret