Function at 0x40f530
Capabilities:
Access peb ldr_data
Query or enumerate registry value

Disassembly:
push 0xffffffffffffffff
push 0x478336
mov eax, dword fs:[0]
push eax
mov eax, 0x248c
call fcn.004765d0
mov eax, dword [0x4a6eb0]
xor eax, esp
mov dword [esp + 0x2488], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4a6eb0]
xor eax, esp
push eax
lea eax, [esp + 0x24a0]
mov dword fs:[0], eax
mov eax, dword [0x4a743c]
mov edx, dword [eax + 0xc]
mov esi, dword [esp + 0x24b4]
mov ebx, dword [esp + 0x24b8]
mov ecx, 0x4a743c
call edx
add eax, 0x10
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x24b0]
mov ecx, dword [str.SOFTWARESamsungKiesDeviceDB]
push eax
push ecx
lea edx, [esp + 0x24]
xor edi, edi
push 0x4831b0
push edx
mov dword [esp + 0x24b8], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x24], 0x2000
call fcn.00402e80
add esp, 0x10
mov ecx, ebx
call fcn.00401d90
lea eax, [esp + 0x18]
push eax
push 0x20019
push edi
mov edi, dword [esp + 0x28]
push edi
push SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov ebp, eax
test ebp, ebp
jne 0x40f61c
mov edx, dword [esp + 0x18]
push eax
push eax
push eax
push eax
lea ecx, [esp + 0x30]
push ecx
push eax
push eax
push eax
push eax
push eax
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
mov ebp, eax
test ebp, ebp
je 0x40f64a
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [edi - 0x10]
mov dword [esp + 0x24a8], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f643
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebp
jmp 0x40f7bd
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [esp + 0x1c]
lea edx, [esp + 0x4a0]
push edx
lea eax, [esp + 0x2c]
push eax
push 0
push esi
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov esi, eax
test esi, esi
je 0x40f6a9
mov edx, dword [esp + 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [edi - 0x10]
mov dword [esp + 0x24a8], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f6a2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
jmp 0x40f7bd
mov eax, dword [esp + 0x24]
cmp eax, 1
jne 0x40f6e1
mov eax, dword [esp + 0x14]
cmp eax, 0x2000
jae 0x40f789
xor ecx, ecx
shr eax, 1
lea edx, [esp + 0x49c]
mov word [esp + eax*2 + 0x49c], cx
push edx
mov ecx, ebx
call fcn.00403480
jmp 0x40f789
cmp eax, 3
jne 0x40f789
mov eax, dword [esp + 0x14]
push eax
call fcn.00468318
add esp, 4
lea ecx, [esp + 0x28]
mov edi, eax
call fcn.00452d30
push 0x10
push 0x10
push 0x4831d4
push str.0b1e96db05d64ea4
lea ecx, [esp + 0x38]
mov byte [esp + 0x24b8], 1
call fcn.00452d50
mov ecx, dword [esp + 0x14]
push 0
push ecx
push edi
lea edx, [esp + 0x4a8]
push edx
lea ecx, [esp + 0x38]
call fcn.00454160
mov eax, dword [esp + 0x14]
movzx ebp, byte [edi + eax - 1]
xor esi, esi
sub eax, ebp
je 0x40f76b
lea esp, [esp]
movzx ax, byte [esi + edi]
movzx ecx, ax
push ecx
mov ecx, ebx
call fcn.00402e20
mov edx, dword [esp + 0x14]
inc esi
sub edx, ebp
cmp esi, edx
jb 0x40f750
push edi
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
lea ecx, [esp + 0x28]
mov byte [esp + 0x24a8], 0
call fcn.00452d40
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [edi - 0x10]
mov dword [esp + 0x24a8], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40f7bb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [esp + 0x24a0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x2488]
xor ecx, esp
call fcn.004764f6
add esp, 0x2498
ret