Function at 0x405390
Capabilities:
Enumerate files on windows
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 0x427beb
mov eax, dword fs:[0]
push eax
sub esp, 0x1d8
mov eax, dword [0x433a70]
xor eax, esp
mov dword [esp + 0x1d0], eax
push ebx
push esi
push edi
mov eax, dword [0x433a70]
xor eax, esp
push eax
lea eax, [esp + 0x1e8]
mov dword fs:[0], eax
mov dword [esp + 0x34], ecx
mov esi, dword [ebp + 8]
push str.CScrubber::RemoveInfFilesForDevice
lea ecx, [esp + 0x18]
mov dword [esp + 0x34], esi
call fcn.00401130
xor eax, eax
push 0x104
mov dword [esp + 0x1f4], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
call fcn.00409b95
mov edi, eax
push 0x104
mov dword [esp + 0x30], edi
call fcn.00409b95
add esp, 8
test esi, esi
mov ebx, eax
mov dword [esp + 0x10], ebx
je 0x405a0b
test ebx, ebx
je 0x405a0b
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405436
sub eax, edx
cmp eax, 4
jb 0x405a0b
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push 0
push 0
call esi
push eax
mov dword [esp + 0x30], eax
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x38], eax
je 0x4059bb
push eax
mov eax, dword [esp + 0x30]
push eax
call esi
test eax, eax
je 0x4059a7
lea ecx, [esp + 0x20]
push ecx
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4055b6
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40554a
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push 0
push str.DevicePath
push eax
call ebx
test eax, eax
jne 0x405546
mov eax, dword [esp + 0x2c]
push eax
call fcn.00409b95
mov esi, eax
add esp, 4
test esi, esi
je 0x4059a3
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x2c]
push ecx
push esi
push 0
push 0
push str.DevicePath
push edx
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
push 0
push 0
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 + 0x1c], eax
je 0x40599f
push edi
mov ecx, eax
push ecx
push esi
call ebx
push esi
call fcn.00409b90
lea edx, [esp + 0x18]
push str.Read_DevicePath_from_registry
push edx
call fcn.00401460
mov edi, dword [esp + 0x34]
mov ebx, dword [esp + 0x1c]
add esp, 0xc
jmp 0x4055a3
mov ebx, dword [esp + 0x10]
push 0x104
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x1c], eax
je 0x4059a7
push 0x104
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov eax, esi
add eax, 0xffffffff
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x405576
mov ecx, dword [str.inf]
mov dword [eax], ecx
mov dl, byte [0x429f14]
mov byte [eax + 4], dl
lea eax, [esp + 0x14]
push str.Used__windir_inf_for_DevicePath
push eax
call fcn.00401460
add esp, 8
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [esp + 0x20], 0
mov esi, dword [esp + 0x1c]
push esi
lea edx, [esp + 0x18]
push str.DevicePath:__s
push edx
call fcn.00401460
mov eax, dword [esp + 0x3c]
push eax
lea ecx, [esp + 0x24]
push str.Searching_for_infs_that_match_on:__s
push ecx
call fcn.00401460
add esp, 0x18
test esi, esi
je 0x4059a7
lea esp, [esp]
push 0x429eb0
push esi
call fcn.00412936
add esp, 8
test eax, eax
mov dword [esp + 0x28], eax
je 0x405626
push 0x104
push 0
push edi
call fcn.004132a0
mov edx, dword [esp + 0x34]
sub edx, esi
push edx
push esi
push edi
call fcn.004148f0
add esp, 0x18
jmp 0x40563c
mov edx, edi
mov eax, esi
sub edx, esi
lea esp, [esp]
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x405630
push edi
lea eax, [esp + 0x18]
push str.Directory:__s
push eax
call fcn.00401460
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
test eax, eax
je 0x40598c
lea ecx, [esp + 0x9c]
push ecx
push str.oem.inf
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
je 0x4057ef
mov edi, edi
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405685
sub eax, edx
cmp byte [edi + eax - 1], 0x5c
jne 0x4056a7
lea edx, [esp + 0xc8]
push edx
push edi
push str._s_s
jmp 0x4056b5
lea eax, [esp + 0xc8]
push eax
push edi
push 0x429e84
push 0x104
push ebx
call fcn.004131ec
add esp, 0x14
push ebx
lea ecx, [esp + 0x18]
push str.Checking_file:__s
push ecx
mov byte [ebx + 0x104], 0
call fcn.00401460
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x40]
add esp, 0xc
push edx
push ebx
mov ecx, esi
call fcn.004035a0
test eax, eax
je 0x4057c9
lea eax, [esp + 0xc8]
push eax
lea ecx, [esp + 0x18]
push str.Erasing_file:__s
push ecx
call fcn.00401460
add esp, 0xc
push 1
lea edx, [esp + 0xcc]
push edx
mov ecx, esi
call fcn.00403b10
test eax, eax
jne 0x40573f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x18]
call fcn.004013d0
lea eax, [esp + 0xc8]
push str..inf
push eax
call fcn.00412936
add esp, 8
test eax, eax
je 0x4057c9
mov ecx, dword [str..pnf]
mov dword [eax], ecx
mov dl, byte [0x429de8]
mov byte [eax + 4], dl
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0xcc]
push ecx
call fcn.00413ee3
add esp, 8
test eax, eax
jne 0x4057c9
lea edx, [esp + 0xc8]
push edx
lea eax, [esp + 0x18]
push str.Erasing_file:__s
push eax
call fcn.00401460
add esp, 0xc
push 1
lea ecx, [esp + 0xcc]
push ecx
mov ecx, esi
call fcn.00403b10
test eax, eax
jne 0x4057c9
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov dword [esp + 0x24], eax
call esi
push eax
lea ecx, [esp + 0x18]
call fcn.004013d0
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x9c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x405680
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
lea edx, [esp + 0x9c]
push edx
push str.hp.inf
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
je 0x40598c
nop
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x405815
sub eax, edx
cmp byte [edi + eax - 1], 0x5c
jne 0x405837
lea eax, [esp + 0xc8]
push eax
push edi
push str._s_s
jmp 0x405845
lea ecx, [esp + 0xc8]
push ecx
push edi
push 0x429e84
push 0x104
push ebx
call fcn.004131ec
add esp, 0x14
push ebx
lea edx, [esp + 0x18]
push str.Checking_file:__s
push edx
mov byte [ebx + 0x104], 0
call fcn.00401460
mov eax, dword [esp + 0x3c]
mov esi, dword [esp + 0x40]
add esp, 0xc
push eax
push ebx
mov ecx, esi
call fcn.004035a0
test eax, eax
je 0x405966
lea ecx, [esp + 0xc8]
push ecx
lea edx, [esp + 0x18]
push str.Erasing_file:__s
push edx
call fcn.00401460
add esp, 0xc
push 1
lea eax, [esp + 0xcc]
push eax
mov ecx, esi
call fcn.00403b10
test eax, eax
jne 0x4058cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [esp + 0x18]
call fcn.004013d0
lea ecx, [esp + 0xc8]
push ecx
call fcn.00412a4c
lea edx, [esp + 0xcc]
push str..inf
push edx
call fcn.00412936
add esp, 0xc
test eax, eax
je 0x405966
mov ecx, dword [str..pnf]
mov dword [eax], ecx
mov dl, byte [0x429de8]
mov byte [eax + 4], dl
lea eax, [esp + 0x6c]
push eax
lea ecx, [esp + 0xcc]
push ecx
call fcn.00413ee3
add esp, 8
test eax, eax
jne 0x405966
lea edx, [esp + 0xc8]
push edx
lea eax, [esp + 0x18]
push str.Erasing_file:__s
push eax
call fcn.00401460
add esp, 0xc
push 1
lea ecx, [esp + 0xcc]
push ecx
mov ecx, esi
call fcn.00403b10
test eax, eax
jne 0x405966
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
mov dword [esp + 0x24], eax
call esi
push eax
lea ecx, [esp + 0x18]
call fcn.004013d0
mov eax, dword [esp + 0x10]
lea edx, [esp + 0x9c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x405810
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_FindClose]
mov esi, dword [esp + 0x28]
test esi, esi
je 0x4059a7
add esi, 1
jne 0x4055f0
jmp 0x4059a7
mov edi, dword [esp + 0x28]
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + 0x38]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push esi
call fcn.00409b90
add esp, 4
push ebx
call fcn.00409b90
mov eax, dword [esp + 0x20]
add esp, 4
test eax, eax
je 0x4059d5
push eax
call fcn.00409b90
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
je 0x4059e4
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test edi, edi
je 0x4059f1
push edi
call fcn.00409b90
add esp, 4
lea ecx, [esp + 0x14]
mov dword [esp + 0x1f0], 0xffffffff
call fcn.004012e0
mov eax, dword [esp + 0x24]
jmp 0x405a24
lea ecx, [esp + 0x14]
mov dword [esp + 0x1f0], 0xffffffff
call fcn.004012e0
mov eax, 0x57
mov ecx, dword [esp + 0x1e8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1d0]
xor ecx, esp
call fcn.00413011
mov esp, ebp
pop ebp
ret 4