joyce8/EMBER2024-capa huggingface dataset:
Function at 0x105791c
Capabilities:
Delete registry key
Query or enumerate registry key

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x21c
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0xc]
push edi
mov edi, dword [ebp + 8]
push ebx
push edi
mov dword [ebp - 0x21c], edi
mov dword [ebp - 0x218], ebx
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
test eax, eax
je 0x1057a0f
push esi
lea eax, [ebp - 0x210]
push eax
push 0x2001f
xor esi, esi
push esi
push ebx
push edi
mov dword [ebp - 0x210], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
cmp eax, esi
jne 0x1057a0e
mov edi, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
push esi
push dword [ebp - 0x210]
mov dword [ebp - 0x214], 0x104
call edi
mov ebx, 0x103
jmp 0x10579ec
cmp eax, esi
jne 0x10579f0
lea eax, [ebp - 0x20c]
push eax
push dword [ebp - 0x210]
call fcn.0105791c
test eax, eax
jne 0x10579f0
push esi
push esi
push esi
push esi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
push esi
push dword [ebp - 0x210]
mov dword [ebp - 0x214], 0x104
call edi
cmp eax, ebx
jne 0x10579ad
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push dword [ebp - 0x218]
push dword [ebp - 0x21c]
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyW]
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.01047480
leave
ret 8

Function at 0x1057a24
Capabilities:
Query or enumerate registry value
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push esi
xor esi, esi
mov dword [ebp - 4], esi
cmp dword [ebp + 0xc], esi
jne 0x1057a3a
push 6
pop eax
jmp 0x1057a80
cmp dword [ebp + 8], esi
jne 0x1057a68
lea eax, [ebp - 4]
push eax
push esi
push esi
push esi
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1057a68
cmp dword [ebp + 0x10], esi
jne 0x1057a61
cmp dword [ebp - 4], 2
jbe 0x1057a68
mov eax, 0xb7
jmp 0x1057a80
push dword [ebp + 0x20]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
pop esi
leave
ret 0x1c

Function at 0x1057afe
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push esi
lea eax, [ebp - 8]
push eax
push 1
xor esi, esi
push esi
push 0x1009af0
push 0x80000002
mov dword [ebp - 8], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1057b77
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
push esi
push 0x1009ad0
push dword [ebp - 8]
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], 3
mov dword [ebp - 0x10], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1057b6e
cmp dword [ebp - 4], 4
je 0x1057b63
cmp dword [ebp - 4], 3
jne 0x1057b6e
xor eax, eax
cmp dword [ebp - 0xc], 1
setne al
mov esi, eax
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
pop esi
leave
ret
Function at 0x1057da6
Capabilities:
Get geographical location

Disassembly:
mov edi, edi
push ebx
push edi
push 0x144
push 0
push esi
call sub.msvcrt.dll_memset
mov edi, dword [sym.imp.KERNEL32.dll_GetLocaleInfoW]
and dword [esi], 0
add esp, 0xc
push 0x32
lea eax, [esi + 0xe0]
push eax
push 0x1010
mov ebx, 0x400
push ebx
call edi
lea eax, [esi + 0xe0]
push eax
call dword [sym.imp.msvcrt.dll__wtoi]
pop ecx
push 0x32
mov dword [esi + 0x14], eax
lea eax, [esi + 0xe0]
push eax
push 0x12
xor ecx, ecx
push ebx
mov word [eax], cx
call edi
lea eax, [esi + 0xe0]
push eax
call dword [sym.imp.msvcrt.dll__wtoi]
pop ecx
push 0x32
mov dword [esi + 4], eax
lea eax, [esi + 0x18]
push eax
push 0xe
push ebx
call edi
lea eax, [esi + 0x18]
push 0x32
mov dword [esi + 0xc], eax
lea eax, [esi + 0x7c]
push eax
push 0xf
push ebx
call edi
lea eax, [esi + 0x7c]
push 0x32
mov dword [esi + 0x10], eax
lea eax, [esi + 0xe0]
push eax
push 0x10
xor ecx, ecx
push ebx
mov word [eax], cx
call edi
lea edi, [esi + 0xe0]
movzx eax, word [edi]
xor ecx, ecx
cmp cx, ax
je 0x1057e87
mov ebx, dword [sym.imp.USER32.dll_CharNextW]
push 0x30
pop ecx
cmp cx, ax
je 0x1057e87
mov eax, dword [esi + 8]
imul eax, eax, 0xa
push edi
mov dword [esi + 8], eax
call dword [sym.imp.msvcrt.dll__wtoi]
add dword [esi + 8], eax
pop ecx
push edi
call ebx
push eax
call ebx
mov edi, eax
movzx eax, word [edi]
xor ecx, ecx
cmp cx, ax
jne 0x1057e59
pop edi
pop ebx
ret

