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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4406ad
mov eax, dword fs:[0]
push eax
sub esp, 0xa2c
mov eax, dword [0x450398]
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 eax, dword [0x452c00]
mov ecx, dword [0x452bfc]
cmp ecx, eax
je 0x40976d
mov edx, dword [ebp - 0xa34]
push edx
push ecx
push eax
call fcn.00418ee0
mov edi, dword [0x452c00]
mov esi, eax
mov eax, dword [ebp - 0xa34]
add esp, 0xc
push eax
mov eax, esi
call fcn.00419030
add esp, 4
mov dword [0x452c00], esi
xor ecx, ecx
push 0x1fe
push ecx
lea edx, [ebp - 0x20e]
push edx
mov word [ebp - 0x210], cx
call fcn.00429770
mov eax, dword [section..data]
mov edx, dword [eax + 0xc]
mov edi, 0x100
add esp, 0xc
mov ecx, section..data
mov dword [ebp - 0xa14], edi
call edx
add eax, 0x10
mov dword [ebp - 0xa1c], eax
mov dword [ebp - 4], 0
cmp dword [0x452bb0], 2
jne 0x4097d1
push str.SOFTWAREWow6432NodekingsoftOffice6.0Common
lea eax, [ebp - 0xa1c]
push eax
mov ebx, 0x2f
jmp 0x4097e2
push str.SOFTWAREkingsoftOffice6.0Common
lea ecx, [ebp - 0xa1c]
push ecx
mov ebx, 0x23
call fcn.00416d10
mov eax, dword [ebp - 0xa1c]
lea edx, [ebp - 0xa18]
push edx
push 0x20119
push 0
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x409a16
mov edx, dword [section..data]
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
mov edx, dword [section..data]
add eax, 0x10
mov dword [ebp - 0xa30], eax
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
mov edx, dword [section..data]
add eax, 0x10
mov dword [ebp - 0xa2c], eax
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
add eax, 0x10
mov dword [ebp - 0xa28], eax
push 0x200
lea ecx, [ebp - 0x210]
push 0
push ecx
mov byte [ebp - 4], 1
call fcn.00429770
add esp, 0xc
lea edx, [ebp - 0xa14]
push edx
mov edx, dword [ebp - 0xa18]
lea eax, [ebp - 0x210]
push eax
lea ecx, [ebp - 0xa24]
push ecx
push 0
push str.DisplayName
push edx
mov dword [ebp - 0xa14], edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4099fa
lea eax, [ebp - 0x210]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4098b4
sub eax, edx
lea ecx, [ebp - 0x210]
sar eax, 1
push ecx
lea edx, [ebp - 0xa2c]
push edx
mov ebx, eax
call fcn.00416d10
push 0x200
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00429770
add esp, 0xc
lea ecx, [ebp - 0xa14]
push ecx
mov ecx, dword [ebp - 0xa18]
lea edx, [ebp - 0x210]
push edx
lea eax, [ebp - 0xa24]
push eax
push 0
push str.InstallRoot
push ecx
mov dword [ebp - 0xa14], edi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4099fa
lea edx, [ebp - 0x210]
lea edi, [ebp - 0xa30]
call fcn.00413c90
push 0x200
lea edx, [ebp - 0x210]
push 0
push edx
call fcn.00429770
add esp, 0xc
lea eax, [ebp - 0xa14]
push eax
mov eax, dword [ebp - 0xa18]
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0xa24]
push edx
push 0
push 0x4472b0
push eax
mov dword [ebp - 0xa14], 0x100
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x409994
lea edx, [ebp - 0x210]
lea edi, [ebp - 0xa28]
call fcn.00413c90
lea ecx, [ebp - 0xa30]
push ecx
lea edx, [ebp - 0xa20]
push edx
mov ebx, str.office6et.exe
call fcn.004141a0
add esp, 8
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0xa20]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4099cf
lea ecx, [ebp - 0xa30]
call fcn.00415880
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0xa20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4099f5
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edi, 0x100
mov ecx, dword [ebp - 0xa18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea esi, [ebp - 0xa30]
mov byte [ebp - 4], 0
call fcn.00409d90
xor edx, edx
push 0x7fe
push edx
lea eax, [ebp - 0xa0e]
push eax
mov word [ebp - 0xa10], dx
call fcn.00429770
add esp, 0xc
lea ecx, [ebp - 0xa10]
call fcn.00401e30
lea ecx, [ebp - 0xa34]
push ecx
lea ecx, [ebp - 0xa10]
call fcn.00413b80
lea edx, [ebp - 0xa34]
push edx
lea eax, [ebp - 0xa20]
push eax
mov ebx, str.SoftwareKingsoftOffice6.0Common
mov byte [ebp - 4], 3
call fcn.004141a0
add esp, 8
mov byte [ebp - 4], 4
mov ecx, dword [eax]
mov esi, dword [ebp - 0xa1c]
lea eax, [ecx - 0x10]
add esi, 0xfffffff0
cmp eax, esi
je 0x409ad2
cmp dword [esi + 0xc], 0
lea ebx, [esi + 0xc]
jl 0x409ac2
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x409ac2
call fcn.00416dc0
mov edi, eax
or eax, 0xffffffff
lock xadd dword [ebx], eax
dec eax
test eax, eax
jg 0x409ab2
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add edi, 0x10
mov dword [ebp - 0xa1c], edi
mov edi, 0x100
jmp 0x409ad2
mov ebx, dword [ecx - 0xc]
push ecx
lea ecx, [ebp - 0xa1c]
push ecx
call fcn.00416d10
mov byte [ebp - 4], 3
mov eax, dword [ebp - 0xa20]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409af8
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov edx, dword [ebp - 0xa1c]
lea ecx, [ebp - 0xa18]
push ecx
push 0x20119
push 0
push edx
push 0x80000003
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x409d19
mov eax, dword [section..data]
mov edx, dword [eax + 0xc]
mov ecx, section..data
call edx
add eax, 0x10
mov dword [ebp - 0xa30], eax
mov eax, dword [section..data]
mov edx, dword [eax + 0xc]
mov ecx, section..data
call edx
add eax, 0x10
mov dword [ebp - 0xa2c], eax
mov eax, dword [section..data]
mov edx, dword [eax + 0xc]
mov ecx, section..data
call edx
add eax, 0x10
mov dword [ebp - 0xa28], eax
push 0x200
lea eax, [ebp - 0x210]
push 0
push eax
mov byte [ebp - 4], 5
call fcn.00429770
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
add esp, 0xc
lea ecx, [ebp - 0xa14]
push ecx
mov ecx, dword [ebp - 0xa18]
lea edx, [ebp - 0x210]
push edx
lea eax, [ebp - 0xa24]
push eax
push 0
push str.DisplayName
push ecx
mov dword [ebp - 0xa14], edi
call esi
test eax, eax
jne 0x409d01
lea eax, [ebp - 0x210]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x409bc4
sub eax, edx
lea edx, [ebp - 0x210]
sar eax, 1
push edx
lea ecx, [ebp - 0xa2c]
push ecx
mov ebx, eax
call fcn.00416d10
push 0x200
lea edx, [ebp - 0x210]
push 0
push edx
call fcn.00429770
add esp, 0xc
lea eax, [ebp - 0xa14]
push eax
mov eax, dword [ebp - 0xa18]
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0xa24]
push edx
push 0
push str.InstallRoot
push eax
mov dword [ebp - 0xa14], edi
call esi
test eax, eax
jne 0x409d01
lea edx, [ebp - 0x210]
lea edi, [ebp - 0xa30]
call fcn.00413c90
push 0x200
lea ecx, [ebp - 0x210]
push 0
push ecx
call fcn.00429770
add esp, 0xc
lea edx, [ebp - 0xa14]
push edx
mov edx, dword [ebp - 0xa18]
lea eax, [ebp - 0x210]
push eax
lea ecx, [ebp - 0xa24]
push ecx
push 0
push 0x4472b0
push edx
mov dword [ebp - 0xa14], 0x100
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x409ca0
lea edx, [ebp - 0x210]
lea edi, [ebp - 0xa28]
call fcn.00413c90
lea eax, [ebp - 0xa30]
push eax
lea ecx, [ebp - 0xa20]
push ecx
mov ebx, str.office6et.exe
call fcn.004141a0
add esp, 8
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0xa20]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x409cdb
lea ecx, [ebp - 0xa30]
call fcn.00415880
mov byte [ebp - 4], 5
mov eax, dword [ebp - 0xa20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409d01
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [ebp - 0xa18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea esi, [ebp - 0xa30]
call fcn.00409d90
mov byte [ebp - 4], 0
mov eax, dword [ebp - 0xa34]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x409d3f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0xa1c]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x409d68
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
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.004267a3
mov esp, ebp
pop ebp
ret