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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100b8ad0
mov eax, dword fs:[0]
push eax
sub esp, 0x64
mov eax, dword [0x100f2384]
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.10006280
mov ecx, eax
test ecx, ecx
je 0x1002256b
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 0x10021bc1
or ebx, 0xffffffff
jmp 0x10022513
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 0x10021bfe
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10006cb0
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10022575
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.10091b57
add esp, 8
test eax, eax
js 0x10022575
cmp eax, dword [edi - 8]
jg 0x10022575
xor ecx, ecx
mov dword [edi - 0xc], eax
or ebx, 0xffffffff
mov word [edi + eax*2], cx
test esi, esi
jne 0x10021f3c
cmp esi, 0xea
je 0x10021f3c
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 0x10021e85
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x10021cb6
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10006cb0
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10022575
xor eax, eax
mov dword [edi - 0xc], 0x104
mov word [edi + 0x208], ax
call fcn.10006280
test eax, eax
je 0x1002256b
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.10005920
test al, al
jne 0x10021d1c
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10021d03
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x34]
call fcn.10006dc0
mov eax, dword [ebp - 0x48]
mov byte [ebp - 4], 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x44], eax
je 0x10021d48
mov esi, dword [ebp - 0x34]
lea eax, [esi - 0x10]
push eax
call fcn.10005a50
mov ecx, dword [ebp - 0x38]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
add dword [ebp - 0x48], 4
jmp 0x10021d58
lea ecx, [ebp - 0x34]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.100215e0
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 0x10021d73
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 0x10021e7c
call fcn.10006280
test eax, eax
je 0x1002256b
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.10005920
test al, al
jne 0x10021e25
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 0x10021e1d
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 0x10021df3
push edx
lea ecx, [ebp - 0x2c]
call fcn.10006cb0
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 0x10022575
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
jmp 0x10021e28
lea ecx, [ebp - 0x2c]
call fcn.1000ece0
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 0x10021e51
lea eax, [esi - 0x10]
push eax
call fcn.10005a50
mov ecx, dword [ebp - 0x38]
add eax, 0x10
add esp, 4
mov dword [ecx], eax
add dword [ebp - 0x48], 4
jmp 0x10021e61
lea ecx, [ebp - 0x2c]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.100215e0
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 0x10021e7c
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 0x10021edb
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x10021ebb
cmp dword [edi - 8], 0
jl 0x10022575
xor eax, eax
mov dword [edi - 0xc], 0
mov word [edi], ax
jmp 0x10021edb
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x10021ece
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 0x10021eff
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10006cb0
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10022575
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 0x10021c62
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 0x10022492
nop dword [eax]
mov ecx, 0x100f66bc
mov dword [ebp - 0x30], ecx
nop dword [eax + eax]
cmp byte [ecx + 9], 0
jne 0x10022463
call fcn.10006280
mov ecx, eax
test ecx, ecx
je 0x1002256b
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.10018330
add esp, 0x10
call fcn.10006280
mov ecx, eax
test ecx, ecx
je 0x1002256b
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 0x10021ff0
push 0x100
lea ecx, [ebp - 0x34]
call fcn.10006cb0
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.1006c9a0
add esp, 0x10
test eax, eax
je 0x10022427
push dword [esi - 8]
push esi
call fcn.10091b57
add esp, 8
test eax, eax
js 0x10022575
cmp eax, dword [esi - 8]
jg 0x10022575
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov eax, dword [esi - 0xc]
test eax, eax
je 0x10022427
cmp eax, 4
jl 0x10022427
test eax, eax
jg 0x10022051
or edi, 0xffffffff
jmp 0x1002206b
push 0x22
push esi
call fcn.1008e25a
mov edi, eax
add esp, 8
test edi, edi
jne 0x10022067
or edi, 0xffffffff
jmp 0x1002206b
sub edi, esi
sar edi, 1
mov ecx, dword [esi - 0xc]
lea eax, [ecx - 1]
test eax, eax
js 0x10022091
cmp eax, ecx
jge 0x10022091
lea eax, [esi + eax*2]
push 0x22
push eax
call fcn.1008e25a
add esp, 8
test eax, eax
je 0x10022091
sub eax, esi
sar eax, 1
jmp 0x10022094
or eax, 0xffffffff
test edi, edi
jne 0x100221d9
mov edx, dword [esi - 0xc]
lea edi, [edx - 1]
cmp eax, edi
jne 0x100221d9
lea eax, [edx - 2]
xor ecx, ecx
test eax, eax
cmovns ecx, eax
cmp ecx, 0x7ffffffe
jg 0x10022589
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 0x100220ee
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x100220fc
call fcn.10006280
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
lea eax, [esi + 2]
test ecx, ecx
je 0x1002256b
test eax, eax
jne 0x10022113
test edi, edi
jne 0x10022575
mov eax, dword [ecx]
push 2
push edi
call dword [eax]
test eax, eax
je 0x10022584
lea edi, [eax + 0x10]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x68], edi
test eax, eax
js 0x10022575
cmp eax, dword [edi - 8]
jg 0x10022575
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.100089c0
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 0x100221b8
mov esi, dword [ebp - 0x60]
cmp dword [esi + 0xc], 0
jl 0x100221a9
mov eax, dword [ecx]
cmp eax, dword [esi]
jne 0x100221a9
push ecx
call fcn.10005a50
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 0x100221a1
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 0x100221b8
push dword [edi - 0xc]
lea ecx, [ebp - 0x34]
push edi
call fcn.10006dc0
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 0x100221d9
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.10006280
mov ecx, eax
test ecx, ecx
je 0x1002256b
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.1003d2b0
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 0x100c6cd8
push eax
call fcn.10018330
add esp, 0x14
cmp byte [edi + 8], 0
mov edi, dword [ebp - 0x60]
je 0x100222ce
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 0x10022575
push ecx
push edi
call fcn.10091b57
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 0x10022575
add edx, eax
js 0x10022575
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x10022293
push edx
lea ecx, [ebp - 0x34]
call fcn.10006cb0
mov esi, dword [ebp - 0x34]
mov eax, dword [ebp - 0x70]
mov ecx, dword [ebp - 0x50]
lea edx, [esi + eax*2]
cmp eax, ecx
jbe 0x100222a2
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.100089c0
mov eax, dword [ebp - 0x38]
add esp, 0x10
add eax, dword [ebp - 0x50]
cmp eax, dword [esi - 8]
jg 0x10022575
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
test edi, edi
je 0x100223ce
cmp dword [esi - 0xc], 0
jl 0x100223ce
push edi
push esi
call fcn.1008e321
add esp, 8
test eax, eax
je 0x100223ce
sub eax, esi
sar eax, 1
cmp eax, 4
jl 0x100223ce
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [ebp - 0x28]
test eax, eax
jne 0x1002236a
call fcn.10004bc0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x1002232d
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 0x10022348
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 0x1002245d
mov ecx, dword [edx]
push edx
jmp 0x10022458
mov eax, dword [ebp - 0x30]
mov byte [eax + 9], 1
call fcn.10004bc0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10022391
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 0x100223ac
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 0x1002245d
mov ecx, dword [edx]
push edx
jmp 0x10022458
lea ecx, [ebp - 0x28]
call fcn.10004bc0
mov byte [ebp - 4], 8
add edi, 0xfffffff0
mov eax, ebx
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x100223f1
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 0x1002240c
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 0x1002245d
mov ecx, dword [edx]
push edx
jmp 0x10022458
mov eax, ebx
mov byte [ebp - 4], 7
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10022442
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 0x1002245d
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, 0x100f6768
jne 0x10021f70
add esi, 4
mov dword [ebp - 0x2c], esi
cmp esi, dword [ebp - 0x54]
jne 0x10021f60
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 0x10022513
cmp esi, eax
je 0x100224c7
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 0x100224ba
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x100224a1
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 0x100224f4
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002257f
push ecx
push esi
call fcn.10066bf2
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 0x1002252e
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 0x1002254d
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.10066f71
mov esp, ebp
pop ebp
ret 0xc
push 0x80004005
call fcn.100058e0
push 0x80070057
call fcn.100058e0
call fcn.10091885
call fcn.100070e0
push 0x80070216
call fcn.100058e0
int3