Function at 0x408e80
Capabilities:
Delete registry key
Query or enumerate registry value

Disassembly:
push ebp
lea ebp, [esp - 0xc134]
mov eax, 0xc134
call fcn.004aa510
push 0xffffffffffffffff
push 0x4c84a8
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x4e7744]
xor eax, ebp
mov dword [ebp + 0xc130], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea eax, [ebp - 0x18]
push eax
push 0xf013f
push 0
push str.SOFTWAREMicrosoftWindowsCurrentVersionExplorerSyncRootManager
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x408ef2
push eax
push str.Failed_to_open_reg_SyncRootMananger__reason:__d_n
call fcn.0040b3d0
add esp, 8
or eax, 0xffffffff
jmp 0x409035
push 0x20
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
call fcn.004aa4a8
mov dword [eax], eax
mov dword [eax + 4], eax
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
mov dword [ebp - 4], 0
push eax
push dword [ebp - 0x18]
call fcn.00404eb0
mov edi, dword [ebp - 0x28]
add esp, 0xc
mov dword [ebp - 0x1c], edi
mov esi, dword [edi]
cmp esi, edi
je 0x408feb
mov dword [ebp - 0x38], 0x100
lea esp, [esp]
cmp dword [esi + 0x1c], 8
lea ebx, [esi + 8]
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x14], ebx
jb 0x408f54
mov eax, dword [ebx]
mov dword [ebp - 0x14], eax
mov eax, dword [ebx + 0x10]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x408fcb
push 0x100
lea eax, [ebp]
push 0
push eax
call fcn.004ac5e0
add esp, 0xc
mov ecx, 0x4caa3c
mov edx, 0x100
jmp 0x408f80
movzx eax, word [ecx]
cmp ax, dx
jae 0x40905f
movzx eax, al
add ecx, 2
mov byte [ebp + eax], 1
cmp ecx, 0x4caa3e
jne 0x408f80
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebx + 0x10]
lea edx, [eax + ecx*2]
mov ecx, eax
cmp eax, edx
jae 0x408fcb
mov edi, edi
movzx eax, word [ecx]
cmp ax, word [ebp - 0x38]
jae 0x408fc4
cmp byte [ebp + eax], 0
jne 0x409058
add ecx, 2
cmp ecx, edx
jb 0x408fb0
cmp dword [ebx + 0x14], 8
jb 0x408fd3
mov ebx, dword [ebx]
push ebx
push 0x4caa40
call fcn.0040b3d0
add esp, 8
mov esi, dword [esi]
cmp esi, edi
jne 0x408f40
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 0x28]
mov eax, dword [ecx + 4]
mov dword [eax], 0
mov edi, dword [ecx]
test edi, edi
je 0x409026
mov esi, dword [edi]
lea eax, [edi + 8]
push eax
lea eax, [ebp - 0x28]
push eax
call fcn.004018c0
push 0x20
push edi
call fcn.004aa4d8
add esp, 0x10
mov edi, esi
test esi, esi
jne 0x409006
push 0x20
push dword [ebp - 0x28]
call fcn.004aa4d8
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0xc130]
xor ecx, ebp
call fcn.004aa4f4
lea esp, [ebp + 0xc134]
pop ebp
ret
sub ecx, dword [ebp - 0x14]
sar ecx, 1
jmp 0x4090a9
mov edx, dword [ebp - 0x14]
mov ecx, edx
mov eax, dword [ebp - 0x20]
lea eax, [edx + eax*2]
cmp edx, eax
jae 0x4090a6
mov edi, edi
mov edx, 1
mov eax, 0x4caa3c
lea ebx, [ebx]
movzx edi, word [ecx]
cmp word [eax], di
mov edi, dword [ebp - 0x1c]
je 0x409058
add eax, 2
sub edx, 1
jne 0x409080
mov edi, dword [ebx + 0x10]
add ecx, 2
mov edx, dword [ebp - 0x14]
lea eax, [edx + edi*2]
mov edi, dword [ebp - 0x1c]
cmp ecx, eax
jb 0x409070
or ecx, 0xffffffff
cmp ecx, 0xffffffff
je 0x408fcb
cmp dword [ebx + 0x10], ecx
mov eax, ebx
mov dword [ebp + 0x100], 0
cmovb ecx, dword [ebx + 0x10]
cmp dword [ebx + 0x14], 8
mov dword [ebp + 0x110], 0
mov dword [ebp + 0x114], 7
jb 0x4090e1
mov eax, dword [ebx]
push ecx
push eax
lea ecx, [ebp + 0x100]
call fcn.00409f70
lea eax, [ebp + 0x100]
push str.SynologyDrive
push eax
call fcn.004013a0
mov edx, dword [ebp + 0x114]
add esp, 8
mov byte [ebp - 0xd], al
cmp edx, 8
jb 0x409148
mov ecx, dword [ebp + 0x100]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40913b
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409451
push edx
push ecx
call fcn.004aa4d8
mov al, byte [ebp - 0xd]
add esp, 8
test al, al
jne 0x40915f
cmp dword [ebx + 0x14], 8
jb 0x409154
mov ebx, dword [ebx]
push ebx
push str.SyncRoot_ID___s__is_not_created_by_Synology_Drive_Client_n
jmp 0x408fd9
mov ecx, dword [ebx + 0x10]
mov eax, 0x7ffffffe
sub eax, ecx
cmp eax, 0xe
jb 0x40944c
cmp dword [ebx + 0x14], 8
mov eax, ebx
jb 0x40917c
mov eax, dword [ebx]
push 0xe
push str.UserSyncRoots
push ecx
push eax
push ebx
push dword [ebp - 0x34]
lea ecx, [ebp + 0x100]
call fcn.00401b00
cmp dword [ebp + 0x114], 8
lea ecx, [ebp - 0x30]
push ecx
push 0xf013f
lea eax, [ebp + 0x100]
cmovae eax, dword [ebp + 0x100]
push 0
push eax
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov edx, dword [ebp + 0x114]
mov ebx, eax
test ebx, ebx
setne al
mov byte [ebp - 0xd], al
cmp edx, 8
jb 0x40920a
mov ecx, dword [ebp + 0x100]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4091fd
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409451
push edx
push ecx
call fcn.004aa4d8
mov al, byte [ebp - 0xd]
add esp, 8
test al, al
je 0x409219
push ebx
push str.Failed_to_open_reg_UserSyncRoots__reason___d_n
jmp 0x408fd9
push 0x7ffe
lea eax, [ebp + 0x130]
push 0
push eax
call fcn.004ac5e0
push 0x3fff
lea eax, [ebp + 0x8130]
mov dword [ebp - 0x3c], 0x3fff
push 0
push eax
call fcn.004ac5e0
add esp, 0x18
mov dword [ebp - 0x2c], 0x3fff
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp + 0x8130]
push eax
push 0
push 0
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp + 0x130]
push eax
push 0
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
test eax, eax
je 0x409284
push eax
push str.Failed_to_enum__reason___d_n
jmp 0x408fd9
mov eax, dword [ebp - 0x2c]
xor ecx, ecx
mov dword [ebp + 0x118], 0
mov dword [ebp - 0x20], eax
mov dword [ebp + 0x128], 0
mov dword [ebp + 0x12c], 7
mov word [ebp + 0x118], cx
cmp eax, 7
ja 0x4092e2
lea ebx, [eax + eax]
mov dword [ebp + 0x128], eax
push ebx
lea eax, [ebp + 0x8130]
push eax
lea eax, [ebp + 0x118]
push eax
call fcn.004ac060
add esp, 0xc
xor eax, eax
mov word [ebp + ebx + 0x118], ax
jmp 0x409350
cmp eax, 0x7ffffffe
ja 0x40944c
mov ebx, eax
or ebx, 7
cmp ebx, 0x7ffffffe
jbe 0x409301
mov ebx, 0x7ffffffe
jmp 0x40930c
cmp ebx, 0xa
mov eax, 0xa
cmovb ebx, eax
lea eax, [ebx + 1]
push eax
lea ecx, [ebp + 0x118]
call fcn.00409b60
mov ecx, dword [ebp - 0x20]
mov dword [ebp + 0x12c], ebx
mov dword [ebp + 0x128], ecx
mov dword [ebp - 0x14], eax
lea ebx, [ecx + ecx]
push ebx
lea ecx, [ebp + 0x8130]
push ecx
push eax
call fcn.004ac060
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor ecx, ecx
mov word [ebx + eax], cx
mov dword [ebp + 0x118], eax
lea eax, [ebp - 0xd]
mov byte [ebp - 4], 1
push eax
lea eax, [ebp + 0x118]
mov byte [ebp - 0xd], 0
push eax
call fcn.00401480
add esp, 8
lea eax, [ebp + 0x118]
cmp dword [ebp + 0x12c], 8
cmovae eax, dword [ebp + 0x118]
push eax
call sub.cldapi.dll_CfUnregisterSyncRoot
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [ebp - 0x34]
mov eax, ebx
cmp dword [ebx + 0x14], 8
jb 0x40939b
mov eax, dword [ebx]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegDeleteTreeW]
test eax, eax
je 0x409406
cmp dword [ebx + 0x14], 8
jb 0x4093b1
mov ebx, dword [ebx]
push eax
push ebx
push str.Failed_to_RegDeleteTreeW___s___reason___d_n
call fcn.0040b3d0
mov edx, dword [ebp + 0x12c]
add esp, 0xc
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x408fe1
mov ecx, dword [ebp + 0x118]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x4093fa
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409451
push edx
push ecx
call fcn.004aa4d8
jmp 0x408fde
mov edx, dword [ebp + 0x12c]
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x408fe1
mov ecx, dword [ebp + 0x118]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x409440
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x409451
push edx
push ecx
call fcn.004aa4d8
jmp 0x408fde
call fcn.00409af0
call fcn.004aeecf
int3