Function at 0x105864b
Capabilities:
Get disk size

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x22c
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
test eax, eax
jne 0x105866e
xor edx, edx
jmp 0x105875e
push esi
push eax
push 0x103
lea eax, [ebp - 0x20c]
push eax
call fcn.01035831
lea eax, [ebp - 0x20c]
push 0x5c
push eax
call dword [sym.imp.msvcrt.dll_wcschr]
mov esi, eax
pop ecx
xor eax, eax
pop ecx
test esi, esi
jne 0x10586a1
xor edx, edx
jmp 0x105875d
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetDiskFreeSpaceExW]
inc esi
inc esi
mov word [esi], ax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
jne 0x1058700
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x10586de
push 0x57
pop eax
test eax, eax
jle 0x10586ea
and eax, 0xffff
or eax, 0x80070000
push eax
push 0x1009de0
push 2
call fcn.01055c8a
add esp, 0xc
xor eax, eax
xor edx, edx
jmp 0x105875c
mov eax, dword [ebp - 0x210]
push ebx
mov ebx, dword [ebp - 0x214]
mov dword [ebp - 0x218], eax
test ebx, ebx
jne 0x1058753
test eax, eax
jne 0x1058753
mov word [esi - 2], ax
lea eax, [ebp - 0x224]
push eax
lea eax, [ebp - 0x22c]
push eax
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x20c]
push eax
call edi
test eax, eax
je 0x1058753
mov eax, dword [ebp - 0x210]
mov ebx, dword [ebp - 0x214]
mov dword [ebp - 0x218], eax
mov edx, dword [ebp - 0x218]
mov eax, ebx
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.01047480
leave
ret 4
Function at 0x10587e2
Capabilities:
Check if file exists
Get file attributes

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x20c
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
xor esi, esi
test eax, eax
je 0x1058840
push eax
push 0x104
lea eax, [ebp - 0x20c]
push eax
call fcn.01035831
test eax, eax
jl 0x1058840
push 0x5c
lea eax, [ebp - 0x20c]
push eax
call fcn.01055ec0
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x105883e
test al, 0x10
je 0x105883e
inc esi
jmp 0x1058840
xor esi, esi
mov ecx, dword [ebp - 4]
mov eax, esi
xor ecx, ebp
pop esi
call fcn.01047480
leave
ret 4

