Function at 0x467c40
Capabilities:
Get common file path
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x228
mov eax, dword [0x4f6840]
xor eax, ebp
mov dword [ebp - 4], eax
push edi
xor eax, eax
push 0x210
push eax
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push eax
call fcn.0046d9d0
add esp, 0xc
mov dword [ebp - 0x224], 0x212
lea eax, [ebp - 0x220]
push eax
push str.SoftwareSimonTathamPuTTY
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov edi, dword [ebp + 8]
test eax, eax
jne 0x467d0a
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x228]
push eax
push 0
push str.RandSeedFile
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x467ccf
cmp dword [ebp - 0x228], 1
je 0x467cd6
mov byte [ebp - 0x218], 0
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp byte [ebp - 0x218], 0
je 0x467d0a
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00468b90
add esp, 0xc
test eax, eax
jne 0x467f1d
cmp dword [0x4fa1ac], 0
jne 0x467d59
push str.shell32.dll
call fcn.004631b0
add esp, 4
mov dword [0x4fa1b0], eax
test eax, eax
je 0x467d46
push str.SHGetFolderPathA
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x4fa1b4], eax
mov dword [0x4fa1ac], 1
jmp 0x467d5e
xor eax, eax
mov dword [0x4fa1ac], 1
mov dword [0x4fa1b4], eax
jmp 0x467d5e
mov eax, dword [0x4fa1b4]
test eax, eax
je 0x467e3a
lea ecx, [ebp - 0x218]
push ecx
push 0
push 0
push 0x1c
push 0
call eax
test eax, eax
js 0x467dcc
lea ecx, [ebp - 0x218]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x467d82
mov eax, dword [str.PUTTY.RND]
mov dword [ecx], eax
mov eax, dword [0x4e7e20]
mov dword [ecx + 4], eax
mov ax, word [0x4e7e24]
mov word [ecx + 8], ax
mov al, byte [0x4e7e26]
mov byte [ecx + 0xa], al
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00468b90
add esp, 0xc
test eax, eax
jne 0x467f1d
lea eax, [ebp - 0x218]
push eax
push 0
push 0
push 0x1a
push 0
call dword [0x4fa1b4]
test eax, eax
js 0x467e3a
lea ecx, [ebp - 0x218]
dec ecx
nop dword [eax]
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x467df0
mov eax, dword [str.PUTTY.RND]
mov dword [ecx], eax
mov eax, dword [0x4e7e20]
mov dword [ecx + 4], eax
mov ax, word [0x4e7e24]
mov word [ecx + 8], ax
mov al, byte [0x4e7e26]
mov byte [ecx + 0xa], al
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00468b90
add esp, 0xc
test eax, eax
jne 0x467f1d
push 0x212
lea eax, [ebp - 0x218]
push eax
push str.HOMEDRIVE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov ecx, 0x212
sub ecx, eax
push ecx
lea ecx, [ebp - 0x218]
add eax, ecx
push eax
push str.HOMEPATH
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x467ebe
lea ecx, [ebp - 0x218]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x467e78
mov eax, dword [str.PUTTY.RND]
mov dword [ecx], eax
mov eax, dword [0x4e7e20]
mov dword [ecx + 4], eax
mov ax, word [0x4e7e24]
mov word [ecx + 8], ax
mov al, byte [0x4e7e26]
mov byte [ecx + 0xa], al
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00468b90
add esp, 0xc
test eax, eax
jne 0x467f1d
push 0x212
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
lea ecx, [ebp - 0x218]
dec ecx
mov al, byte [ecx + 1]
lea ecx, [ecx + 1]
test al, al
jne 0x467ed7
mov eax, dword [str.PUTTY.RND]
mov dword [ecx], eax
mov eax, dword [0x4e7e20]
mov dword [ecx + 4], eax
mov ax, word [0x4e7e24]
mov word [ecx + 8], ax
mov al, byte [0x4e7e26]
mov byte [ecx + 0xa], al
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x218]
push edi
push eax
call fcn.00468b90
add esp, 0xc
test eax, eax
je 0x467f32
mov eax, dword [ebp - 0x21c]
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046c107
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
or eax, 0xffffffff
xor ecx, ebp
pop edi
call fcn.0046c107
mov esp, ebp
pop ebp
ret