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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x406c
call fcn.0043d750
mov eax, dword [0x47b014]
xor eax, esp
mov dword [esp + 0x4068], eax
push ebx
mov ebx, ecx
mov dword [esp + 0xc], edx
push esi
push edi
mov dword [esp + 0x34], ebx
mov esi, dword [ebx + 8]
mov edx, dword [ebx + 0x10]
lea eax, [esi + esi*2]
lea edi, [edx + eax*8]
mov eax, esi
cmp edx, edi
cmovne eax, esi
mov ecx, eax
sub ecx, esi
je 0x403ff8
lea eax, [ecx + ecx*2]
shl eax, 3
push eax
push edi
push edx
call fcn.00424db0
mov eax, dword [ebx + 8]
add esp, 0xc
sub eax, esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [ebx + 8], eax
lea eax, [esp + 0x58]
push eax
push 9
push 0
push 0x4661b8
push closesocket
call esi
test eax, eax
jne 0x404311
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor ecx, ecx
push 0
push 0
mov eax, ecx
mov dword [esp + 0x64], 0x1000
push 0
inc ecx
push 0
mov dword [esp + 0x20], ecx
lea ecx, [esp + 0x6c]
push ecx
lea ecx, [esp + 0x84]
push ecx
push eax
push dword [esp + 0x74]
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
sub eax, 0
je 0x40406d
sub eax, 0xea
jne 0x40430b
mov ecx, dword [esp + 0x10]
jmp 0x404028
lea eax, [esp + 0x70]
push 0x4662d4
push eax
call fcn.00423018
add esp, 8
test eax, eax
je 0x40408a
mov edi, 1
jmp 0x4040a9
lea eax, [esp + 0x70]
push 0x4662e8
push eax
call fcn.00423018
mov ecx, dword [esp + 0x18]
add esp, 8
test eax, eax
je 0x404028
mov edi, 2
lea eax, [esp + 0x70]
push 0x4662c0
push eax
call fcn.00423018
mov ecx, dword [esp + 0x18]
add esp, 8
test eax, eax
je 0x404028
lea eax, [esp + 0x54]
push eax
push 1
push 0
lea eax, [esp + 0x7c]
push eax
push dword [esp + 0x68]
call esi
mov ecx, dword [esp + 0x10]
test eax, eax
jne 0x404028
lea eax, [esp + 0x5c]
mov dword [esp + 0x2c], edi
push eax
lea eax, [esp + 0x68]
mov dword [esp + 0x60], 4
push eax
lea eax, [esp + 0x68]
xor ebx, ebx
push eax
push ebx
push str.DeviceSerial
push dword [esp + 0x68]
xorps xmm0, xmm0
mov dword [esp + 0x34], ebx
xor esi, esi
movlpd qword [esp + 0x38], xmm0
mov dword [esp + 0x30], esi
mov dword [esp + 0x40], ebx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40421c
cmp dword [esp + 0x60], 4
jne 0x40421c
mov ebx, dword [esp + 0x64]
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x64], eax
cmp edi, 2
jne 0x404185
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x68]
push eax
lea eax, [esp + 0x68]
push eax
push esi
push str.PinCode
push dword [esp + 0x68]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40421c
cmp dword [esp + 0x60], 4
jne 0x40421c
mov eax, dword [esp + 0x64]
mov dword [esp + 0x28], eax
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x6c]
mov dword [esp + 0x60], 8
push eax
lea eax, [esp + 0x68]
push eax
push 0
push str.BtAddress
push dword [esp + 0x68]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40421c
cmp dword [esp + 0x5c], 8
jne 0x40421c
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x6c]
mov dword [esp + 0x20], eax
lea eax, [esp + 0x5c]
push eax
lea eax, [esp + 0x2074]
mov dword [esp + 0x28], ecx
push eax
lea eax, [esp + 0x68]
mov dword [esp + 0x64], 0x2000
push eax
push 0
push str.FunctionLibrary
push dword [esp + 0x68]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40421c
cmp dword [esp + 0x60], 1
jne 0x40421c
mov word [esp + 0x406e], ax
lea eax, [esp + 0x2070]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x404225
mov esi, 2
mov dword [esp + 0x18], esi
mov eax, dword [esp + 0x14]
test al, 1
je 0x404293
lea eax, [esp + 0x38]
mov dword [esp + 0x38], 0
xorps xmm0, xmm0
mov dword [esp + 0x3c], 0
push eax
mov edx, ebx
movlpd qword [esp + 0x44], xmm0
mov ecx, edi
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 0
call fcn.004035c0
add esp, 4
test al, al
jne 0x404270
or esi, 8
jmp 0x40428b
mov eax, dword [esp + 0x40]
cmp eax, dword [esp + 0x20]
jne 0x404284
mov eax, dword [esp + 0x44]
cmp eax, dword [esp + 0x24]
je 0x404287
or esi, 8
or esi, dword [esp + 0x38]
mov eax, dword [esp + 0x14]
mov dword [esp + 0x18], esi
test al, 2
je 0x4042e2
push 0
push 0
push 0
push 0
mov edx, ebx
mov ecx, edi
call fcn.00402720
add esp, 0x10
test eax, eax
jne 0x4042db
push ecx
lea eax, [esp + 0x2074]
mov edx, edi
push eax
push ebx
mov cl, 1
call fcn.004033c0
add esp, 0xc
test eax, eax
jne 0x4042db
lea eax, [esp + 0x2070]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4042e2
or esi, 8
mov dword [esp + 0x18], esi
mov ecx, dword [esp + 0x34]
lea eax, [esp + 0x18]
push eax
call fcn.004052a0
push dword [esp + 0x54]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call ebx
mov ecx, dword [esp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
jmp 0x404028
push dword [esp + 0x58]
call ebx
mov ecx, dword [esp + 0x4074]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00422009
mov esp, ebp
pop ebp
ret