Function at 0x404c10
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 0x427bab
mov eax, dword fs:[0]
push eax
sub esp, 0x1c0
mov eax, dword [0x433a70]
xor eax, esp
mov dword [esp + 0x1b8], eax
push ebx
push esi
push edi
mov eax, dword [0x433a70]
xor eax, esp
push eax
lea eax, [esp + 0x1d0]
mov dword fs:[0], eax
mov dword [esp + 0x50], ecx
mov esi, dword [ebp + 8]
push str.CScrubber::RestoreInfFilesForDevice
lea ecx, [esp + 0x14]
mov dword [esp + 0x40], esi
call fcn.00401130
xor eax, eax
push 0x104
mov dword [esp + 0x1dc], eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x24], eax
call fcn.00409b95
push 0x104
mov dword [esp + 0x24], eax
call fcn.00409b95
mov edi, eax
push 0x104
mov dword [esp + 0x34], edi
call fcn.00409b95
push 0x104
mov dword [esp + 0x40], eax
call fcn.00409b95
mov ebx, eax
add esp, 0x10
mov dword [esp + 0x24], ebx
call fcn.004096a0
cmp eax, 8
je 0x4052ed
test esi, esi
je 0x4052b3
test edi, edi
je 0x4052b3
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404ce0
sub eax, edx
cmp eax, 4
jb 0x4052b3
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 + 0x44], eax
je 0x4052ed
push eax
mov eax, dword [esp + 0x30]
push eax
call esi
test eax, eax
je 0x4052d5
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 0x404e62
mov eax, dword [esp + 0x20]
test eax, eax
je 0x404df0
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [esp + 0x2c]
push edx
push 0
push 0
push 0
push str.DevicePath
push eax
call edi
test eax, eax
jne 0x404df0
mov eax, dword [esp + 0x2c]
push eax
call fcn.00409b95
mov esi, eax
add esp, 4
test esi, esi
je 0x4052d5
mov edx, dword [esp + 0x20]
lea ecx, [esp + 0x2c]
push ecx
push esi
push 0
push 0
push str.DevicePath
push edx
call edi
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 + 0x18], eax
je 0x4052d1
push edi
mov ecx, eax
push ecx
push esi
call ebx
push esi
call fcn.00409b90
lea edx, [esp + 0x14]
push str.Read_DevicePath_from_registry
push edx
call fcn.00401460
mov ebx, dword [esp + 0x30]
mov esi, dword [esp + 0x24]
add esp, 0xc
jmp 0x404e4d
push 0x104
call fcn.00409b95
add esp, 4
test eax, eax
mov dword [esp + 0x18], eax
je 0x4052d5
push 0x104
mov esi, eax
push esi
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
mov eax, esi
add eax, 0xffffffff
lea esp, [esp]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x404e20
mov ecx, dword [str.inf]
mov dword [eax], ecx
mov dl, byte [0x429f14]
mov byte [eax + 4], dl
lea eax, [esp + 0x10]
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
jmp 0x404e66
mov esi, dword [esp + 0x18]
push esi
lea edx, [esp + 0x14]
push str.DevicePath:__s
push edx
call fcn.00401460
mov eax, dword [esp + 0x48]
push eax
lea ecx, [esp + 0x20]
push str.Searching_for_infs_that_match_on:__s
push ecx
call fcn.00401460
add esp, 0x18
test esi, esi
je 0x4052d5
push 0x429eb0
push esi
call fcn.00412936
mov edi, dword [esp + 0x24]
add esp, 8
test eax, eax
mov dword [esp + 0x34], eax
je 0x404ecf
push 0x104
push 0
push edi
call fcn.004132a0
mov edx, dword [esp + 0x40]
sub edx, esi
push edx
push esi
push edi
call fcn.004148f0
add esp, 0x18
jmp 0x404ee1
mov edx, edi
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x404ed5
push edi
lea eax, [esp + 0x14]
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 0x40529d
lea ecx, [esp + 0x84]
push ecx
push str.oem.hpp
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
cmp eax, 0xffffffff
mov dword [esp + 0x24], eax
je 0x40529d
mov esi, dword [esp + 0x1c]
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x404f30
sub eax, edx
cmp byte [esi + eax - 1], 0x5c
jne 0x404f52
lea edx, [esp + 0xb0]
push edx
push esi
push str._s_s
jmp 0x404f60
lea eax, [esp + 0xb0]
push eax
push esi
push 0x429e84
mov esi, dword [esp + 0x34]
push 0x104
push esi
call fcn.004131ec
add esp, 0x14
push esi
lea ecx, [esp + 0x14]
push str.Checking_file:__s
push ecx
mov byte [esi + 0x104], 0
call fcn.00401460
mov edx, dword [esp + 0x48]
mov ecx, dword [esp + 0x5c]
add esp, 0xc
push edx
push esi
call fcn.004035a0
test eax, eax
je 0x405277
lea eax, [esp + 0xb0]
push eax
lea ecx, [esp + 0x14]
push str.Renaming_back_INF_file:__s
push ecx
call fcn.00401460
mov edx, dword [esp + 0x3c]
mov eax, esi
add esp, 0xc
sub edx, eax
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x404fc5
lea edx, [esp + 0xb0]
push str..hpp
push edx
call fcn.00412936
add esp, 8
test eax, eax
mov dword [esp + 0x48], eax
je 0x405277
mov eax, ebx
sub eax, dword [esp + 0x1c]
mov dword [esp + 0x38], 0
mov dword [esp + 0x4c], eax
mov ecx, dword [str..inf]
mov eax, dword [esp + 0x48]
mov dword [eax], ecx
mov dl, byte [0x429e54]
push 0x104
mov byte [eax + 4], dl
call fcn.00409b95
mov esi, eax
mov eax, dword [esp + 0x3c]
push 0xa
push esi
push eax
mov dword [esp + 0x50], esi
call fcn.00414cbf
push esi
lea ecx, [esp + 0x24]
push str.j_s
push ecx
call fcn.00401460
mov eax, dword [esp + 0x38]
mov edx, dword [esp + 0x68]
add esp, 0x1c
mov cl, byte [eax]
mov byte [edx + eax], cl
add eax, 1
test cl, cl
jne 0x405051
mov edi, ebx
add edi, 0xffffffff
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x405062
mov dx, word [0x429658]
mov word [edi], dx
mov edi, ebx
add edi, 0xffffffff
jmp 0x405080
mov al, byte [edi + 1]
add edi, 1
test al, al
jne 0x405080
mov eax, dword [0x42a078]
mov dword [edi], eax
mov eax, dword [esp + 0x40]
mov ecx, eax
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x405097
mov edi, ebx
sub eax, ecx
mov esi, ecx
add edi, 0xffffffff
lea esp, [esp]
mov cl, byte [edi + 1]
add edi, 1
test cl, cl
jne 0x4050b0
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
mov eax, ebx
rep movsb byte es:[edi], byte [esi]
add eax, 0xffffffff
lea ecx, [ecx]
mov cl, byte [eax + 1]
add eax, 1
test cl, cl
jne 0x4050d0
mov ecx, dword [str..inf]
mov esi, dword [esp + 0x30]
mov dword [eax], ecx
mov dl, byte [0x429e54]
push esi
mov byte [eax + 4], dl
lea eax, [esp + 0x14]
push str.lptOldName:__s
push eax
call fcn.00401460
push ebx
lea ecx, [esp + 0x20]
push str.lptNewName:__s
push ecx
call fcn.00401460
push ebx
push esi
call fcn.004148ba
mov edi, eax
add esp, 0x20
test edi, edi
jne 0x40523f
lea edx, [esp + 0x10]
push str.INF_filename_successfully_restored
push edx
call fcn.00401460
push str..hpp
push esi
call fcn.00412936
add esp, 0x10
test eax, eax
je 0x405155
mov ecx, dword [str..hpf]
mov dword [eax], ecx
mov dl, byte [0x429de0]
mov byte [eax + 4], dl
push str..inf
push ebx
call fcn.00412936
add esp, 8
test eax, eax
je 0x405178
mov ecx, dword [str..pnf]
mov dword [eax], ecx
mov dl, byte [0x429de8]
mov byte [eax + 4], dl
push esi
lea eax, [esp + 0x14]
push str.Searching_for_pnf_file_to_rename:__s
push eax
call fcn.00401460
lea ecx, [esp + 0x60]
push ecx
push esi
call fcn.00413ee3
add esp, 0x14
test eax, eax
jne 0x405259
push ebx
lea edx, [esp + 0x14]
push str.removing_invalid_PNF_name:__s
push edx
call fcn.00401460
push ebx
call fcn.00414c55
add esp, 0x10
test eax, eax
jne 0x4051cf
lea eax, [esp + 0x10]
push str.PNF_file_successfully_removed
push eax
call fcn.00401460
add esp, 8
jmp 0x4051e9
call fcn.00414876
mov ecx, dword [eax]
push ecx
lea edx, [esp + 0x14]
push str.PNF_file_remove__failed_with_error___d_n
push edx
call fcn.00401460
add esp, 0xc
push esi
lea eax, [esp + 0x14]
push str.Restoring_PNF_file:__s
push eax
call fcn.00401460
push ebx
lea ecx, [esp + 0x20]
push str.New_PNF_File_name:__s
push ecx
call fcn.00401460
push ebx
push esi
call fcn.004148ba
add esp, 0x20
test eax, eax
jne 0x40522b
lea edx, [esp + 0x10]
push str.PNF_file_successfully_renamed
push edx
call fcn.00401460
add esp, 8
jmp 0x405259
call fcn.00414876
mov eax, dword [eax]
push eax
push str.PNF_file_rename_failed_with_error___d_n
lea ecx, [esp + 0x18]
push ecx
jmp 0x405251
call fcn.00414876
mov edx, dword [eax]
push edx
push str.INF_filename_failed_to_restore_with_error___d_n
lea eax, [esp + 0x18]
push eax
call fcn.00401460
add esp, 0xc
mov eax, dword [esp + 0x40]
add dword [esp + 0x38], 1
test eax, eax
je 0x40526f
push eax
call fcn.00409b90
add esp, 4
test edi, edi
jne 0x405004
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x84]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x404f23
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_FindClose]
cmp dword [esp + 0x34], 0
je 0x4052d5
mov esi, dword [esp + 0x34]
add esi, 1
jne 0x404e95
jmp 0x4052d5
lea ecx, [esp + 0x10]
mov dword [esp + 0x1d8], 0xffffffff
call fcn.004012e0
mov eax, 0x57
jmp 0x40535f
mov ebx, dword [esp + 0x24]
mov esi, dword [esp + 0x44]
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push esi
call fcn.00409b90
mov edi, dword [esp + 0x2c]
add esp, 4
test edi, edi
je 0x4052fa
push edi
call fcn.00409b90
add esp, 4
mov eax, dword [esp + 0x18]
test eax, eax
je 0x40530b
push eax
call fcn.00409b90
add esp, 4
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40531a
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40532b
push eax
call fcn.00409b90
add esp, 4
mov eax, dword [esp + 0x30]
test eax, eax
je 0x40533c
push eax
call fcn.00409b90
add esp, 4
test ebx, ebx
je 0x405349
push ebx
call fcn.00409b90
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x1d8], 0xffffffff
call fcn.004012e0
xor eax, eax
mov ecx, dword [esp + 0x1d0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x1b8]
xor ecx, esp
call fcn.00413011
mov esp, ebp
pop ebp
ret 4