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

Disassembly:
sub esp, 0x230
mov eax, dword [0x4a6eb0]
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 0x4a6f64
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.0040fa80
add esp, 0xc
test eax, eax
jne 0x40fe62
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.00403170
add esp, 0x14
pop edi
pop esi
mov eax, 0xb7
pop ebp
mov ecx, dword [esp + 0x22c]
xor ecx, esp
call fcn.004764f6
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 SysReAllocString
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 0x40fec5
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 SysReAllocString
call ebx
mov esi, eax
cmp esi, edi
jne 0x41004a
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 0x40feef
mov ecx, dword [esp + 0x10]
push ecx
jmp 0x40ffec
mov eax, dword [esp + 0x24]
cmp eax, 1
jb 0x40ff3c
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 0x40ff23
mov eax, dword [esp + 0x10]
push eax
jmp 0x40ffec
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 0x483224
mov esi, 4
push eax
mov dword [esp + 0x38], esi
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x40ff83
cmp dword [esp + 0x30], esi
jne 0x40ff83
cmp dword [esp + 0x20], esi
jne 0x40ff83
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x14]
jbe 0x40ff83
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 0x483224
push edx
call edi
mov eax, dword [esp + 0x14]
push eax
lea ecx, [esp + 0x40]
mov edx, 0x100
push 0x48321c
push ecx
mov dword [esp + 0x28], edx
call fcn.0040e8f0
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 0x410004
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x4a6f64
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
jmp 0x410099
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 0x410016
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 0x410059
mov ecx, dword [esp + 0x18]
push ecx
call ebx
push 0x4a6f64
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
jmp 0x410099
mov edx, dword [esp + 0x34]
mov eax, dword [str.DEVICEKEY]
push edx
push eax
lea ecx, [esp + 0x44]
push ecx
call dword [sym.imp.MSVCR90.dll__wtoi]
add esp, 4
push eax
call fcn.0040f160
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x38]
add esp, 0xc
push ecx
mov dword [eax], edx
call ebx
push 0x4a6f64
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.004764f6
add esp, 0x230
ret