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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x4fa2a0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x4ff0c8
mov dword [0x4ff0c0], 0x4d4c68
mov dword [0x4ff0c4], 0x4d4c58
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x4fb44c]
mov edx, dword [eax + 0xc]
xor esi, esi
mov ecx, 0x4fb44c
mov dword [0x4ff0e0], esi
mov dword [0x4ff0e4], esi
mov dword [0x4ff0e8], esi
call edx
add eax, 0x10
push 0x206
mov dword [0x4ff0f0], eax
lea ecx, [ebp - 0x20a]
xor eax, eax
push esi
push ecx
mov dword [0x4ff0f4], 1
mov word [ebp - 0x20c], ax
call fcn.00436f70
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 0x403870
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x403870
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 0x40389d
dec eax
jmp 0x403890
inc eax
cmp eax, edx
ja 0x4038c3
lea ecx, [ebp - 0x20c]
jmp 0x4038b0
mov di, word [ebp + eax*2 - 0x20c]
mov word [ecx], di
inc eax
add ecx, 2
cmp eax, edx
jbe 0x4038b0
push 0x4d4b14
push esi
call fcn.0042ef09
mov eax, dword [0x4fb44c]
mov edx, dword [eax + 0xc]
add esp, 8
mov ecx, 0x4fb44c
call edx
add eax, 0x10
push 0x208
mov dword [ebp - 0x620], eax
lea eax, [ebp - 0x414]
push esi
push eax
call fcn.00436f70
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x414]
push ecx
push 0x4d4b18
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.00403de0
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 [0x4fed2c], eax
call fcn.00403de0
mov edx, dword [ebp - 0x620]
add esp, 8
push edx
call esi
mov dword [0x4fed38], eax
lea eax, [ebp - 0x414]
push eax
push str._sGamePPSdk_app.ext.log.on
call fcn.00403de0
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 [0x4fed30], eax
call fcn.00403de0
mov ebx, dword [ebp - 0x620]
add esp, 8
push ebx
call esi
push 0x208
mov dword [0x4fed34], eax
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.00436f70
add esp, 0xc
lea ecx, [ebp - 0x620]
push ecx
push 0x403790
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, 0x4ff0f0
call fcn.00403de0
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 0x403a4a
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, 0x4ff0c0
call fcn.0042cf67
mov esp, ebp
pop ebp
ret