Function at 0x10021590
Capabilities:
Check if file exists
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100cf340
mov eax, dword fs:[0]
push eax
sub esp, 0x64
mov eax, dword [0x1010f404]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
xor eax, eax
mov dword [ebp - 0x6c], ebx
mov dword [ebp - 0x5c], eax
mov dword [ebp - 4], eax
call fcn.10004450
mov ecx, eax
test ecx, ecx
je 0x10021fbb
mov eax, dword [ecx]
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x3c], edi
xor eax, eax
mov dword [ebp - 0x64], 0x208
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x58], eax
lea eax, [ebp - 0x58]
push eax
push dword [ebp + 0x10]
push 0
push dword [ebp + 0xc]
push ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x10021611
or ebx, 0xffffffff
jmp 0x10021f63
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
mov byte [ebp - 4], 2
jge 0x1002164e
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10021fc5
xor eax, eax
mov dword [edi - 0xc], 0x104
push eax
push eax
push eax
push eax
mov word [edi + 0x208], ax
lea eax, [ebp - 0x64]
push eax
push edi
push 0
push dword [ebp - 0x58]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
push dword [edi - 8]
mov esi, eax
push edi
call fcn.100a8086
add esp, 8
test eax, eax
js 0x10021fc5
cmp eax, dword [edi - 8]
jg 0x10021fc5
xor ecx, ecx
mov dword [edi - 0xc], eax
or ebx, 0xffffffff
mov word [edi + eax*2], cx
test esi, esi
jne 0x1002198c
cmp esi, 0xea
je 0x1002198c
lea eax, [ebp - 0x50]
mov dword [ebp - 0x50], 0
push eax
push 0x20019
push 0
push edi
push dword [ebp - 0x58]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x100218d5
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x10021706
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10021fc5
xor eax, eax
mov dword [edi - 0xc], 0x104
mov word [edi + 0x208], ax
call fcn.10004450
test eax, eax
je 0x10021fbb
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x34], eax
push edi
lea ecx, [ebp - 0x34]
mov byte [ebp - 4], 3
call fcn.10004160
test al, al
jne 0x1002176c
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10021753
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x34]
call fcn.100045a0
mov eax, dword [ebp - 0x48]
mov byte [ebp - 4], 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x44], eax
je 0x10021798
mov esi, dword [ebp - 0x34]
lea eax, [esi - 0x10]
push eax
call fcn.10004290
mov ecx, dword [ebp - 0x38]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
add dword [ebp - 0x48], 4
jmp 0x100217a8
lea ecx, [ebp - 0x34]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.10020f30
mov esi, dword [ebp - 0x34]
mov byte [ebp - 4], 2
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100217c3
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x48]
sub eax, dword [ebp - 0x4c]
cmp eax, 4
jae 0x100218cc
call fcn.10004450
test eax, eax
je 0x10021fbb
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x2c], eax
push str.none
lea ecx, [ebp - 0x2c]
mov byte [ebp - 4], 5
call fcn.10004160
test al, al
jne 0x10021875
push 0
push 0
push 0xffffffffffffffff
push str.none
push 0
push 3
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea edx, [eax - 1]
mov dword [ebp - 0x54], edx
test edx, edx
jle 0x1002186d
mov esi, dword [ebp - 0x2c]
mov ecx, 1
mov eax, dword [esi - 8]
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x10021843
push edx
lea ecx, [ebp - 0x2c]
call fcn.10004500
mov esi, dword [ebp - 0x2c]
mov edx, dword [ebp - 0x54]
push edx
push esi
push 0xffffffffffffffff
push str.none
push 0
push 3
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x54]
cmp eax, dword [esi - 8]
jg 0x10021fc5
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
jmp 0x10021878
lea ecx, [ebp - 0x2c]
call fcn.1000a4a0
mov esi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x48]
mov byte [ebp - 4], 6
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x44], eax
je 0x100218a1
lea eax, [esi - 0x10]
push eax
call fcn.10004290
mov ecx, dword [ebp - 0x38]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
add dword [ebp - 0x48], 4
jmp 0x100218b1
lea ecx, [ebp - 0x2c]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.10020f30
mov esi, dword [ebp - 0x2c]
mov byte [ebp - 4], 2
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x100218cc
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x50]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
inc dword [ebp - 0x40]
lea edx, [edi - 0x10]
mov dword [ebp - 0x64], 0x208
cmp dword [edx + 4], 0
mov esi, dword [edx]
je 0x1002192b
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x1002190b
cmp dword [edi - 8], 0
jl 0x10021fc5
xor eax, eax
mov dword [edi - 0xc], 0
mov word [edi], ax
jmp 0x1002192b
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x1002191e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0xc]
lea edi, [eax + 0x10]
mov dword [ebp - 0x3c], edi
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x1002194f
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10021fc5
xor eax, eax
mov dword [edi - 0xc], 0x104
push eax
push eax
push eax
push eax
mov word [edi + 0x208], ax
lea eax, [ebp - 0x64]
push eax
mov eax, dword [ebp - 0x40]
push edi
push eax
push dword [ebp - 0x58]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov esi, eax
test esi, esi
je 0x100216b2
push dword [ebp - 0x58]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x54], eax
cmp esi, eax
je 0x10021ee2
nop dword [eax]
mov ecx, 0x1011315c
mov dword [ebp - 0x30], ecx
nop dword [eax + eax]
cmp byte [ecx + 9], 0
jne 0x10021eb3
call fcn.10004450
mov ecx, eax
test ecx, ecx
je 0x10021fbb
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x40], eax
push dword [esi]
lea eax, [ebp - 0x40]
mov byte [ebp - 4], 7
push dword [ebp + 0xc]
push str._s_s
push eax
call fcn.10004390
add esp, 0x10
call fcn.10004450
mov ecx, eax
test ecx, ecx
je 0x10021fbb
mov eax, dword [ecx]
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x34], esi
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x100
or eax, ecx
mov byte [ebp - 4], 8
jge 0x10021a40
push 0x100
lea ecx, [ebp - 0x34]
call fcn.10004500
mov esi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x40]
push esi
push dword [eax + 4]
push edi
push dword [ebp - 0x6c]
call fcn.10082ea0
add esp, 0x10
test eax, eax
je 0x10021e77
push dword [esi - 8]
push esi
call fcn.100a8086
add esp, 8
test eax, eax
js 0x10021fc5
cmp eax, dword [esi - 8]
jg 0x10021fc5
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov eax, dword [esi - 0xc]
test eax, eax
je 0x10021e77
cmp eax, 4
jl 0x10021e77
test eax, eax
jg 0x10021aa1
or edi, 0xffffffff
jmp 0x10021abb
push 0x22
push esi
call fcn.100a47f3
mov edi, eax
add esp, 8
test edi, edi
jne 0x10021ab7
or edi, 0xffffffff
jmp 0x10021abb
sub edi, esi
sar edi, 1
mov ecx, dword [esi - 0xc]
lea eax, [ecx - 1]
test eax, eax
js 0x10021ae1
cmp eax, ecx
jge 0x10021ae1
lea eax, [esi + eax*2]
push 0x22
push eax
call fcn.100a47f3
add esp, 8
test eax, eax
je 0x10021ae1
sub eax, esi
sar eax, 1
jmp 0x10021ae4
or eax, 0xffffffff
test edi, edi
jne 0x10021c29
mov edx, dword [esi - 0xc]
lea edi, [edx - 1]
cmp eax, edi
jne 0x10021c29
lea eax, [edx - 2]
xor ecx, ecx
test eax, eax
cmovns ecx, eax
cmp ecx, 0x7ffffffe
jg 0x10021fd9
lea eax, [ecx + 1]
cmp eax, edx
lea eax, [esi - 0x10]
mov dword [ebp - 0x60], eax
cmovle edi, ecx
mov ecx, dword [eax]
mov dword [ebp - 0x38], edi
xor edi, edi
cmp edx, 1
cmovge edi, dword [ebp - 0x38]
mov dword [ebp - 0x38], edi
test ecx, ecx
je 0x10021b3e
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x10021b4c
call fcn.10004450
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
lea eax, [esi + 2]
test ecx, ecx
je 0x10021fbb
test eax, eax
jne 0x10021b63
test edi, edi
jne 0x10021fc5
mov eax, dword [ecx]
push 2
push edi
call dword [eax]
test eax, eax
je 0x10021fd4
lea edi, [eax + 0x10]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x68], edi
test eax, eax
js 0x10021fc5
cmp eax, dword [edi - 8]
jg 0x10021fc5
mov dword [edi - 0xc], eax
xor ecx, ecx
add eax, eax
push eax
mov word [eax + edi], cx
lea ecx, [esi + 2]
push ecx
push eax
push edi
call fcn.10004920
add esp, 0x10
mov eax, dword [ebp - 0x5c]
lea ecx, [edi - 0x10]
or eax, 1
mov byte [ebp - 4], 9
mov dword [ebp - 0x5c], eax
lea eax, [esi - 0x10]
cmp ecx, eax
je 0x10021c08
mov esi, dword [ebp - 0x60]
cmp dword [esi + 0xc], 0
jl 0x10021bf9
mov eax, dword [ecx]
cmp eax, dword [esi]
jne 0x10021bf9
push ecx
call fcn.10004290
add esp, 4
mov dword [ebp - 0x38], eax
mov ecx, ebx
lea edx, [esi + 0xc]
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x10021bf1
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x38]
lea esi, [eax + 0x10]
mov dword [ebp - 0x34], esi
jmp 0x10021c08
push dword [edi - 0xc]
lea ecx, [ebp - 0x34]
push edi
call fcn.100045a0
mov esi, dword [ebp - 0x34]
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021c29
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x5c], eax
call fcn.10004450
mov ecx, eax
test ecx, ecx
je 0x10021fbb
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x60], eax
mov edi, dword [ebp - 0x30]
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xa
push dword [edi]
push eax
call fcn.100526e0
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x28]
mov byte [ebp - 4], 0xb
cmovae eax, dword [ebp - 0x28]
push eax
lea eax, [ebp - 0x60]
push 0x100df860
push eax
call fcn.10004390
add esp, 0x14
cmp byte [edi + 8], 0
mov edi, dword [ebp - 0x60]
je 0x10021d1e
mov ecx, dword [edi - 0xc]
mov eax, edi
sub eax, esi
sar eax, 1
mov dword [ebp - 0x70], eax
mov eax, dword [esi - 0xc]
mov dword [ebp - 0x50], eax
test ecx, ecx
js 0x10021fc5
push ecx
push edi
call fcn.100a8086
mov edx, eax
mov ecx, 0x7fffffff
mov eax, dword [ebp - 0x50]
sub ecx, edx
add esp, 8
mov dword [ebp - 0x38], edx
cmp ecx, eax
jl 0x10021fc5
add edx, eax
js 0x10021fc5
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x10021ce3
push edx
lea ecx, [ebp - 0x34]
call fcn.10004500
mov esi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x50]
lea edx, [esi + eax*2]
cmp eax, ecx
jbe 0x10021cf2
mov edx, edi
mov eax, dword [ebp - 0x38]
add eax, eax
push eax
push edx
push eax
lea eax, [esi + ecx*2]
push eax
call fcn.10004920
mov eax, dword [ebp - 0x38]
add esp, 0x10
add eax, dword [ebp - 0x50]
cmp eax, dword [esi - 8]
jg 0x10021fc5
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
test edi, edi
je 0x10021e1e
cmp dword [esi - 0xc], 0
jl 0x10021e1e
push edi
push esi
call fcn.100a44f5
add esp, 8
test eax, eax
je 0x10021e1e
sub eax, esi
sar eax, 1
cmp eax, 4
jl 0x10021e1e
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [ebp - 0x28]
test eax, eax
jne 0x10021dba
call fcn.10008cf0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021d7d
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 7
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10021d98
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x40]
mov eax, ebx
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10021ead
mov ecx, dword [edx]
push edx
jmp 0x10021ea8
mov eax, dword [ebp - 0x30]
mov byte [eax + 9], 1
call fcn.10008cf0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021de1
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 7
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10021dfc
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x40]
mov eax, ebx
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10021ead
mov ecx, dword [edx]
push edx
jmp 0x10021ea8
lea ecx, [ebp - 0x28]
call fcn.10008cf0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021e41
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 7
add esi, 0xfffffff0
mov eax, ebx
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10021e5c
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x40]
mov eax, ebx
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10021ead
mov ecx, dword [edx]
push edx
jmp 0x10021ea8
mov eax, ebx
mov byte [ebp - 4], 7
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10021e92
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, ebx
mov byte [ebp - 4], 2
add edi, 0xfffffff0
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021ead
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x30]
add ecx, 0x10
mov dword [ebp - 0x30], ecx
lea eax, [ecx - 4]
cmp eax, 0x10113208
jne 0x100219c0
add esi, 4
mov dword [ebp - 0x2c], esi
cmp esi, dword [ebp - 0x54]
jne 0x100219b0
mov eax, dword [ebp - 0x48]
mov esi, dword [ebp - 0x4c]
mov edi, dword [ebp - 0x3c]
mov dword [ebp - 0x54], eax
mov byte [ebp - 4], 1
test esi, esi
je 0x10021f63
cmp esi, eax
je 0x10021f17
mov edi, dword [ebp - 0x54]
mov edx, dword [esi]
mov eax, ebx
sub edx, 0x10
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10021f0a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x10021ef1
mov esi, dword [ebp - 0x4c]
mov edi, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x44]
sub eax, esi
sar eax, 2
lea ecx, [eax*4]
mov eax, esi
cmp ecx, 0x1000
jb 0x10021f44
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x10021fcf
push ecx
push esi
call fcn.1007d115
add esp, 8
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov eax, ebx
mov byte [ebp - 4], 0
add edi, 0xfffffff0
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10021f7e
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp + 0xc]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x10021f9d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1007d494
mov esp, ebp
pop ebp
ret 0xc
push 0x80004005
call fcn.10003fe0
push 0x80070057
call fcn.10003fe0
call fcn.100a7ba5
call fcn.100046d0
push 0x80070216
call fcn.10003fe0
int3