Function at 0x408710
Capabilities:
Delete directory
Delete file
Delete registry key
Enumerate files on windows
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x447eb6
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x36c
push ebx
push ebp
push esi
push edi
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x130]
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x18]
push eax
push 0x20019
push 0
push str.SOFTWARECanonGetDev
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x40878b
mov eax, 1
mov ecx, dword [esp + 0x37c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
lea ecx, [esp + 0x20]
push ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x134]
push edx
lea eax, [esp + 0x24]
push eax
push 0
push str.Path
push ecx
mov dword [esp + 0x38], 0x104
mov dword [esp + 0x34], 1
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
je 0x4087e6
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
mov ecx, dword [esp + 0x37c]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.ADVAPI32.dll_RegDeleteKeyA]
push str.SOFTWARECanonGetDev
push reloc.OLEAUT32.dll_SysReAllocString
call esi
push str.SOFTWARECANON_
push reloc.OLEAUT32.dll_SysReAllocString
call fcn.0040a110
add esp, 8
cmp eax, 1
jne 0x408826
push str.SOFTWARECANON_
push reloc.OLEAUT32.dll_SysReAllocString
call esi
mov ebp, dword [sym.imp.USER32.dll_wsprintfA]
lea ecx, [esp + 0x130]
push ecx
lea edx, [esp + 0x2c]
push str._s.
push edx
call ebp
add esp, 0xc
lea eax, [esp + 0x238]
push eax
lea ecx, [esp + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_FindFirstFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x4088b0
mov ebx, dword [sym.imp.KERNEL32.dll_DeleteFileA]
xor eax, eax
mov ecx, 0x41
lea edi, [esp + 0x28]
rep stosd dword es:[edi], eax
lea edx, [esp + 0x264]
push edx
lea eax, [esp + 0x134]
push eax
lea ecx, [esp + 0x30]
push 0x44bbe8
push ecx
call ebp
add esp, 0x10
lea edx, [esp + 0x28]
push edx
call ebx
lea eax, [esp + 0x238]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_FindNextFileA]
test eax, eax
jne 0x408863
push esi
call dword [sym.imp.KERNEL32.dll_FindClose]
mov esi, dword [sym.imp.KERNEL32.dll_RemoveDirectoryA]
lea ecx, [esp + 0x130]
push ecx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call edi
lea edx, [esp + 0x130]
push edx
lea ecx, [esp + 0x18]
call fcn.00402470
mov eax, dword [esp + 0x14]
push 0x5c
push eax
mov dword [esp + 0x38c], 0
call fcn.0042dfa2
add esp, 8
test eax, eax
jne 0x4088fe
or eax, 0xffffffff
jmp 0x408902
sub eax, dword [esp + 0x14]
push eax
lea ecx, [esp + 0x28]
push ecx
lea ecx, [esp + 0x1c]
call fcn.00403670
push eax
lea ecx, [esp + 0x18]
mov byte [esp + 0x388], 1
call fcn.00401e30
mov eax, dword [esp + 0x24]
add eax, 0xfffffff0
mov byte [esp + 0x384], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x408949
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov eax, dword [esp + 0x14]
push eax
call esi
call edi
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov dword [esp + 0x384], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40897b
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
call dword [edx + 4]
mov ecx, dword [esp + 0x37c]
pop edi
mov eax, ebx
mov dword fs:[0], ecx
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret