Function at 0x10040160
Capabilities:
Check if file exists
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1016ceec
mov eax, dword fs:[0]
push eax
sub esp, 0x454
mov eax, dword [0x101d7c7c]
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, ecx
call fcn.1000cdc0
mov ecx, eax
test ecx, ecx
je 0x100404c5
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x454], eax
push str.__PID
lea ecx, [ebp - 0x454]
mov dword [ebp - 4], 0
call fcn.1000e2c0
test al, al
jne 0x100401f0
mov ecx, str.__PID
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100401d0
sub ecx, edx
sar ecx, 1
push ecx
push str.__PID
lea ecx, [ebp - 0x454]
call fcn.1000d900
lea esi, [ebx + 0x48]
mov dword [ebp - 4], 1
push esi
lea eax, [ebp - 0x454]
mov ecx, ebx
push eax
call fcn.1003e3b0
mov edx, dword [ebp - 0x454]
or edi, 0xffffffff
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10040230
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [esi]
cmp dword [eax - 0xc], 0
jne 0x100402d7
call fcn.1000cdc0
mov ecx, eax
test ecx, ecx
je 0x100404cf
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x454], eax
push 0xd0
lea ecx, [ebp - 0x454]
mov dword [ebp - 4], 2
call fcn.1000e2c0
test al, al
jne 0x100402a0
mov ecx, 0xd0
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10040280
sub ecx, edx
sar ecx, 1
push ecx
push 0xd0
lea ecx, [ebp - 0x454]
call fcn.1000d900
lea eax, [ebp - 0x454]
mov dword [ebp - 4], 3
push eax
mov ecx, esi
call fcn.1001ce50
mov edx, dword [ebp - 0x454]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x100402d7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.10112750
lea eax, [ebp - 0x438]
mov dword [ebp - 0x45c], 1
push 1
push eax
mov dword [ebp - 0x458], 0x208
call fcn.10038cd0
add esp, 0x14
cmp dword [eax + 0x14], 8
jb 0x10040317
mov eax, dword [eax]
mov edi, dword [sym.imp.SHLWAPI.dll_SHGetValueW]
lea ecx, [ebp - 0x458]
push ecx
lea ecx, [ebp - 0x218]
push ecx
lea ecx, [ebp - 0x45c]
push ecx
push str.Setup_Path
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call edi
mov edx, dword [ebp - 0x424]
cmp edx, 8
jb 0x1004037f
mov ecx, dword [ebp - 0x438]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x10040375
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x100404d9
push edx
push ecx
call fcn.100acb1e
add esp, 8
cmp word [ebp - 0x218], 0
je 0x1004039b
push 0x10187e1c
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x100404a0
push 0x208
lea eax, [ebp - 0x420]
push 0
push eax
call fcn.10112750
lea eax, [ebp - 0x450]
mov dword [ebp - 0x460], 1
push 1
push eax
mov dword [ebp - 0x454], 0x208
call fcn.10038cd0
add esp, 0x14
cmp dword [eax + 0x14], 8
jb 0x100403f0
mov eax, dword [eax]
lea ecx, [ebp - 0x454]
push ecx
lea ecx, [ebp - 0x420]
push ecx
lea ecx, [ebp - 0x460]
push ecx
push str.VendorID
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call edi
lea ecx, [ebp - 0x450]
call fcn.100109e0
lea ecx, [ebp - 0x420]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10040426
sub ecx, edx
sar ecx, 1
je 0x100404a9
push ecx
lea eax, [ebp - 0x420]
push eax
lea ecx, [ebx + 0x1c]
call fcn.1000d900
lea ecx, [ebx + 0x1c]
call fcn.1003cc20
lea ecx, [ebx + 0x1c]
call fcn.1003cb20
mov eax, dword [ebx + 0x1c]
mov ecx, 0x10188c38
nop
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x10040486
test dx, dx
je 0x10040482
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x10040486
add eax, 4
add ecx, 4
test dx, dx
jne 0x10040460
xor eax, eax
jmp 0x1004048b
sbb eax, eax
or eax, 1
test eax, eax
jne 0x100404a9
push 7
push 0x10186308
lea ecx, [ebx + 0x1c]
call fcn.1000d900
jmp 0x100404a9
push esi
lea ecx, [ebx + 0x1c]
call fcn.1001ce50
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.100acb08
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.1000ae00
push 0x80004005
call fcn.1000ae00
call fcn.1012fb57
int3