Function at 0x406ca0
Capabilities:
Query or enumerate registry value
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40e630
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x110
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
test eax, eax
mov dword [ebp - 0x10], esp
mov dword [ebp - 4], 0
je 0x406f6e
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x406f6e
push edi
call fcn.00407d62
add esp, 4
test eax, eax
je 0x406f6e
mov ebx, dword [ebp + 0x14]
test ebx, ebx
je 0x406d0a
push ebx
call fcn.00407d62
add esp, 4
test eax, eax
je 0x406f6e
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x406d22
push esi
call fcn.00407d62
add esp, 4
test eax, eax
je 0x406f6e
test ebx, ebx
je 0x406d2e
test esi, esi
je 0x406f6e
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x14]
push eax
push 0x2001b
push 0
push edi
push ecx
mov dword [ebp - 0x14], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x406f2a
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x406f2a
mov ecx, 0x3f
lea edi, [ebp - 0x11b]
mov byte [ebp + 0x17], al
mov byte [ebp - 0x11c], al
rep stosd dword es:[edi], eax
test esi, esi
stosw word es:[edi], ax
mov dword [ebp - 0x1c], 0xff
mov dword [ebp - 0x18], 0
je 0x406e46
lea eax, [ebp - 0x1c]
lea ecx, [ebp - 0x11c]
push eax
lea eax, [ebp - 0x18]
push ecx
push eax
push 0
push esi
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x406e4a
test ebx, ebx
je 0x406e39
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x406e4a
mov eax, dword [ebp - 0x18]
cmp eax, 1
je 0x406dcd
cmp eax, 2
jne 0x406e4a
mov edi, dword [sym.imp.OLEAUT32.dll_SysReAllocString]
lea ecx, [ebp - 0x11c]
push ecx
call edi
mov esi, eax
test esi, esi
je 0x406dfb
push esi
call dword [sym.imp.USER32.dll_CharUpperW]
test eax, eax
je 0x406dfb
push eax
call edi
push esi
mov edi, eax
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
mov esi, edi
push ebx
call fcn.00407d62
mov edi, eax
add esp, 4
test edi, edi
je 0x406e30
test esi, esi
jne 0x406e12
xor eax, eax
jmp 0x406e19
push esi
call dword [sym.imp.OLEAUT32.dll_VariantInit]
cmp eax, edi
jb 0x406e30
push edi
push ebx
push esi
call fcn.00407d7f
add esp, 0xc
test eax, eax
jne 0x406e30
mov byte [ebp + 0x17], 1
push esi
call dword [sym.imp.OLEAUT32.dll_SysStringLen]
jmp 0x406e4a
mov eax, dword [ebp - 0x18]
cmp eax, 1
je 0x406e46
cmp eax, 2
jne 0x406e4a
mov byte [ebp + 0x17], 1
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, byte [ebp + 0x17]
test al, al
je 0x406f6e
mov edi, dword [ebp + 0xc]
mov eax, dword [ebp + 8]
push 1
push edi
push eax
call fcn.004050c0
mov esi, eax
mov eax, dword [0x41e04c]
add esp, 0xc
test esi, esi
jne 0x406ed3
test eax, eax
je 0x406f94
push edi
push str.Key___ls____deleted_r_n
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
call fcn.0040762a
mov edi, str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
not ecx
push 0
dec ecx
push 0x41e048
push ecx
mov ecx, dword [0x41e04c]
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
je 0x406f94
push edi
push str.Key___ls____delete_failed_r_n
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
call fcn.0040762a
mov edi, str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov edx, dword [0x41e04c]
push 0
not ecx
dec ecx
push 0x41e048
push ecx
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [0x41e04c]
test eax, eax
je 0x406f6e
push edi
push str.Key___ls_open_failed_r_n
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
call fcn.0040762a
mov edi, str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
or ecx, 0xffffffff
xor eax, eax
add esp, 0xc
repne scasb al, byte es:[edi]
mov eax, dword [0x41e04c]
push 0
not ecx
dec ecx
push 0x41e048
push ecx
push str.Key__43EA7BB31D4DD114FAF09271F90BD965_open_failed_r_n
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, 0x80004005
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret