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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100d1560
mov eax, dword fs:[0]
push eax
sub esp, 0x64
mov eax, dword [0x10111404]
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 0x1002364b
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 0x10022ca1
or ebx, 0xffffffff
jmp 0x100235f3
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 0x10022cde
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10023655
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.100aa026
add esp, 8
test eax, eax
js 0x10023655
cmp eax, dword [edi - 8]
jg 0x10023655
xor ecx, ecx
mov dword [edi - 0xc], eax
or ebx, 0xffffffff
mov word [edi + eax*2], cx
test esi, esi
jne 0x1002301c
cmp esi, 0xea
je 0x1002301c
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 0x10022f65
mov eax, dword [edi - 8]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, 0x104
or eax, ecx
jge 0x10022d96
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10023655
xor eax, eax
mov dword [edi - 0xc], 0x104
mov word [edi + 0x208], ax
call fcn.10004450
test eax, eax
je 0x1002364b
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 0x10022dfc
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10022de3
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 0x10022e28
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 0x10022e38
lea ecx, [ebp - 0x34]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.100225b0
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 0x10022e53
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 0x10022f5c
call fcn.10004450
test eax, eax
je 0x1002364b
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 0x10022f05
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 0x10022efd
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 0x10022ed3
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 0x10023655
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
jmp 0x10022f08
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 0x10022f31
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 0x10022f41
lea ecx, [ebp - 0x2c]
push ecx
push eax
lea ecx, [ebp - 0x4c]
call fcn.100225b0
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 0x10022f5c
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 0x10022fbb
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x10022f9b
cmp dword [edi - 8], 0
jl 0x10023655
xor eax, eax
mov dword [edi - 0xc], 0
mov word [edi], ax
jmp 0x10022fbb
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x10022fae
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 0x10022fdf
push 0x104
lea ecx, [ebp - 0x3c]
call fcn.10004500
mov edi, dword [ebp - 0x3c]
cmp dword [edi - 8], 0x104
jl 0x10023655
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 0x10022d42
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 0x10023572
nop dword [eax]
mov ecx, 0x1011515c
mov dword [ebp - 0x30], ecx
nop dword [eax + eax]
cmp byte [ecx + 9], 0
jne 0x10023543
call fcn.10004450
mov ecx, eax
test ecx, ecx
je 0x1002364b
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 0x1002364b
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 0x100230d0
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.10084dd0
add esp, 0x10
test eax, eax
je 0x10023507
push dword [esi - 8]
push esi
call fcn.100aa026
add esp, 8
test eax, eax
js 0x10023655
cmp eax, dword [esi - 8]
jg 0x10023655
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
mov eax, dword [esi - 0xc]
test eax, eax
je 0x10023507
cmp eax, 4
jl 0x10023507
test eax, eax
jg 0x10023131
or edi, 0xffffffff
jmp 0x1002314b
push 0x22
push esi
call fcn.100a6793
mov edi, eax
add esp, 8
test edi, edi
jne 0x10023147
or edi, 0xffffffff
jmp 0x1002314b
sub edi, esi
sar edi, 1
mov ecx, dword [esi - 0xc]
lea eax, [ecx - 1]
test eax, eax
js 0x10023171
cmp eax, ecx
jge 0x10023171
lea eax, [esi + eax*2]
push 0x22
push eax
call fcn.100a6793
add esp, 8
test eax, eax
je 0x10023171
sub eax, esi
sar eax, 1
jmp 0x10023174
or eax, 0xffffffff
test edi, edi
jne 0x100232b9
mov edx, dword [esi - 0xc]
lea edi, [edx - 1]
cmp eax, edi
jne 0x100232b9
lea eax, [edx - 2]
xor ecx, ecx
test eax, eax
cmovns ecx, eax
cmp ecx, 0x7ffffffe
jg 0x10023669
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 0x100231ce
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x100231dc
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 0x1002364b
test eax, eax
jne 0x100231f3
test edi, edi
jne 0x10023655
mov eax, dword [ecx]
push 2
push edi
call dword [eax]
test eax, eax
je 0x10023664
lea edi, [eax + 0x10]
mov eax, dword [ebp - 0x38]
mov dword [ebp - 0x68], edi
test eax, eax
js 0x10023655
cmp eax, dword [edi - 8]
jg 0x10023655
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 0x10023298
mov esi, dword [ebp - 0x60]
cmp dword [esi + 0xc], 0
jl 0x10023289
mov eax, dword [ecx]
cmp eax, dword [esi]
jne 0x10023289
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 0x10023281
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 0x10023298
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 0x100232b9
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 0x1002364b
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.10054400
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 0x100e18e8
push eax
call fcn.10004390
add esp, 0x14
cmp byte [edi + 8], 0
mov edi, dword [ebp - 0x60]
je 0x100233ae
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 0x10023655
push ecx
push edi
call fcn.100aa026
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 0x10023655
add edx, eax
js 0x10023655
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edx
or eax, ecx
jge 0x10023373
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 0x10023382
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 0x10023655
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
test edi, edi
je 0x100234ae
cmp dword [esi - 0xc], 0
jl 0x100234ae
push edi
push esi
call fcn.100a6495
add esp, 8
test eax, eax
je 0x100234ae
sub eax, esi
sar eax, 1
cmp eax, 4
jl 0x100234ae
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea ecx, [ebp - 0x28]
test eax, eax
jne 0x1002344a
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 0x1002340d
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 0x10023428
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 0x1002353d
mov ecx, dword [edx]
push edx
jmp 0x10023538
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 0x10023471
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 0x1002348c
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 0x1002353d
mov ecx, dword [edx]
push edx
jmp 0x10023538
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 0x100234d1
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 0x100234ec
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 0x1002353d
mov ecx, dword [edx]
push edx
jmp 0x10023538
mov eax, ebx
mov byte [ebp - 4], 7
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x10023522
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 0x1002353d
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, 0x10115208
jne 0x10023050
add esi, 4
mov dword [ebp - 0x2c], esi
cmp esi, dword [ebp - 0x54]
jne 0x10023040
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 0x100235f3
cmp esi, eax
je 0x100235a7
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 0x1002359a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 4
cmp esi, edi
jne 0x10023581
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 0x100235d4
mov esi, dword [esi - 4]
add ecx, 0x23
sub eax, esi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1002365f
push ecx
push esi
call fcn.1007f042
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 0x1002360e
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 0x1002362d
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.1007f3c1
mov esp, ebp
pop ebp
ret 0xc
push 0x80004005
call fcn.10003fe0
push 0x80070057
call fcn.10003fe0
call fcn.100a9b45
call fcn.100046d0
push 0x80070216
call fcn.10003fe0
int3