Function at 0x401690
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x424
mov eax, dword [0x403028]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
xor ebx, ebx
cmp edi, ebx
mov dword [ebp - 0x424], eax
mov dword [ebp - 0x420], edi
je 0x4018b3
cmp dword [ebp + 0x18], ebx
je 0x4018b3
cmp dword [ebp + 8], 2
jne 0x40176c
push 0x41
pop ecx
xor eax, eax
mov byte [ebp - 0x10c], bl
lea edi, [ebp - 0x10b]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x41c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push 0x105
lea eax, [ebp - 0x10c]
push eax
push 0x401258
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea eax, [ebp - 0x10c]
push eax
movzx eax, word [ebp - 0x40e]
push eax
movzx eax, word [ebp - 0x410]
push eax
movzx eax, word [ebp - 0x412]
push eax
movzx eax, word [ebp - 0x414]
push eax
movzx eax, word [ebp - 0x416]
push eax
movzx eax, word [ebp - 0x41a]
push eax
movzx eax, word [ebp - 0x41c]
push eax
mov eax, dword [ebp + 0x18]
push 0x4011d8
dec eax
push eax
push dword [ebp - 0x420]
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x2c
jmp 0x4018af
cmp dword [ebp + 8], 1
jne 0x401850
push 0x40
pop ecx
xor eax, eax
mov byte [ebp - 0x10c], bl
lea edi, [ebp - 0x10b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x104
lea eax, [ebp - 0x10c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push 0x7f
xor eax, eax
pop ecx
mov byte [ebp - 0x40c], bl
lea edi, [ebp - 0x40b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x3f
pop ecx
xor eax, eax
mov byte [ebp - 0x20c], bl
lea edi, [ebp - 0x20b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x40c]
push eax
push ebx
lea eax, [ebp - 0x10c]
push ebx
push eax
call dword [sym.imp.msvcrt.dll__splitpath]
add esp, 0x14
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x40c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcatA]
movzx eax, word [esi + 0xe]
push eax
movzx eax, word [esi + 0xc]
push eax
movzx eax, word [esi + 0xa]
push eax
movzx eax, word [esi + 8]
push eax
movzx eax, word [esi + 6]
push eax
movzx eax, word [esi + 2]
push eax
movzx eax, word [esi]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x40c]
push eax
push dword [ebp - 0x424]
mov eax, dword [ebp + 0x18]
push 0x401140
dec eax
push eax
push dword [ebp - 0x420]
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x34
jmp 0x4018af
cmp dword [ebp + 8], 3
jne 0x4018af
lea eax, [ebp - 0x41c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 0x40e]
push eax
movzx eax, word [ebp - 0x410]
push eax
movzx eax, word [ebp - 0x412]
push eax
movzx eax, word [ebp - 0x414]
push eax
movzx eax, word [ebp - 0x416]
push eax
movzx eax, word [ebp - 0x41a]
push eax
movzx eax, word [ebp - 0x41c]
push eax
mov eax, dword [ebp + 0x18]
push 0x4010b0
dec eax
push eax
push edi
call dword [sym.imp.msvcrt.dll__snprintf]
add esp, 0x28
xor eax, eax
jmp 0x4018b8
mov eax, 0x80004003
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.004025ea
leave
ret 0x14