Function at 0x40d660
Capabilities:
Delete registry key
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x330
mov eax, dword [0x415884]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0x14]
push edi
push 0x403aec
push 0x401108
mov dword [ebp - 0x320], eax
mov edi, 0x104
mov eax, dword [ebp + 0x10]
push 0x403b04
mov dword [ebp - 0x324], eax
lea eax, [ebp - 0x310]
push edi
push eax
mov dword [ebp - 0x31c], edx
mov dword [ebp - 0x32c], ecx
call fcn.0040c045
add esp, 0x14
test eax, eax
je 0x40d6d8
movzx eax, ax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00413fa0
leave
ret 0x10
lea eax, [ebp - 0x328]
mov dl, 1
push eax
lea ecx, [ebp - 0x310]
call fcn.0040d5a7
test eax, eax
jne 0x40d6c7
push 0x7b
pop eax
push dword [ebp - 0x31c]
lea ecx, [ebp - 0x106]
mov word [ebp - 0x108], ax
push 0x7f
pop edx
call fcn.0040c61c
and dword [ebp - 0x31c], 0
lea ecx, [ebp - 0x108]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0x31c]
jne 0x40d71e
sub ecx, edx
sar ecx, 1
push 0x7d
pop eax
mov word [ebp + ecx*2 - 0x108], ax
lea ecx, [ecx*2 + 2]
cmp ecx, edi
jae 0x40d9eb
xor eax, eax
mov word [ebp + ecx - 0x108], ax
mov eax, dword [ebp - 0x328]
cmp eax, edi
jbe 0x40d767
push 0x7a
pop eax
jmp 0x40d6c7
push 0x401310
lea ecx, [ebp - 0x108]
sub edi, eax
push ecx
push dword [ebp - 0x32c]
lea eax, [ebp + eax*2 - 0x312]
push 0x403b14
push edi
push eax
call fcn.0040c045
add esp, 0x18
test eax, eax
jne 0x40d6c4
xor edi, edi
lea eax, [ebp - 0x310]
push edi
push edi
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegDeleteKeyExW]
test ebx, ebx
jne 0x40d7d3
cmp dword [ebp - 0x324], edi
jne 0x40d7d3
cmp dword [ebp - 0x320], edi
jne 0x40d7d3
cmp dword [esi], edi
jne 0x40d7d3
cmp dword [esi + 4], edi
jne 0x40d7d3
xor eax, eax
jmp 0x40d6c7
lea eax, [ebp - 0x330]
push eax
lea eax, [ebp - 0x314]
push eax
push edi
push 3
push edi
push edi
push edi
lea eax, [ebp - 0x310]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x40d6c7
test ebx, ebx
je 0x40d851
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, di
jne 0x40d80a
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push ebx
push 1
xor ebx, ebx
push ebx
push 0x401324
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
je 0x40d853
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, edi
jmp 0x40d6c7
xor ebx, ebx
mov edx, dword [ebp - 0x320]
test edx, edx
je 0x40d894
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40d862
sub ecx, edi
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 1
push ebx
push 0x401338
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
jne 0x40d83e
mov edx, dword [ebp - 0x324]
test edx, edx
je 0x40d8d9
mov ecx, edx
lea edi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, bx
jne 0x40d8a3
sub ecx, edi
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 1
push ebx
push 0x401358
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
jne 0x40d83e
mov ecx, dword [esi]
test ecx, ecx
je 0x40d944
cmp word [ecx + 2], bx
jbe 0x40d944
xor eax, eax
cmp byte [ecx], al
push 4
setne al
mov dword [ebp - 0x318], eax
lea eax, [ebp - 0x318]
push eax
push 4
push ebx
push 0x401390
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
jne 0x40d83e
mov ecx, dword [esi]
movzx eax, word [ecx + 2]
add eax, eax
push eax
lea eax, [ecx + 4]
push eax
push 3
push ebx
push 0x4013d4
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
jne 0x40d83e
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x40d9c0
cmp word [ecx + 2], bx
jbe 0x40d9c0
xor eax, eax
cmp byte [ecx], al
push 4
setne al
mov dword [ebp - 0x318], eax
lea eax, [ebp - 0x318]
push eax
push 4
push ebx
push 0x4013b0
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov edi, eax
test edi, edi
jne 0x40d83e
mov ecx, dword [esi + 4]
movzx eax, word [ecx + 2]
add eax, eax
push eax
lea eax, [ecx + 4]
push eax
push 3
push ebx
push 0x4013e8
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
test esi, esi
je 0x40d9c0
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, esi
jmp 0x40d6c7
push 4
lea eax, [ebp - 0x318]
mov dword [ebp - 0x318], 1
push eax
push 4
push ebx
push 0x401244
push dword [ebp - 0x314]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
mov esi, eax
jmp 0x40d9ad
call fcn.004140f0
int3