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

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x220
mov dword [esp], ecx
mov eax, dword [0x4b6078]
xor eax, esp
mov dword [esp + 0x21c], eax
lea eax, [esp + 0xc]
mov dword [esp + 4], 0x105
push eax
push str.SoftwareSimonTathamPuTTY
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
je 0x46c955
cmp byte [0x4ba2f0], 0
je 0x46c92f
mov ecx, dword [0x4ba2f8]
jmp 0x46c9c2
push str.shell32.dll
call fcn.004675ca
add esp, 4
test eax, eax
mov dword [0x4ba2f4], eax
je 0x46c9b3
push str.SHGetFolderPathA
push eax
call dword [sym.imp.KERNEL32.DLL_GetProcAddress]
mov ecx, eax
jmp 0x46c9b5
lea eax, [esp + 4]
lea ecx, [esp + 0x117]
lea edx, [esp + 0x10]
push eax
push ecx
push edx
push 0
push str.RandSeedFile
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov edi, eax
push dword [esp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
jne 0x46c91b
cmp dword [esp + 0x10], 1
jne 0x46c91b
mov edx, dword [esp]
lea eax, [esp + 8]
lea ecx, [esp + 0x117]
push eax
call fcn.0046cfe5
add esp, 4
test al, al
je 0x46c91b
jmp 0x46cb2b
xor ecx, ecx
mov dword [0x4ba2f8], ecx
mov byte [0x4ba2f0], 1
test ecx, ecx
je 0x46ca5d
lea ebp, [esp + 0x117]
xor esi, esi
push ebp
push esi
push esi
push 0x1c
push esi
call ecx
test eax, eax
js 0x46ca16
push 0
push str.PUTTY.RND
push ebp
call fcn.00456122
add esp, 0xc
mov edx, dword [esp]
mov edi, eax
lea eax, [esp + 8]
mov ecx, edi
push eax
call fcn.0046cfe5
add esp, 4
mov ebx, eax
push edi
call fcn.00410c0e
add esp, 4
test bl, bl
jne 0x46cb2b
push ebp
push esi
push esi
push 0x1a
push esi
call dword [0x4ba2f8]
test eax, eax
js 0x46ca5d
push 0
push str.PUTTY.RND
push ebp
call fcn.00456122
add esp, 0xc
mov edx, dword [esp]
mov edi, eax
lea eax, [esp + 8]
mov ecx, edi
push eax
call fcn.0046cfe5
add esp, 4
mov ebx, eax
push edi
call fcn.00410c0e
add esp, 4
test bl, bl
jne 0x46cb2b
mov ebp, dword [sym.imp.KERNEL32.DLL_GetEnvironmentVariableA]
mov ebx, 0x104
lea eax, [esp + 0x117]
push ebx
push eax
push str.HOMEDRIVE
call ebp
mov edi, eax
lea esi, [esp + 0x10]
push ebx
push esi
push str.HOMEPATH
call ebp
test edi, edi
jne 0x46ca93
mov byte [esp + 0x117], 0
cmp edi, 0x103
ja 0x46cae0
dec eax
cmp eax, 0x103
jae 0x46cae0
push 0
push str.PUTTY.RND
push esi
lea ebp, [esp + 0x123]
push ebp
call fcn.00456122
add esp, 0x10
mov edx, dword [esp]
mov edi, eax
lea eax, [esp + 8]
mov ecx, edi
push eax
call fcn.0046cfe5
add esp, 4
mov ebx, eax
push edi
call fcn.00410c0e
add esp, 4
test bl, bl
je 0x46cae7
jmp 0x46cb2b
lea ebp, [esp + 0x117]
mov esi, 0x104
push esi
push ebp
call dword [sym.imp.KERNEL32.DLL_GetWindowsDirectoryA]
cmp eax, esi
jae 0x46cb31
push 0
push str.PUTTY.RND
push ebp
call fcn.00456122
add esp, 0xc
mov edx, dword [esp]
mov edi, eax
lea eax, [esp + 8]
mov ecx, edi
push eax
call fcn.0046cfe5
add esp, 4
mov ebx, eax
push edi
call fcn.00410c0e
add esp, 4
test bl, bl
je 0x46cb31
mov esi, dword [esp + 8]
jmp 0x46cb34
xor esi, esi
dec esi
mov ecx, dword [esp + 0x21c]
xor ecx, esp
call fcn.0046fa9a
mov eax, esi
add esp, 0x220
pop esi
pop edi
pop ebx
pop ebp
ret