Function at 0x4050c0
Capabilities:
Delete registry key
Query or enumerate registry key
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40e5a0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x22c
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
xor edi, edi
mov dword [ebp - 0x10], esp
cmp ebx, edi
mov dword [ebp - 4], edi
je 0x4054ca
mov esi, dword [ebp + 0xc]
cmp esi, edi
je 0x4054ca
push esi
call fcn.00407d62
add esp, 4
test eax, eax
je 0x4054ca
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
test eax, eax
jne 0x405171
cmp dword [0x41e04c], edi
je 0x40515e
push esi
push str.Remove_USB_Key___ls____OK_r_n
push 0x41de54
call fcn.0040762a
add esp, 0xc
or ecx, 0xffffffff
xor eax, eax
push edi
mov edi, 0x41de54
repne scasb al, byte es:[edi]
mov eax, dword [0x41e04c]
push 0x41e048
not ecx
dec ecx
push ecx
push 0x41de54
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov al, byte [ebp + 0x10]
test al, al
je 0x4054ca
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x1c], edi
push ecx
push 0x20019
push edi
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, edi
jne 0x405533
cmp dword [ebp - 0x1c], edi
je 0x405585
push esi
mov dword [ebp - 0x18], edi
call dword [sym.imp.OLEAUT32.dll_SysReAllocString]
mov ebx, eax
mov dword [ebp + 0x10], ebx
cmp ebx, edi
mov byte [ebp - 4], 1
je 0x4054c3
mov esi, dword [sym.imp.OLEAUT32.dll_VariantInit]
push ebx
call esi
cmp eax, 1
jb 0x4054c3
push ebx
call esi
cmp word [ebx + eax*2 - 2], 0x5c
je 0x405257
push 0x41a588
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push ebx
mov dword [ebp - 0x14], eax
call esi
mov edx, dword [ebp - 0x14]
mov edi, eax
lea eax, [edi + edx]
push eax
push 0
mov dword [ebp - 0x20], eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
test eax, eax
mov dword [ebp - 0x24], eax
je 0x405257
lea ecx, [edi + edi]
mov esi, ebx
mov dword [ebp + 0x10], ecx
mov edx, ecx
mov edi, eax
push ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x14]
lea edi, [edx + eax]
add ecx, ecx
mov esi, 0x41a588
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x20]
mov word [eax + ecx*2], 0
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov edx, dword [ebp - 0x24]
mov esi, dword [sym.imp.OLEAUT32.dll_VariantInit]
mov dword [ebp + 0x10], edx
mov ebx, edx
mov dword [ebp - 0x14], 0
cmp dword [ebp - 0x14], 0x7d0
jge 0x4053aa
xor eax, eax
mov edx, dword [ebp - 0x18]
push eax
mov ecx, 0x82
lea edi, [ebp - 0x238]
push eax
push eax
push eax
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x20]
lea ecx, [ebp - 0x238]
push eax
mov eax, dword [ebp - 0x1c]
push ecx
push edx
push eax
mov dword [ebp - 0x20], 0x104
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
test eax, eax
jne 0x4053aa
mov eax, dword [ebp - 0x20]
test eax, eax
jbe 0x4053aa
push ebx
call esi
push eax
push ebx
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov edi, eax
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x2c], edi
lea ecx, [ebp - 0x238]
mov byte [ebp - 4], 2
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
test edi, edi
mov dword [ebp - 0x24], ebx
jne 0x4052e2
xor esi, esi
jmp 0x4052e7
push edi
call esi
mov esi, eax
lea eax, [esi + ebx]
push eax
push 0
mov dword [ebp - 0x30], eax
call dword [sym.imp.OLEAUT32.dll_SysReAllocStringLen]
mov ebx, eax
test ebx, ebx
je 0x405347
lea eax, [esi + esi]
mov esi, edi
mov ecx, eax
mov edi, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x24]
lea esi, [ebp - 0x238]
add ecx, ecx
lea edi, [eax + ebx]
mov edx, ecx
mov eax, dword [ebp - 0x30]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x28]
mov word [ebx + eax*2], 0
push ecx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov edi, ebx
mov dword [ebp - 0x2c], edi
mov eax, dword [ebp + 0x10]
test eax, eax
jne 0x405352
xor esi, esi
jmp 0x40535b
push eax
call dword [sym.imp.OLEAUT32.dll_VariantInit]
mov esi, eax
test edi, edi
je 0x4053a0
push edi
call dword [sym.imp.OLEAUT32.dll_VariantInit]
cmp esi, eax
jae 0x4053a0
mov edx, dword [ebp + 8]
push 1
push edi
push edx
call fcn.004050c0
add esp, 0xc
test eax, eax
je 0x405380
inc dword [ebp - 0x18]
push edi
mov byte [ebp - 4], 1
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp + 0x10]
mov esi, dword [sym.imp.OLEAUT32.dll_VariantInit]
inc eax
mov dword [ebp - 0x14], eax
jmp 0x40525e
push edi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x18]
test eax, eax
jne 0x40551c
mov esi, dword [ebp + 0xc]
mov ecx, dword [ebp + 8]
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
test eax, eax
jne 0x405430
mov eax, dword [0x41e04c]
test eax, eax
je 0x405416
push esi
push str.Remove_USB_Key___ls____OK_r_n
push 0x41de54
call fcn.0040762a
mov edi, 0x41de54
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov edx, dword [0x41e04c]
push 0
not ecx
dec ecx
push 0x41e048
push ecx
push 0x41de54
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x405479
mov eax, dword [0x41e04c]
test eax, eax
je 0x4054c3
push esi
push str.Remove_USB_Key___ls____not_found_r_n
push 0x41de54
call fcn.0040762a
mov edi, 0x41de54
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov eax, dword [0x41e04c]
push 0
not ecx
dec ecx
push 0x41e048
push ecx
push 0x41de54
push eax
jmp 0x4054bd
cmp eax, 5
mov eax, dword [0x41e04c]
jne 0x4054e0
test eax, eax
je 0x4054c3
push esi
push str.Remove_USB_Key___ls____failed__no_permission__r_n
push 0x41de54
call fcn.0040762a
mov edi, 0x41de54
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
push 0
dec ecx
push 0x41e048
push ecx
mov ecx, dword [0x41e04c]
push 0x41de54
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov eax, 0x80004005
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x4054c3
push esi
push str.Remove_USB_Key___ls____failed_r_n
push 0x41de54
call fcn.0040762a
mov edi, 0x41de54
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov edx, dword [0x41e04c]
push 0
not ecx
dec ecx
push 0x41e048
push ecx
push 0x41de54
push edx
jmp 0x4054bd
mov eax, dword [0x41e04c]
test eax, eax
je 0x4054c3
mov eax, dword [ebp + 0xc]
push eax
push str.Remove_USB_Key___ls____failed__not_empty__r_n
jmp 0x40548d
cmp eax, 2
je 0x4054ca
cmp eax, 5
jne 0x405585
cmp dword [0x41e04c], edi
je 0x4054ca
push esi
push str.Remove_USB_Key___ls____open_failed__no_permission__r_n
push 0x41de54
call fcn.0040762a
add esp, 0xc
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [0x41e04c]
push edi
mov edi, 0x41de54
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 0x41e048
push ecx
push 0x41de54
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4054ca
cmp dword [0x41e04c], edi
je 0x4054ca
push esi
push str.Remove_USB_Key___ls____open_failed_r_n
push 0x41de54
call fcn.0040762a
add esp, 0xc
or ecx, 0xffffffff
xor eax, eax
push edi
mov edi, 0x41de54
repne scasb al, byte es:[edi]
mov eax, dword [0x41e04c]
push 0x41e048
not ecx
dec ecx
push ecx
push 0x41de54
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x4054ca