Function at 0x10020040
Capabilities:
Delete registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x100f93d6
mov eax, dword fs:[0]
push eax
sub esp, 0x20c
mov eax, dword [0x1013306c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, dword [ebp + 0xc]
lea eax, [ebp - 0x208]
push 0x1f4
push 0
push eax
mov dword [ebp - 0x214], edi
call fcn.100cdcc0
add esp, 0xc
lea eax, [ebp - 0x208]
push dword [ebp + 8]
push 0x1011e2ac
push str._ls_d
push eax
call fcn.1004eca0
add esp, 0x10
call fcn.100164f0
mov ecx, eax
test ecx, ecx
je 0x100202cb
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x20c], eax
lea eax, [ebp - 0x208]
mov dword [ebp - 4], 0
push eax
lea ecx, [ebp - 0x20c]
call fcn.1004d7b0
or ebx, 0xffffffff
test al, al
jne 0x100202c0
push 0
push 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [ebp - 0x208]
push eax
push 0
push 3
call ebx
mov esi, dword [ebp - 0x20c]
lea edi, [eax - 1]
test edi, edi
jle 0x10020266
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, edi
or eax, ecx
jge 0x10020136
push edi
lea ecx, [ebp - 0x20c]
call fcn.1004e920
mov esi, dword [ebp - 0x20c]
push edi
push esi
push 0xffffffffffffffff
lea eax, [ebp - 0x208]
push eax
push 0
push 3
call ebx
cmp edi, dword [esi - 8]
jg 0x100202d5
xor eax, eax
mov dword [esi - 0xc], edi
mov word [esi + edi*2], ax
or ebx, 0xffffffff
mov edi, dword [ebp - 0x214]
lea eax, [ebp - 0x210]
mov dword [ebp - 4], 1
push eax
push 0xf003f
push 0
push esi
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x10020199
push str.CHalFunction::SetFWVersionRegValue
push str.__s__Error_opening_key.
call fcn.10057720
add esp, 8
push 0x1011e360
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegDeleteValueW]
mov ecx, edi
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100201b0
sub ecx, edx
sar ecx, 1
je 0x10020205
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x100201c6
sub ecx, edx
sar ecx, 1
lea eax, [ecx + ecx]
push eax
push edi
push 1
push 0
push str.FWVersion
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x10020205
push str.CHalFunction::SetFWVersionRegValue
push str.__s__Error_writing_to_Registry.
call fcn.10057720
add esp, 8
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test eax, eax
je 0x10020227
push str.CHalFunction::SetFWVersionRegValue
push str.__s__Error_closing_key.
call fcn.10057720
add esp, 8
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], ebx
dec ebx
test ebx, ebx
jg 0x10020243
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10070d87
mov esp, ebp
pop ebp
ret 8
cmp dword [esi - 0xc], 0
lea edx, [esi - 0x10]
mov edi, dword [edx]
je 0x10020159
cmp dword [edx + 0xc], 0
lea ecx, [edx + 0xc]
jge 0x10020295
cmp dword [esi - 8], 0
jl 0x100202d5
xor eax, eax
mov dword [esi - 0xc], 0
mov word [esi], ax
jmp 0x10020159
or ebx, 0xffffffff
mov eax, ebx
lock xadd dword [ecx], eax
dec eax
test eax, eax
jg 0x100202ab
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 0xc]
lea esi, [eax + 0x10]
mov dword [ebp - 0x20c], esi
jmp 0x1002015c
mov esi, dword [ebp - 0x20c]
jmp 0x10020162
push 0x80004005
call fcn.1001b7e0
push 0x80070057
call fcn.1001b7e0
int3