Function at 0x409970
Capabilities:
Check if file exists
Get file attributes
Get session user name
Link many functions at runtime
Query environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x2810
call fcn.00415140
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi], 0
je 0x409cc8
push 0x1000
lea eax, [ebp - 0x280c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov esi, dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
je 0x409a80
push str..local
lea eax, [ebp - 0x280c]
push 0x1000
push eax
call fcn.0041b11d
mov ebx, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
lea eax, [ebp - 0x280c]
add esp, 0xc
push eax
call ebx
cmp eax, 0xffffffff
jne 0x409a80
push 0x1000
lea eax, [ebp - 0x280c]
push eax
push str.ProgramFiles
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x409a2c
push str.Debugging_Tools_for_Windowsdbghelp.dll
lea eax, [ebp - 0x280c]
push 0x1000
push eax
call fcn.0041b11d
add esp, 0xc
lea eax, [ebp - 0x280c]
push eax
call ebx
cmp eax, 0xffffffff
je 0x409a2c
lea eax, [ebp - 0x280c]
push eax
call esi
mov dword [edi + 4], eax
cmp dword [edi + 4], 0
jne 0x409a90
push 0x1000
lea eax, [ebp - 0x280c]
push eax
push str.ProgramFiles
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x409a80
push str.Debugging_Tools_for_Windows_64_Bitdbghelp.dll
lea eax, [ebp - 0x280c]
push 0x1000
push eax
call fcn.0041b11d
add esp, 0xc
lea eax, [ebp - 0x280c]
push eax
call ebx
cmp eax, 0xffffffff
je 0x409a80
lea eax, [ebp - 0x280c]
push eax
call esi
mov dword [edi + 4], eax
cmp dword [edi + 4], 0
jne 0x409a90
push str.dbghelp.dll
call esi
mov dword [edi + 4], eax
mov eax, dword [edi + 4]
test eax, eax
je 0x409cc8
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.SymInitialize
push eax
call esi
push str.SymCleanup
push dword [edi + 4]
mov dword [edi + 0x2c], eax
call esi
push str.StackWalk64
push dword [edi + 4]
mov dword [edi + 0x10], eax
call esi
push str.SymGetOptions
push dword [edi + 4]
mov dword [edi + 0x38], eax
call esi
push str.SymSetOptions
push dword [edi + 4]
mov dword [edi + 0x24], eax
call esi
push str.SymFunctionTableAccess64
push dword [edi + 4]
mov dword [edi + 0x34], eax
call esi
push str.SymGetLineFromAddr64
push dword [edi + 4]
mov dword [edi + 0x14], eax
call esi
push str.SymGetModuleBase64
push dword [edi + 4]
mov dword [edi + 0x18], eax
call esi
push str.SymGetModuleInfo64
push dword [edi + 4]
mov dword [edi + 0x1c], eax
call esi
push str.SymGetSymFromAddr64
push dword [edi + 4]
mov dword [edi + 0x20], eax
call esi
push str.UnDecorateSymbolName
push dword [edi + 4]
mov dword [edi + 0x28], eax
call esi
push str.SymLoadModule64
push dword [edi + 4]
mov dword [edi + 0x3c], eax
call esi
push str.SymGetSearchPath
push dword [edi + 4]
mov dword [edi + 0x30], eax
call esi
cmp dword [edi + 0x10], 0
mov dword [edi + 0x40], eax
je 0x409cb1
cmp dword [edi + 0x14], 0
je 0x409cb1
cmp dword [edi + 0x1c], 0
je 0x409cb1
cmp dword [edi + 0x20], 0
je 0x409cb1
cmp dword [edi + 0x24], 0
je 0x409cb1
cmp dword [edi + 0x28], 0
je 0x409cb1
cmp dword [edi + 0x2c], 0
je 0x409cb1
cmp dword [edi + 0x34], 0
je 0x409cb1
cmp dword [edi + 0x38], 0
je 0x409cb1
cmp dword [edi + 0x3c], 0
je 0x409cb1
cmp dword [edi + 0x30], 0
je 0x409cb1
mov eax, dword [ebp + 8]
test eax, eax
je 0x409bc9
push eax
call fcn.00422e3c
add esp, 4
mov dword [edi + 0xc], eax
mov eax, dword [edi + 0x2c]
push 0
push dword [edi + 0xc]
push dword [edi + 8]
call eax
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x409bf5
mov eax, dword [edi]
push 0
push 0
mov esi, dword [eax]
call ebx
mov ecx, dword [edi]
push eax
push str.SymInitialize
call dword [esi + 0x10]
mov eax, dword [edi + 0x24]
call eax
or eax, 0x210
push eax
mov eax, dword [edi + 0x34]
call eax
push 0x3ff
mov dword [ebp + 8], eax
lea eax, [ebp - 0x80b]
push 0
push eax
mov byte [ebp - 0x80c], 0
call fcn.0040c070
mov ecx, dword [edi + 0x40]
add esp, 0xc
test ecx, ecx
je 0x409c56
push 0x400
lea eax, [ebp - 0x80c]
push eax
push dword [edi + 8]
call ecx
test eax, eax
jne 0x409c56
mov eax, dword [edi]
push 0
push 0
mov esi, dword [eax]
call ebx
mov ecx, dword [edi]
push eax
push str.SymGetSearchPath
call dword [esi + 0x10]
push 0x3ff
lea eax, [ebp - 0x40b]
mov byte [ebp - 0x40c], 0
push 0
push eax
call fcn.0040c070
add esp, 0xc
mov dword [ebp - 8], 0x400
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x40c]
push eax
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
mov ecx, dword [edi]
lea edx, [ebp - 0x40c]
push edx
push dword [ebp + 8]
lea edx, [ebp - 0x80c]
mov eax, dword [ecx]
push edx
call dword [eax + 4]
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push dword [edi + 4]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov dword [edi + 4], 0
mov dword [edi + 0x10], 0
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4