Function at 0x40d6b0
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0x230
mov eax, dword [0x49ef38]
xor eax, esp
mov dword [esp + 0x22c], eax
push ebp
mov ebp, dword [esp + 0x238]
push esi
mov esi, dword [esp + 0x244]
push edi
mov edi, dword [esp + 0x244]
push 0x49efd8
mov dword [esp + 0x34], edi
mov dword [esp + 0x2c], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
push edi
push ebp
call fcn.0040d310
add esp, 0xc
test eax, eax
jne 0x40d732
mov eax, dword [esi]
push eax
push edi
push ebp
push str.CDeviceDB::createDevice
push str._s____s__s___id__d____ERROR_ALREADY_EXISTS
call fcn.004031a0
add esp, 0x14
pop edi
pop esi
mov eax, 0xb7
pop ebp
mov ecx, dword [esp + 0x22c]
xor ecx, esp
call fcn.00471f66
add esp, 0x230
ret
push ebx
lea ecx, [esp + 0x10]
push ecx
xor edi, edi
push 0x2001f
mov dword [esi], edi
mov edx, dword [str.SOFTWARESamsungKiesDeviceDB]
push edi
push edx
push SysReAllocStringLen
mov dword [esp + 0x38], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x30], 0x100
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
je 0x40d795
mov ecx, dword [str.SOFTWARESamsungKiesDeviceDB]
push edi
lea eax, [esp + 0x14]
push eax
push edi
push 0x2001f
push edi
push edi
push edi
push ecx
push SysReAllocStringLen
call ebx
mov esi, eax
cmp esi, edi
jne 0x40d91a
mov eax, dword [esp + 0x10]
push edi
push edi
push edi
push edi
push edi
push edi
push edi
lea edx, [esp + 0x40]
push edx
push edi
push edi
push edi
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
mov esi, eax
cmp esi, edi
je 0x40d7bf
mov ecx, dword [esp + 0x10]
push ecx
jmp 0x40d8bc
mov eax, dword [esp + 0x24]
cmp eax, 1
jb 0x40d80c
push edi
push edi
push edi
push edi
lea edx, [esp + 0x2c]
push edx
mov edx, dword [esp + 0x24]
lea ecx, [esp + 0x50]
push ecx
dec eax
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
mov esi, eax
cmp esi, edi
je 0x40d7f3
mov eax, dword [esp + 0x10]
push eax
jmp 0x40d8bc
push 0xa
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.MSVCR90.dll_wcstol]
add esp, 0xc
mov dword [esp + 0x14], eax
lea eax, [esp + 0x20]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x2c]
push ecx
lea edx, [esp + 0x38]
push edx
push edi
push 0x47ead0
mov esi, 4
push eax
mov dword [esp + 0x38], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40d853
cmp dword [esp + 0x30], esi
jne 0x40d853
cmp dword [esp + 0x20], esi
jne 0x40d853
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x14]
jbe 0x40d853
mov dword [esp + 0x14], eax
mov edx, dword [esp + 0x10]
inc dword [esp + 0x14]
push esi
lea ecx, [esp + 0x18]
push ecx
push esi
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push 0x47ead0
push edx
call edi
mov eax, dword [esp + 0x14]
push eax
lea ecx, [esp + 0x40]
mov edx, 0x100
push 0x47eac8
push ecx
mov dword [esp + 0x28], edx
call fcn.0040c790
mov ecx, dword [esp + 0x1c]
add esp, 0xc
push 0
lea edx, [esp + 0x1c]
push edx
push 0
push 0x20006
push 0
push 0
push 0
lea eax, [esp + 0x58]
push eax
push ecx
call ebx
mov esi, eax
test esi, esi
je 0x40d8d4
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x49efd8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
jmp 0x40d97c
mov eax, dword [esp + 0x10]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push eax
call ebx
mov eax, ebp
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d8e6
sub eax, edx
mov edx, dword [str.Model_Name]
sar eax, 1
lea ecx, [eax + eax + 2]
mov eax, dword [esp + 0x18]
push ecx
push ebp
push 1
push 0
push edx
push eax
call edi
mov esi, eax
test esi, esi
je 0x40d929
mov ecx, dword [esp + 0x18]
push ecx
call ebx
push 0x49efd8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
jmp 0x40d97c
mov esi, dword [esp + 0x34]
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d932
mov ecx, dword [esp + 0x18]
sub eax, edx
sar eax, 1
lea edx, [eax + eax + 2]
mov eax, dword [str.DEVICEKEY]
push edx
push esi
push 1
push 0
push eax
push ecx
call edi
mov edx, dword [esp + 0x18]
mov esi, eax
push edx
test esi, esi
jne 0x40d918
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x30]
mov dword [ecx], eax
call ebx
push 0x49efd8
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor eax, eax
mov ecx, dword [esp + 0x23c]
pop ebx
pop edi
pop esi
pop ebp
xor ecx, esp
call fcn.00471f66
add esp, 0x230
ret