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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x4f92a0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x4fd858
mov dword [0x4fd850], 0x4d39d8
mov dword [0x4fd854], 0x4d39c8
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x4fa44c]
mov edx, dword [eax + 0xc]
xor esi, esi
mov ecx, 0x4fa44c
mov dword [0x4fd870], esi
mov dword [0x4fd874], esi
mov dword [0x4fd878], esi
call edx
add eax, 0x10
push 0x206
mov dword [0x4fd880], eax
lea ecx, [ebp - 0x20a]
xor eax, eax
push esi
push ecx
mov dword [0x4fd884], 1
mov word [ebp - 0x20c], ax
call fcn.00438230
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 0x4037f0
mov cx, word [eax]
add eax, 2
cmp cx, si
jne 0x4037f0
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 0x40381d
dec eax
jmp 0x403810
inc eax
cmp eax, edx
ja 0x403843
lea ecx, [ebp - 0x20c]
jmp 0x403830
mov di, word [ebp + eax*2 - 0x20c]
mov word [ecx], di
inc eax
add ecx, 2
cmp eax, edx
jbe 0x403830
push 0x4d3884
push esi
call fcn.004301f6
mov eax, dword [0x4fa44c]
mov edx, dword [eax + 0xc]
add esp, 8
mov ecx, 0x4fa44c
call edx
add eax, 0x10
push 0x208
mov dword [ebp - 0x620], eax
lea eax, [ebp - 0x414]
push esi
push eax
call fcn.00438230
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x414]
push ecx
push 0x4d3888
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.00403d60
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 [0x4fd494], eax
call fcn.00403d60
mov edx, dword [ebp - 0x620]
add esp, 8
push edx
call esi
mov dword [0x4fd4a0], eax
lea eax, [ebp - 0x414]
push eax
push str._sGamePPSdk_app.ext.log.on
call fcn.00403d60
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 [0x4fd498], eax
call fcn.00403d60
mov ebx, dword [ebp - 0x620]
add esp, 8
push ebx
call esi
push 0x208
mov dword [0x4fd49c], eax
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.00438230
add esp, 0xc
lea ecx, [ebp - 0x620]
push ecx
push 0x403710
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, 0x4fd880
call fcn.00403d60
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 0x4039ca
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, 0x4fd850
call fcn.0042e257
mov esp, ebp
pop ebp
ret