Function at 0x406ac0
Capabilities:
Delete registry key
Get file version info
Query or enumerate registry value
Resolve function by parsing pe exports
Set registry value

Disassembly:
sub esp, 0x57c
mov eax, dword [0x441dac]
xor eax, esp
mov dword [esp + 0x578], eax
mov eax, dword [esp + 0x580]
push esi
push edi
mov ecx, 0xb
lea esi, [esp + 0x58c]
lea edi, [esp + 0x40]
rep movsd dword es:[edi], dword [esi]
mov edi, 0x104
push edi
mov dword [esp + 0x1c], eax
or eax, 0xffffffff
lea ecx, [esp + 0x278]
push 0
push ecx
mov dword [esp + 0x34], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x2c], edi
mov dword [esp + 0x20], edi
call fcn.00418130
add esp, 0xc
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x10]
push eax
push 0
push 0x2001f
push 0
push 0
push 0
push str.SOFTWAREHonor_technologiesCurrHandSetWinDriver
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
je 0x406b73
push str.INFO:_DriverInfo_Open_Key_error._n
call fcn.00404820
add esp, 4
pop edi
xor eax, eax
pop esi
mov ecx, dword [esp + 0x578]
xor ecx, esp
call fcn.0041811d
add esp, 0x57c
ret
cmp dword [esp + 0x30], 2
push ebx
jne 0x406cbc
mov ebx, dword [sym.imp.ADVAPI32.dll_RegEnumValueA]
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x27c]
push edx
mov edx, dword [esp + 0x18]
xor esi, esi
push esi
push esi
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x390]
push ecx
push esi
push edx
call ebx
test eax, eax
jne 0x406cbc
lea eax, [esp + 0x37c]
push str.MajorVersion
push eax
add esi, 1
call fcn.00417c00
add esp, 8
test eax, eax
je 0x406be9
mov ecx, dword [esp + 0x18]
push ecx
lea edx, [esp + 0x27c]
push edx
lea eax, [esp + 0x34]
push eax
call fcn.00419ea0
add esp, 0xc
lea ecx, [esp + 0x37c]
push str.MinorVersion
push ecx
call fcn.00417c00
add esp, 8
test eax, eax
je 0x406c1c
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x27c]
push eax
lea ecx, [esp + 0x30]
push ecx
call fcn.00419ea0
add esp, 0xc
lea edx, [esp + 0x37c]
push str.Customization
push edx
call fcn.00417c00
add esp, 8
test eax, eax
je 0x406c4f
mov eax, dword [esp + 0x18]
push eax
lea ecx, [esp + 0x27c]
push ecx
lea edx, [esp + 0x38]
push edx
call fcn.00419ea0
add esp, 0xc
lea eax, [esp + 0x37c]
push 0x42f4a0
push eax
call fcn.00417c00
lea ecx, [esp + 0x384]
push str.DualDriver
push ecx
call fcn.00417c00
push edi
lea edx, [esp + 0x28c]
push 0
push edx
mov dword [esp + 0x40], edi
mov dword [esp + 0x34], edi
call fcn.00418130
add esp, 0x1c
lea eax, [esp + 0x18]
push eax
lea ecx, [esp + 0x27c]
push ecx
mov ecx, dword [esp + 0x18]
push 0
push 0
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x390]
push eax
push esi
push ecx
call ebx
test eax, eax
je 0x406bb3
mov edx, dword [esp + 0x10]
push ebp
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp byte [0x4432d1], 0
mov esi, dword [esp + 0x6c]
mov edi, dword [esp + 0x68]
mov ebp, dword [esp + 0x70]
jne 0x406d21
cmp dword [esp + 0x34], ebp
jne 0x406d21
mov eax, dword [esp + 0x30]
cmp edi, eax
jb 0x406cf5
jne 0x406d21
mov eax, dword [esp + 0x2c]
cmp esi, eax
jae 0x406cff
mov eax, 0x4e2a
jmp 0x4070fd
jne 0x406d21
cmp byte [0x4432da], 0
je 0x406d21
push str.CheckUpdateDriverInfo_same_Version_not_installed_for_HiSuit_n
call fcn.00404820
add esp, 4
mov eax, 0x4e30
jmp 0x4070fd
push str.SOFTWAREHonor_technologiesCurrHandSetWinDriver
push 0x80000002
call dword [sym.imp.SHLWAPI.dll_SHDeleteKeyA]
push 0
lea eax, [esp + 0x18]
push eax
push 0
push 0x2001f
push 0
push 0
push 0
push str.SOFTWAREHonor_technologiesCurrHandSetWinDriver
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
je 0x406d6b
push str.INFO:_DriverInfo_Open_Key_error_for_update._n
call fcn.00404820
add esp, 4
jmp 0x4070fb
mov edx, dword [esp + 0x14]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
push 4
lea ecx, [esp + 0x14]
push ecx
push 4
push 0
push str.MajorVersion
push edx
mov dword [esp + 0x28], edi
call ebx
mov ecx, dword [esp + 0x14]
push 4
lea eax, [esp + 0x14]
push eax
push 4
push 0
push str.MinorVersion
push ecx
mov dword [esp + 0x28], esi
call ebx
mov eax, dword [esp + 0x14]
push 4
lea edx, [esp + 0x14]
push edx
push 4
push 0
push str.Customization
push eax
mov dword [esp + 0x28], ebp
call ebx
mov ecx, dword [esp + 0x20]
push ecx
lea edx, [esp + 0x488]
push edx
call fcn.00419ba9
lea eax, [esp + 0x7c]
push 0x42f410
push eax
call fcn.00419ba9
lea eax, [esp + 0x84]
add esp, 0x10
mov ecx, eax
nop
mov dl, byte [eax]
add eax, 1
test dl, dl
jne 0x406df0
lea edi, [esp + 0x484]
sub eax, ecx
mov esi, ecx
add edi, 0xffffffff
mov cl, byte [edi + 1]
add edi, 1
test cl, cl
jne 0x406e07
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor ebp, ebp
push ebp
lea ecx, [esp + 0x488]
push ecx
call sub.VERSION.dll_GetFileVersionInfoSizeA
mov edi, eax
push edi
call fcn.0040f57a
push edi
mov esi, eax
push ebp
push esi
call fcn.00418130
add esp, 0x10
push esi
push edi
push ebp
lea edx, [esp + 0x490]
push edx
call sub.VERSION.dll_GetFileVersionInfoA
test eax, eax
jne 0x406e66
push esi
call fcn.0040f57f
add esp, 4
jmp 0x4070f0
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x24]
push ecx
push 0x42f3dc
push esi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x4c], ebp
call sub.VERSION.dll_VerQueryValueA
test eax, eax
je 0x406e58
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 8]
mov edi, dword [sym.imp.WS2_32.dll_htonl]
push eax
call edi
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx + 0xc]
push edx
mov dword [esp + 0x44], eax
call edi
mov edi, dword [sym.imp.WS2_32.dll_htons]
mov ebp, eax
shr eax, 0x10
push eax
mov dword [esp + 0x48], ebp
call edi
movzx ecx, ax
push ecx
push ebp
call edi
movzx edx, ax
mov eax, dword [esp + 0x46]
push edx
push eax
call edi
mov edx, dword [esp + 0x48]
movzx ecx, ax
push ecx
push edx
call edi
movzx eax, ax
push eax
lea ecx, [esp + 0x188]
push str._d_d_d_d
push ecx
call fcn.00419ba9
push esi
call fcn.0040f57f
lea eax, [esp + 0x194]
add esp, 0x1c
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406f00
sub eax, edx
mov esi, eax
cmp esi, 4
jle 0x406f9f
lea eax, [esp + 0x178]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406f20
sub eax, edx
add eax, 0xfffffffe
push eax
lea edx, [esp + 0x17c]
push edx
lea eax, [esp + 0x7c]
push eax
call fcn.0041a210
lea eax, [esp + 0x184]
add esp, 0xc
lea edx, [eax + 1]
mov edi, edi
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406f50
mov esi, dword [sym.imp.SHLWAPI.dll_StrToIntA]
sub eax, edx
mov byte [esp + eax + 0x72], cl
lea ecx, [esp + 0x74]
push ecx
call esi
mov edi, eax
lea eax, [esp + 0x178]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x406f78
sub eax, edx
mov dx, word [esp + eax + 0x176]
lea eax, [esp + 0x74]
push eax
mov word [esp + 0x78], dx
mov byte [esp + 0x7a], cl
call esi
mov esi, eax
jmp 0x406fc9
push esi
lea ecx, [esp + 0x17c]
push ecx
lea edx, [esp + 0x7c]
push edx
call fcn.0041a210
add esp, 0xc
lea eax, [esp + 0x74]
push eax
mov byte [esp + esi + 0x78], 0
call dword [sym.imp.SHLWAPI.dll_StrToIntA]
mov edi, eax
xor esi, esi
mov edx, dword [esp + 0x14]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
push 0
lea ecx, [esp + 0x28]
push ecx
push 0
push 0x2001f
push 0
push 0
push 0
push str.SysInfo
push edx
call ebp
test eax, eax
jne 0x407061
mov ecx, dword [esp + 0x24]
push eax
lea eax, [esp + 0x1c]
push eax
push 0
push 0x2001f
push 0
push 0
push 0
push 0x42f3f8
push ecx
call ebp
test eax, eax
jne 0x407056
push 4
lea edx, [esp + 0x14]
push edx
push 4
push eax
mov eax, dword [esp + 0x28]
push str.MajorVersion
push eax
mov dword [esp + 0x28], edi
call ebx
mov edx, dword [esp + 0x18]
push 4
lea ecx, [esp + 0x14]
push ecx
push 4
push 0
push str.MinorVersion
push edx
mov dword [esp + 0x28], esi
call ebx
mov eax, dword [esp + 0x18]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x24]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x14]
push 0
lea edx, [esp + 0x28]
push edx
push 0
push 0x2001f
push 0
push 0
push 0
push str.InfInfo
push eax
call ebp
test eax, eax
jne 0x4070f0
mov edx, dword [esp + 0x24]
push eax
lea ecx, [esp + 0x1c]
push ecx
push eax
push 0x2001f
push eax
push eax
push eax
push 0x42f3e0
push edx
call ebp
test eax, eax
jne 0x4070e5
mov ecx, dword [esp + 0x18]
push 4
lea eax, [esp + 0x14]
push eax
push 4
push 0
push str.MajorVersion
push ecx
mov dword [esp + 0x28], edi
call ebx
mov eax, dword [esp + 0x18]
push 4
lea edx, [esp + 0x14]
push edx
push 4
push 0
push str.MinorVersion
push eax
mov dword [esp + 0x28], esi
call ebx
mov ecx, dword [esp + 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edx, dword [esp + 0x24]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor eax, eax
mov ecx, dword [esp + 0x588]
pop ebp
pop ebx
pop edi
pop esi
xor ecx, esp
call fcn.0041811d
add esp, 0x57c
ret