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

Disassembly:
sub esp, 0xe1c
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x129]
mov byte [esp + 0x128], bl
mov byte [esp + 0x24], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ecx, 0x40
xor eax, eax
lea edi, [esp + 0x25]
xor ebp, ebp
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x10]
mov esi, 0x104
push eax
push str.SOFTWAREKasperskyLabSetupFolders
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x28], esi
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], esi
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov eax, dword [esp + 0x10]
cmp eax, ebp
je 0x40f90d
lea ecx, [esp + 0x18]
lea edx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x18]
push edx
push ecx
lea edx, [esp + 0x28]
push ebp
lea ecx, [esp + 0x138]
push edx
push ecx
push ebp
push eax
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
test eax, eax
jne 0x40f8f1
mov ebx, dword [sym.imp.MSVCRT.dll__mbsnbcpy]
cmp dword [esp + 0x14], 1
jne 0x40f84b
mov al, byte [esp + 0x24]
test al, al
je 0x40f84b
cmp byte [esp + 0x25], 0x3a
jne 0x40f84b
mov edi, str._avp.exe
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x24]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x24]
and ecx, 3
test eax, eax
rep movsb byte es:[edi], byte [esi]
je 0x40f846
mov ecx, 0x100
xor eax, eax
lea edi, [esp + 0x22c]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x22c]
test ecx, ecx
je 0x40f846
mov ecx, 0x200
lea edi, [esp + 0x62c]
lea edx, [esp + 0x24]
mov byte [esp + 0x22c], al
rep stosd dword es:[edi], eax
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsRelativeA]
test eax, eax
je 0x40f801
lea eax, [esp + 0x62c]
push 0x800
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x62c]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
lea edx, [esp + 0x24]
lea eax, [esp + 0x62c]
push edx
lea ecx, [esp + 0x630]
push eax
push ecx
call dword [sym.imp.SHLWAPI.dll_PathCombineA]
lea edx, [esp + 0x62c]
push 0x400
lea eax, [esp + 0x230]
push edx
push eax
jmp 0x40f813
lea ecx, [esp + 0x24]
push 0x400
lea edx, [esp + 0x230]
push ecx
push edx
call ebx
add esp, 0xc
lea eax, [esp + 0x22c]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40f846
push 3
lea ecx, [esp + 0x12c]
push 0x42d6fc
push ecx
call dword [sym.imp.MSVCRT.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x40f8c5
mov esi, 0x104
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x24]
lea edx, [esp + 0x18]
rep stosd dword es:[edi], eax
mov ecx, 0x41
lea edi, [esp + 0x128]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x24]
push edx
lea ecx, [esp + 0x18]
push eax
push ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x28]
push 0
lea eax, [esp + 0x138]
inc ebp
push edx
push eax
push ebp
push ecx
mov dword [esp + 0x34], 1
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], esi
call dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
test eax, eax
je 0x40f70d
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xe1c
ret 8
mov eax, dword [esp + 0xe30]
test eax, eax
je 0x40f8e9
mov edx, dword [esp + 0xe34]
mov byte [eax], 0
push edx
push eax
lea eax, [esp + 0x2c]
push eax
call fcn.0041fe60
add esp, 0xc
mov dword [esp + 0x20], 1
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x20]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xe1c
ret 8
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0xe1c
ret 8