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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4099c0
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x40e0a0]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ecx, dword [0x40fc08]
mov esi, dword [ecx]
xor eax, eax
mov byte [ebp - 0xd], al
cmp esi, ecx
je 0x40157f
jmp 0x4013d2
xor eax, eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], eax
mov edi, dword [esi + 0x10]
mov ebx, dword [esi + 0xc]
lea eax, [ebp - 0x28]
push eax
call fcn.00401170
test eax, eax
jne 0x4014d2
push 0x208
mov dword [ebp - 0x1c], 1
call fcn.00403460
add esp, 4
lea ecx, [ebp - 0x18]
push ecx
mov edi, eax
mov eax, dword [ebp - 0x28]
push edi
lea edx, [ebp - 0x1c]
push edx
push 0
push 0
push eax
mov dword [ebp - 0x18], 0x104
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4014d2
mov edx, dword [section..data]
mov eax, dword [edx + 0xc]
mov ecx, section..data
call eax
lea ebx, [eax + 0x10]
mov dword [ebp - 0x14], ebx
mov byte [ebp - 4], 1
test edi, edi
je 0x401474
test edi, 0xffff0000
jne 0x401478
movzx edi, di
push edi
call fcn.00401080
add esp, 4
test eax, eax
je 0x40149d
push eax
mov eax, edi
lea edi, [ebp - 0x14]
call fcn.00402500
jmp 0x40149a
xor eax, eax
jmp 0x40148f
mov eax, edi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x401480
sub eax, edx
sar eax, 1
push edi
mov edi, eax
lea ebx, [ebp - 0x14]
call fcn.004022b0
mov ebx, dword [ebp - 0x14]
mov byte [ebp - 4], 0
cmp dword [ebx - 0xc], 0
je 0x4014b6
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x401553
add ebx, 0xfffffff0
lea ecx, [ebx + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4014d2
mov ecx, dword [ebx]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push ebx
call edx
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x28]
xor edi, edi
cmp eax, edi
je 0x4014ec
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov dword [ebp - 0x28], edi
cmp byte [esi + 0x15], 0
mov dword [ebp - 0x24], edi
jne 0x401532
mov ecx, dword [esi + 8]
cmp byte [ecx + 0x15], 0
jne 0x401514
mov eax, dword [ecx]
cmp byte [eax + 0x15], 0
jne 0x401510
mov ecx, eax
mov eax, dword [ecx]
cmp byte [eax + 0x15], 0
je 0x401506
mov esi, ecx
jmp 0x401532
mov eax, dword [esi + 4]
cmp byte [eax + 0x15], 0
jne 0x401530
lea ecx, [ecx]
cmp esi, dword [eax + 8]
jne 0x401530
mov esi, eax
mov eax, dword [eax + 4]
cmp byte [eax + 0x15], 0
je 0x401520
mov esi, eax
cmp esi, dword [0x40fc08]
jne 0x4013d0
mov al, byte [ebp - 0xd]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
add ebx, 0xfffffff0
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40156f
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
mov eax, dword [ebp - 0x28]
test eax, eax
je 0x40157d
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret