Function at 0x405a50
Capabilities:
Get common file path
Query environment variable
Query or enumerate registry value
Set current directory

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x427c28
mov eax, dword fs:[0]
push eax
sub esp, 0x60
push ebx
push esi
push edi
mov eax, dword [0x433a70]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov esi, ecx
mov dword [esp + 0x24], esi
push str.CScrubber::RemoveInfFiles
lea ecx, [esp + 0x38]
call fcn.00401130
xor ebx, ebx
push 0x104
mov dword [esp + 0x7c], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x18], ebx
call fcn.00409b95
add esp, 4
cmp dword [esi], ebx
mov dword [esp + 0x18], eax
je 0x405e93
mov edi, dword [ebp + 8]
test edi, edi
je 0x405e93
cmp dword [edi + 0xc], ebx
je 0x405e93
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push ebx
push ebx
call esi
push eax
mov dword [esp + 0x20], eax
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x30], eax
je 0x405e49
push eax
mov eax, dword [esp + 0x20]
push eax
call esi
test eax, eax
je 0x405e28
lea ecx, [esp + 0x14]
push ecx
push 1
push ebx
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x405c34
mov eax, dword [esp + 0x14]
test eax, eax
je 0x405bbf
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [esp + 0x1c]
push edx
push ebx
push ebx
push ebx
push str.DevicePath
push eax
call edi
test eax, eax
jne 0x405bbc
mov eax, dword [esp + 0x1c]
push eax
call fcn.00409b95
mov esi, eax
add esp, 4
test esi, esi
je 0x405e28
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
push esi
push ebx
push ebx
push str.DevicePath
push edx
call edi
push ebx
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
push esi
call ebx
mov edi, eax
lea eax, [edi + 1]
push eax
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x10], eax
je 0x405e20
push edi
mov ecx, eax
push ecx
push esi
call ebx
push esi
call fcn.00409b90
lea edx, [esp + 0x38]
push str.Read_DevicePath_from_registry
push edx
call fcn.00401460
mov edi, dword [ebp + 8]
add esp, 0xc
jmp 0x405c1d
mov edi, dword [ebp + 8]
push 0x104
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x10], eax
je 0x405e24
push 0x104
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov eax, esi
add eax, 0xffffffff
jmp 0x405bf0
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x405bf0
mov ecx, dword [str.inf]
mov dword [eax], ecx
mov dl, byte [0x429f14]
mov byte [eax + 4], dl
lea eax, [esp + 0x34]
push str.Used__windir_inf_for_DevicePath
push eax
call fcn.00401460
add esp, 8
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x14], 0
push ebx
lea edx, [esp + 0x38]
push str.DevicePath:__s
push edx
call fcn.00401460
mov eax, dword [edi + 4]
add esp, 0xc
cmp dword [edi + 0xc], 0
mov dword [esp + 0x28], 0
jle 0x405e28
jmp 0x405c64
mov eax, dword [esp + 0x2c]
mov edi, dword [eax + 8]
mov ecx, dword [eax]
push edi
lea edx, [esp + 0x38]
push str.Searching_for_inf_file:__s
push edx
mov dword [esp + 0x38], ecx
call fcn.00401460
add esp, 0xc
test ebx, ebx
mov esi, ebx
je 0x405e07
lea ebx, [ebx]
push 0x429eb0
push esi
call fcn.00412936
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x405cca
mov eax, dword [esp + 0x18]
push 0x104
push 0
push eax
call fcn.004132a0
mov ecx, ebx
sub ecx, esi
push ecx
push esi
mov esi, dword [esp + 0x2c]
push esi
call fcn.004148f0
add esp, 0x18
jmp 0x405ce2
mov edx, dword [esp + 0x18]
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x405cd2
mov esi, dword [esp + 0x18]
push esi
lea edx, [esp + 0x38]
push str.Directory:__s
push edx
call fcn.00401460
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x405df4
push edi
lea eax, [esp + 0x38]
push str.Checking_for_file:__s
push eax
call fcn.00401460
lea ecx, [esp + 0x48]
push ecx
push edi
call fcn.00413ee3
add esp, 0x14
test eax, eax
jne 0x405d61
push edi
lea edx, [esp + 0x38]
push str.Erasing_file:__s
push edx
call fcn.00401460
mov ecx, dword [esp + 0x30]
add esp, 0xc
push 1
push edi
call fcn.00403b10
test eax, eax
jne 0x405d61
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov dword [esp + 0x20], eax
call esi
push eax
lea ecx, [esp + 0x38]
call fcn.004013d0
push str..inf
push edi
call fcn.00412936
mov esi, eax
add esp, 8
test esi, esi
je 0x405df4
mov eax, dword [str..pnf]
push edi
mov dword [esi], eax
mov cl, byte [0x429de8]
lea edx, [esp + 0x38]
push str.Checking_for_file:__s
push edx
mov byte [esi + 4], cl
call fcn.00401460
lea eax, [esp + 0x48]
push eax
push edi
call fcn.00413ee3
add esp, 0x14
test eax, eax
jne 0x405de4
push edi
lea ecx, [esp + 0x38]
push str.Erasing_file:__s
push ecx
call fcn.00401460
mov ecx, dword [esp + 0x30]
add esp, 0xc
push 1
push edi
call fcn.00403b10
test eax, eax
jne 0x405de4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x38]
call fcn.004013d0
mov edx, dword [str..inf]
mov dword [esi], edx
mov al, byte [0x429e54]
mov byte [esi + 4], al
test ebx, ebx
je 0x405e03
lea esi, [ebx + 1]
test esi, esi
jne 0x405c90
mov ebx, dword [esp + 0x10]
mov eax, dword [esp + 0x28]
mov ecx, dword [ebp + 8]
add eax, 1
cmp eax, dword [ecx + 0xc]
mov dword [esp + 0x28], eax
jl 0x405c60
jmp 0x405e28
mov ebx, eax
jmp 0x405e28
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 0x30]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push esi
call fcn.00409b90
add esp, 4
test ebx, ebx
je 0x405e49
push ebx
call fcn.00409b90
add esp, 4
mov eax, dword [esp + 0x14]
test eax, eax
je 0x405e58
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x18]
test eax, eax
je 0x405e69
push eax
call fcn.00409b90
add esp, 4
lea ecx, [esp + 0x34]
mov dword [esp + 0x78], 0xffffffff
call fcn.004012e0
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
lea ecx, [esp + 0x34]
mov dword [esp + 0x78], 0xffffffff
call fcn.004012e0
mov eax, 0x57
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4