Function at 0x1058856
Capabilities:
Create directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 8]
sub esp, 0xc
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1058864
push ebx
sub eax, edx
sar eax, 1
push esi
lea ebx, [eax + 0x14]
xor ecx, ecx
push 2
pop edx
mov eax, ebx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov esi, eax
pop ecx
test esi, esi
je 0x1058960
push edi
push dword [ebp + 8]
push ebx
push esi
call fcn.01035831
mov edi, dword [sym.imp.msvcrt.dll_wcsstr]
push 0x1007db0
push esi
call edi
pop ecx
pop ecx
test eax, eax
je 0x1058958
add eax, 4
and dword [ebp - 4], 0
jmp 0x10588c7
mov eax, dword [ebp - 0xc]
push 0x1005778
push eax
call edi
pop ecx
pop ecx
test eax, eax
je 0x105894f
xor ecx, ecx
mov word [eax], cx
add eax, 2
push esi
mov dword [ebp - 0xc], eax
call fcn.010587e2
test eax, eax
jne 0x1058927
push eax
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1058901
push 0x57
pop eax
test eax, eax
jle 0x105890d
and eax, 0xffff
or eax, 0x80070000
push esi
mov dword [ebp - 8], eax
call fcn.010587e2
test eax, eax
je 0x105893c
push 0
push esi
push 5
push 8
call dword [sym.imp.SHELL32.dll_SHChangeNotify]
push dword [ebp + 8]
push ebx
push esi
call fcn.01035831
inc dword [ebp - 4]
cmp dword [ebp - 4], 0xa
jl 0x10588c4
jmp 0x105894f
push dword [ebp - 8]
push esi
push 0x1009e0c
push 2
call fcn.01055c8a
add esp, 0x10
push 0
push esi
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push esi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
pop edi
push dword [ebp + 8]
call fcn.010587e2
pop esi
pop ebx
leave
ret 4
Function at 0x1058973
Capabilities:
Get common file path
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x32c
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
lea eax, [ebp - 0x320]
push eax
xor ebx, ebx
xor esi, esi
mov dword [ebp - 0x320], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x1058aea
cmp dword [ebp - 0x310], 2
jne 0x1058ae8
mov eax, dword [ebp - 0x31c]
cmp eax, dword [ebp + 8]
je 0x10589d3
jbe 0x1058ae8
xor esi, esi
inc esi
jmp 0x1058ae8
mov eax, dword [ebp - 0x318]
cmp eax, dword [ebp + 0xc]
jne 0x10589c5
xor esi, esi
push edi
mov edi, dword [ebp + 0x10]
inc esi
cmp edi, ebx
jbe 0x1058ae7
lea eax, [ebp - 0x32c]
push eax
push esi
push ebx
push 0x1009678
push 0x80000002
mov dword [ebp - 0x32c], ebx
mov dword [ebp - 0x328], 0x208
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1058a84
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x324]
push eax
push ebx
push 0x100964c
push dword [ebp - 0x32c]
mov dword [ebp - 0x324], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1058a6c
cmp dword [ebp - 0x324], esi
jne 0x1058a6c
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.msvcrt.dll__wtol]
cmp eax, edi
sbb esi, esi
pop ecx
mov dword [ebp - 0x328], eax
inc esi
push dword [ebp - 0x32c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x328], edi
ja 0x1058ae7
cmp esi, ebx
je 0x1058ae7
cmp dword [ebp + 0x14], ebx
je 0x1058ae7
mov edi, 0x104
push edi
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x1058ae7
push 0x1009318
push edi
lea eax, [ebp - 0x20c]
push eax
call fcn.010358a6
test eax, eax
jl 0x1058ae7
lea eax, [ebp - 0x324]
push eax
lea eax, [ebp - 0x328]
push eax
lea eax, [ebp - 0x20c]
push eax
mov dword [ebp - 0x324], ebx
call fcn.010569c6
test eax, eax
jl 0x1058ae7
movzx eax, word [ebp - 0x324]
cmp eax, dword [ebp + 0x14]
sbb esi, esi
inc esi
pop edi
mov eax, esi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.01047480
leave
ret 0x10
Function at 0x1059184
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x224
mov eax, dword [0x1072c48]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x220], ebx
cmp eax, ebx
je 0x10592a1
lea eax, [ebp - 0x214]
push eax
push 0x20019
push ebx
push 0x10097f8
push 0x80000002
mov dword [ebp - 0x214], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x10592a1
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push edi
push 4
pop edi
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x21c]
push eax
lea eax, [ebp - 0x210]
push eax
push ebx
push 0x10097e0
push dword [ebp - 0x214]
mov dword [ebp - 0x21c], ebx
mov dword [ebp - 0x210], edi
mov dword [ebp - 0x218], edi
call esi
test eax, eax
jne 0x1059293
cmp dword [ebp - 0x210], edi
jne 0x1059293
xor edi, edi
inc edi
cmp dword [ebp - 0x21c], edi
jne 0x1059293
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x210]
push eax
push ebx
push 0x1002250
push dword [ebp - 0x214]
mov dword [ebp - 0x210], edi
mov dword [ebp - 0x218], 0x104
call esi
test eax, eax
jne 0x1059293
cmp dword [ebp - 0x210], edi
jne 0x1059293
lea eax, [ebp - 0x20c]
push eax
push dword [ebp + 0xc]
push dword [ebp - 0x224]
call fcn.01035831
test eax, eax
jl 0x1059293
mov dword [ebp - 0x220], edi
push dword [ebp - 0x214]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov ecx, dword [ebp - 4]
mov eax, dword [ebp - 0x220]
xor ecx, ebp
pop ebx
call fcn.01047480
leave
ret 8
Function at 0x105954e
Capabilities:
Persist via run registry key
Query or enumerate registry value
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ecx
push esi
xor esi, esi
mov dword [ebp - 4], esi
cmp dword [ebp + 8], esi
jne 0x105956a
mov eax, 0x80004003
jmp 0x1059730
push 0x14
pop eax
xor ecx, ecx
push 2
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
pop ecx
mov dword [ebp - 8], eax
cmp eax, esi
jne 0x1059593
mov eax, 0x8007000e
jmp 0x1059730
push ebx
push edi
lea eax, [ebp - 4]
push eax
push 2
push esi
push 0x1002568
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x1059617
push 0x208
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov ebx, eax
pop ecx
cmp ebx, esi
je 0x105960e
mov edi, 0x104
push edi
push ebx
call fcn.01058169
test eax, eax
je 0x1059607
push 0x100a0a4
push edi
push ebx
call fcn.010358a6
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x10595e2
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
push ebx
push 1
push esi
push 0x100a084
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push ebx
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push esi
lea eax, [ebp - 4]
push eax
push esi
push 3
push esi
push esi
push esi
push 0x100a010
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov edi, eax
cmp edi, esi
jne 0x10596d4
push dword [0x10746c0]
mov ebx, 0x1007cc0
push ebx
push 0x14
push dword [ebp - 8]
call fcn.0103592d
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
jmp 0x105967d
cmp dword [0x10746c0], 0x3e8
jge 0x1059690
inc dword [0x10746c0]
push dword [0x10746c0]
push ebx
push 0x14
push dword [ebp - 8]
call fcn.0103592d
add esp, 0x10
push esi
push esi
push esi
push esi
push dword [ebp - 8]
push dword [ebp - 4]
call edi
test eax, eax
je 0x105965a
mov eax, dword [ebp + 8]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x1059696
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
push dword [ebp + 8]
push 2
push esi
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
cmp edi, esi
jne 0x10596c7
inc dword [0x10746c0]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp edi, esi
je 0x10596f7
jle 0x10596e2
and edi, 0xffff
or edi, 0x80070000
push edi
push dword [ebp + 8]
push 0x1009fcc
push 2
call fcn.01055c8a
add esp, 0x10
jmp 0x1059723
push dword [ebp + 8]
push 0x1009f90
push 4
call fcn.01055c8a
add esp, 0xc
cmp dword [ebp + 0x10], esi
je 0x105971e
push esi
push dword [ebp + 8]
mov ecx, 0x10746c8
push 8
call fcn.01058b32
mov edi, 0xd2af9
push dword [ebp - 8]
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
mov eax, edi
pop edi
pop ebx
pop esi
leave
ret 0xc
Function at 0x105973a
Capabilities:
Persist via run registry key
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
push ebx
xor ebx, ebx
mov dword [ebp - 4], ebx
cmp dword [ebp + 8], ebx
je 0x105982b
cmp dword [ebp + 0xc], ebx
je 0x105982b
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
push edi
lea eax, [ebp - 4]
push eax
push 3
push ebx
mov edi, 0x1002568
push edi
push 0x80000002
call esi
cmp eax, ebx
je 0x105978d
lea eax, [ebp - 4]
push eax
push 3
push ebx
push edi
push 0x80000001
call esi
mov esi, eax
cmp esi, ebx
jne 0x10597ea
push dword [ebp + 0xc]
push 0x100a124
push dword [ebp - 4]
call fcn.010576be
mov edi, eax
cmp edi, ebx
je 0x10597d8
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, bx
jne 0x10597a9
sub eax, edx
sar eax, 1
lea eax, [eax + eax + 2]
push eax
push dword [ebp + 0xc]
push 1
push ebx
push edi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push edi
mov esi, eax
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x10597dd
mov esi, 0x80004005
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp esi, ebx
je 0x105980d
jle 0x10597f8
and esi, 0xffff
or esi, 0x80070000
push esi
push dword [ebp + 8]
push 0x100a0e0
push 2
call fcn.01055c8a
add esp, 0x10
jmp 0x1059825
push 0x100a0b8
push 4
call fcn.01055c50
or dword [0x10747d0], 1
mov esi, 0xd2af9
pop edi
mov eax, esi
pop esi
jmp 0x1059830
mov eax, 0x80004003
pop ebx
leave
ret 8
Function at 0x1059fde
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x20
push esi
xor esi, esi
push esi
push esi
push esi
push esi
push esi
push esi
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x14]
push eax
push esi
push esi
push esi
push dword [ebp + 8]
mov dword [ebp - 0x14], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
test eax, eax
je 0x105a017
xor eax, eax
jmp 0x105a167
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x105a01d
sub eax, edx
sar eax, 1
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0xc]
cmp dword [ebp - 8], eax
jbe 0x105a039
mov eax, dword [ebp - 8]
inc dword [ebp - 0x14]
add eax, 5
xor ecx, ecx
push 2
pop edx
mov dword [ebp - 0xc], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
pop ecx
mov dword [ebp - 0x18], eax
cmp eax, esi
jne 0x105a068
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x105a010
push ebx
push edi
mov dword [ebp - 4], esi
mov dword [ebp - 0x10], esi
mov edi, 0x2001f
push dword [ebp - 0x10]
push dword [ebp + 0xc]
push 0x1004eb4
push dword [ebp - 0xc]
push dword [ebp - 0x18]
call fcn.0103592d
add esp, 0x14
lea eax, [ebp - 4]
push eax
push edi
push esi
push dword [ebp - 0x18]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x105a13c
cmp dword [ebp + 0x10], esi
je 0x105a116
push 0x208
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov ebx, eax
pop ecx
cmp ebx, esi
je 0x105a116
lea eax, [ebp - 8]
push eax
push ebx
lea eax, [ebp - 0x1c]
push eax
push esi
push esi
push dword [ebp - 4]
mov dword [ebp - 0x1c], 1
mov dword [ebp - 8], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x105a10f
cmp dword [ebp - 0x1c], 1
jne 0x105a10f
mov eax, ebx
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x105a0ef
sub eax, edx
sar eax, 1
je 0x105a10f
push dword [ebp + 0x10]
push ebx
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x105a133
push ebx
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc dword [ebp - 0x10]
mov eax, dword [ebp - 0x10]
mov dword [ebp - 4], esi
cmp eax, dword [ebp - 0x14]
jbe 0x105a075
jmp 0x105a159
push ebx
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
jmp 0x105a159
push esi
lea eax, [ebp - 4]
push eax
push esi
push edi
push esi
push esi
push esi
push dword [ebp - 0x18]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x105a159
mov dword [ebp - 4], esi
push dword [ebp - 0x18]
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
mov eax, dword [ebp - 4]
pop ecx
pop edi
pop ebx
pop esi
leave
ret 0xc
Function at 0x105a171
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
xor esi, esi
push esi
push esi
push esi
push esi
push esi
push esi
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x14]
push eax
push esi
push esi
push esi
push dword [ebp + 8]
mov dword [ebp - 0x14], esi
mov dword [ebp - 8], esi
mov dword [ebp - 4], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
test eax, eax
je 0x105a1aa
xor eax, eax
jmp 0x105a2bf
mov eax, dword [ebp + 0xc]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x105a1b0
sub eax, edx
sar eax, 1
mov dword [ebp - 4], eax
mov eax, dword [ebp - 8]
cmp dword [ebp - 4], eax
jbe 0x105a1cc
mov eax, dword [ebp - 4]
push ebx
add eax, 5
xor ecx, ecx
push 2
pop edx
mov dword [ebp - 8], eax
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov ebx, eax
pop ecx
cmp ebx, esi
jne 0x105a1f5
xor eax, eax
jmp 0x105a2be
push edi
mov dword [ebp - 0x10], esi
mov dword [ebp - 0xc], esi
cmp dword [ebp - 0x14], esi
jbe 0x105a2b2
push dword [ebp - 0xc]
push dword [ebp + 0xc]
push 0x1004eb4
push dword [ebp - 8]
push ebx
call fcn.0103592d
add esp, 0x14
lea eax, [ebp - 0x10]
push eax
push 3
push esi
push ebx
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x105a2a3
push 0x208
call sub.msvcrt.dll_void____cdecl_operator_new___unsigned_int_
mov edi, eax
pop ecx
cmp edi, esi
je 0x105a29a
lea eax, [ebp - 4]
push eax
push edi
lea eax, [ebp - 0x18]
push eax
push esi
push esi
push dword [ebp - 0x10]
mov dword [ebp - 0x18], 1
mov dword [ebp - 4], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x105a293
cmp dword [ebp - 0x18], 1
jne 0x105a293
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x105a273
sub eax, edx
sar eax, 1
je 0x105a293
push dword [ebp + 0x10]
push edi
call dword [sym.imp.msvcrt.dll__wcsicmp]
pop ecx
pop ecx
test eax, eax
je 0x105a2c4
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 0x14]
jb 0x105a205
push ebx
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
xor ebx, ebx
pop ecx
mov eax, ebx
pop edi
pop ebx
pop esi
leave
ret 0xc
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push edi
call sub.msvcrt.dll_void___cdecl_operator_delete___void__
jmp 0x105a2ba