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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x620
mov eax, dword [0x5023a4]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x506534
mov dword [0x50652c], 0x4d9fec
mov dword [0x506530], 0x4d9ff4
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov dword [0x50654c], 0
mov dword [0x506550], 0
mov dword [0x506554], 0
call fcn.004031c0
test eax, eax
je 0x403cff
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [0x50655c], 1
push 0x208
mov dword [0x506558], eax
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x20c]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [ebp - 0x20c]
lea ecx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x403b20
sub edx, ecx
sar edx, 1
lea eax, [edx - 1]
cmp word [ebp + eax*2 - 0x20c], 0x5c
je 0x403b40
dec eax
jmp 0x403b32
inc eax
push esi
cmp eax, edx
ja 0x403b64
lea esi, [ebp - 0x20c]
nop dword [eax]
mov cx, word [ebp + eax*2 - 0x20c]
lea esi, [esi + 2]
inc eax
mov word [esi - 2], cx
cmp eax, edx
jbe 0x403b50
push 0x4d9eac
push 0
call fcn.004a3cdd
add esp, 8
call fcn.004031c0
test eax, eax
je 0x403cff
mov edx, dword [eax]
mov ecx, eax
push edi
call dword [edx + 0xc]
add eax, 0x10
push 0x208
mov dword [ebp - 0x620], eax
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.0049b560
add esp, 0xc
lea eax, [ebp - 0x414]
push 0x104
push eax
push 0x4d9eb0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x620]
push str._sGamePPSdk_app.log.on
push eax
call fcn.004040c0
mov edi, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
add esp, 0xc
push dword [ebp - 0x620]
call edi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x620]
push str._sGamePPSdk_app.log1.on
push eax
call fcn.004040c0
add esp, 0xc
push dword [ebp - 0x620]
call edi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x620]
push str._sGamePPSdk_app.ext.log.on
push eax
call fcn.004040c0
add esp, 0xc
push dword [ebp - 0x620]
call edi
lea eax, [ebp - 0x414]
push eax
lea eax, [ebp - 0x620]
push str._sGamePPSdk_app.dbg.on
push eax
call fcn.004040c0
mov esi, dword [ebp - 0x620]
add esp, 0xc
push esi
call edi
push 0x208
lea eax, [ebp - 0x61c]
push 0
push eax
call fcn.0049b560
add esp, 0xc
mov dword [ebp - 0x620], 0
lea eax, [ebp - 0x620]
push eax
push 0x403a30
push 6
call dword [sym.imp.KERNEL32.dll_GetModuleHandleExW]
push 0x104
lea eax, [ebp - 0x61c]
push eax
push dword [ebp - 0x620]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_K32GetModuleBaseNameW]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x414]
push eax
push str._sGamePPSdkLogs_s__s__d.log
push 0x506558
call fcn.004040c0
add esp, 0x18
add esi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [esi + 0xc], eax
dec eax
pop edi
test eax, eax
jg 0x403ceb
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 4]
mov eax, 0x50652c
xor ecx, ebp
pop esi
call fcn.0049765c
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00402f10
int3