Function at 0x10021006
Capabilities:
Delete registry value
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x250
mov eax, dword [0x10032138]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, dword [ebp + 8]
push edi
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x22c], ax
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
call sub.msvcrt.dll_memset
push 7
xor eax, eax
pop ecx
mov word [ebp - 0x24], ax
lea edi, [ebp - 0x22]
rep stosd dword es:[edi], eax
xor ecx, ecx
stosw word es:[edi], ax
push esi
xor eax, eax
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
lea edi, reloc.ADVAPI32.dll_TraceMessage
push 0x1000c038
stosd dword es:[edi], eax
lea eax, reloc.ADVAPI32.dll_TraceMessage
push 0x104
push eax
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ecx
call fcn.100010fa
mov esi, eax
add esp, 0x1c
test esi, esi
jns 0x100210d2
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x100211f7
test byte [eax + 0x1c], 1
je 0x100211f7
push esi
push 0x1000bea8
push 0x1a
jmp 0x10021167
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
push 0x2001b
push 0
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
xor eax, eax
test ebx, ebx
setne al
add eax, 0x80000001
push eax
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov edi, eax
test edi, edi
je 0x10021177
cmp edi, 2
jne 0x10021138
xor esi, esi
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x100211f7
test byte [eax + 0x1c], 4
je 0x100211f7
push 0x1000bea8
push 0x1b
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1000c7e1
jmp 0x100211f7
call sub.KERNEL32.dll_GetLastError
push eax
call fcn.100033fb
mov esi, eax
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x100211f7
test byte [eax + 0x1c], 1
je 0x100211f7
push edi
push 0x1000bea8
push 0x1c
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1001334b
jmp 0x100211f7
xor ebx, ebx
push ebx
push ebx
push ebx
push ebx
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push dword [ebp - 0x230]
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
test eax, eax
je 0x100211c9
mov ecx, dword [0x100320c8]
cmp ecx, 0x100320c8
je 0x10021352
test byte [ecx + 0x1c], 1
je 0x10021352
push eax
push 0x1000bea8
push 0x1d
push dword [ecx + 0x14]
push dword [ecx + 0x10]
jmp 0x1002134d
cmp dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ebx
jne 0x1002121f
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x100211f5
test byte [eax + 0x1c], 4
je 0x100211f5
push 0x1000bea8
push UnregisterTraceGuids
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1000c7e1
mov esi, ebx
cmp dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0
je 0x1002120c
push dword [ebp - 0x230]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.100024c8
leave
ret 8
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
call dword [sym.imp.ntdll.dll_NtQuerySystemTime]
test eax, eax
jns 0x10021261
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x10021352
test byte [eax + 0x1c], 1
je 0x10021352
push 0x1000bea8
push reloc.ADVAPI32.dll_UnregisterTraceGuids
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1000c7e1
jmp 0x10021352
mov esi, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
dec esi
js 0x100211f5
mov edi, 0x1000bea8
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
push ebx
lea eax, reloc.ADVAPI32.dll_TraceMessage
push eax
lea eax, [ebp - 0x24]
push eax
push esi
push dword [ebp - 0x230]
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0x10
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 8
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ebx
mov dword [ebp - reloc.ADVAPI32.dll_TraceMessage], ebx
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
mov ecx, eax
test ecx, ecx
jne 0x10021331
cmp dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 8
jne 0x10021305
cmp dword [ebp - reloc.ADVAPI32.dll_TraceMessage], 0xb
jne 0x10021305
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
jg 0x10021325
jl 0x100212f3
mov eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
cmp eax, dword [ebp - reloc.ADVAPI32.dll_TraceMessage]
ja 0x10021325
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 0x230]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
jmp 0x10021325
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x10021325
test byte [eax + 0x1c], 2
je 0x10021325
push edi
push reloc.ADVAPI32.dll_GetTraceEnableFlags
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1000c7e1
dec esi
js 0x100211f5
jmp 0x1002126f
mov eax, dword [0x100320c8]
cmp eax, 0x100320c8
je 0x10021352
test byte [eax + 0x1c], 1
je 0x10021352
push ecx
push edi
push reloc.ADVAPI32.dll_RegisterTraceGuidsW
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.1001334b
call sub.KERNEL32.dll_GetLastError
push eax
call fcn.100033fb
mov esi, eax
jmp 0x100211f7