Function at 0x402a54
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5a8
push edi
mov dword [ebp - 0x5a8], 0
mov al, byte [0x407528]
mov byte [ebp - 0x49c], al
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x49b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x104
lea ecx, [ebp - 0x49c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov dword [ebp - 0x5a4], eax
push 0
push 0x40752c
push 0x4070bc
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edx, dword [ebp - 0x5a4]
add edx, eax
mov dword [ebp - 0x5a4], edx
cmp dword [ebp - 0x5a4], 0
je 0x402d1c
mov eax, dword [ebp - 0x5a4]
add eax, 3
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
add esp, 4
mov dword [ebp - 0x10], eax
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 4], ecx
mov edx, dword [ebp - 4]
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0xc], 0
je 0x402d1c
lea eax, [ebp - 0x49c]
push eax
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push 0x4070c4
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0x10]
add ecx, eax
mov dword [ebp - 0x10], ecx
mov edx, dword [ebp - 0x5a4]
add edx, 1
push edx
mov eax, dword [ebp - 0x10]
push eax
push str.Path
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x402d0f
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x10], ecx
mov edx, 1
test edx, edx
je 0x402d0f
mov eax, dword [ebp - 0x10]
movsx ecx, byte [eax]
cmp ecx, 0x3b
je 0x402b75
mov edx, dword [ebp - 0x10]
movsx eax, byte [edx]
test eax, eax
jne 0x402cf0
mov ecx, dword [ebp - 0x10]
movsx edx, byte [ecx]
test edx, edx
jne 0x402b8b
mov dword [ebp - 0x5a8], 1
jmp 0x402b91
mov eax, dword [ebp - 0x10]
mov byte [eax], 0
push 0x118
push 0
lea ecx, [ebp - 0x128]
push ecx
call sub.MSVCRT.dll_memset
add esp, 0xc
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp - 4]
push eax
push 0x4070d0
lea ecx, [ebp - 0x5a0]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
mov dword [ebp - 0x128], 0x23
lea edx, [ebp - 0x128]
push edx
lea eax, [ebp - 0x5a0]
push eax
call dword [sym.imp.MSVCRT.dll__findfirst]
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x402bf3
jmp 0x402ccd
mov ecx, dword [ebp - 4]
push ecx
lea edx, [ebp - 0x398]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp + 0xc]
push eax
lea ecx, [ebp - 0x294]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x12c], edx
lea eax, [ebp - 0x398]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00402d23
add esp, 8
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x402c5b
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.MSVCRT.dll__findclose]
add esp, 4
mov eax, 1
jmp 0x402d1e
lea edx, [ebp - 0x128]
push edx
mov eax, dword [ebp - 8]
push eax
call dword [sym.imp.MSVCRT.dll__findnext]
add esp, 8
test eax, eax
jne 0x402cc0
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x294]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x398]
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.00402d23
add esp, 8
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x402cbe
mov ecx, dword [ebp - 8]
push ecx
call dword [sym.imp.MSVCRT.dll__findclose]
add esp, 4
mov eax, 1
jmp 0x402d1e
jmp 0x402c5b
mov edx, dword [ebp - 8]
push edx
call dword [sym.imp.MSVCRT.dll__findclose]
add esp, 4
mov eax, dword [ebp - 0x10]
add eax, 1
mov dword [ebp - 4], eax
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x402cf0
mov eax, 1
jmp 0x402d1e
cmp dword [ebp - 0x5a8], 0
je 0x402cfb
jmp 0x402d0f
mov eax, dword [ebp - 0x10]
push eax
call fcn.00402080
add esp, 4
mov dword [ebp - 0x10], eax
jmp 0x402b4f
mov ecx, dword [ebp - 0xc]
push ecx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret