Function at 0x401a70
Capabilities:
Query or enumerate registry key
Query or enumerate registry value
Set registry value

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, eax
add eax, 8
push esi
push ebx
sub esp, 0x2ac
mov dword [ebp - 0x260], edx
mov dword [esp + 0x10], eax
mov eax, ecx
or eax, 0x20019
mov dword [ebp - 0x264], ecx
mov dword [esp + 0xc], eax
mov eax, dword [edi + 4]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [edi]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
sub esp, 0x14
test eax, eax
jne 0x401d60
mov esi, dword [ebp - 0x260]
lea eax, [ebp - 0x234]
mov dword [esp + 0x18], 0
mov dword [esp + 0x20], eax
lea eax, [esi + 8]
mov dword [esp + 0x10], 0
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x264]
mov dword [esp + 0xc], 0
or eax, 0x2001f
mov dword [esp + 8], 0
mov dword [esp + 0x14], eax
mov eax, dword [esi + 4]
mov dword [esp + 4], eax
mov eax, dword [esi]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCreateKeyExW]
sub esp, 0x24
mov ebx, eax
test eax, eax
jne 0x401d30
lea eax, [ebp - 0x240]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x248]
mov dword [esp + 0x20], eax
lea eax, [ebp - 0x24c]
mov dword [esp + 0x14], eax
mov eax, dword [edi + 8]
mov dword [esp + 0x28], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegQueryInfoKeyW]
sub esp, 0x30
test eax, eax
jne 0x401d80
mov ebx, dword [ebp - 0x24c]
cmp dword [ebp - 0x248], ebx
cmovae ebx, dword [ebp - 0x248]
add ebx, 1
lea eax, [ebx + ebx]
mov dword [ebp - 0x248], ebx
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll_malloc]
mov dword [ebp - 0x26c], eax
call eax
mov dword [ebp - 0x268], eax
test eax, eax
je 0x4021da
mov esi, dword [ebp - 0x240]
mov eax, dword [ebp - 0x26c]
mov dword [esp], esi
call eax
mov dword [ebp - 0x25c], eax
test eax, eax
je 0x402118
xor ecx, ecx
mov eax, esi
mov edx, ebx
mov esi, dword [ebp - 0x268]
mov ebx, ecx
jmp 0x401c5d
mov edx, dword [ebp - 0x23c]
mov ecx, dword [ebp - 0x25c]
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x238]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], edx
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegSetValueExW]
sub esp, 0x18
test eax, eax
jne 0x402130
mov edx, dword [ebp - 0x248]
mov eax, dword [ebp - 0x240]
add ebx, 1
mov dword [ebp - 0x23c], eax
lea eax, [ebp - 0x23c]
mov dword [esp + 0x1c], eax
mov eax, dword [ebp - 0x25c]
mov dword [ebp - 0x244], edx
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x238]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x244]
mov dword [esp + 0xc], eax
mov eax, dword [edi + 8]
mov dword [esp + 0x10], 0
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumValueW]
sub esp, 0x20
cmp eax, 0x103
je 0x401fb0
test eax, eax
jne 0x402118
mov eax, dword [ebp - 0x260]
mov edx, dword [ebp + 0xc]
mov eax, dword [eax + 8]
test edx, edx
jne 0x401c10
cmp dword [ebp - 0x234], 2
jne 0x401c10
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegQueryValueExW]
mov dword [ebp - 0x270], eax
sub esp, 0x18
test eax, eax
je 0x401df0
mov eax, dword [ebp - 0x260]
mov eax, dword [eax + 8]
jmp 0x401c10
mov eax, dword [edi + 8]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
cmp ebx, 2
je 0x401d65
mov dword [esp], 0x6b
mov esi, 1
call dbg.output_message
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 2
jne 0x401d44
mov dword [esp], 0x6e
mov esi, 1
call dbg.output_message
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
cmp eax, 0x103
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov dword [ebp - 0x25c], 0
mov dword [ebp - 0x268], 0
setne al
movzx eax, al
mov esi, eax
mov eax, dword [ebp - 0x268]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x25c]
mov dword [esp], eax
call ebx
mov eax, dword [edi + 8]
mov ebx, dword [sym.imp.advapi32.dll_RegCloseKey]
mov dword [esp], eax
call ebx
mov eax, dword [ebp - 0x260]
sub esp, 4
mov eax, dword [eax + 8]
mov dword [esp], eax
call ebx
mov eax, esi
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [edi + 0xc]
mov dword [esp], 0
mov dword [ebp - 0x27c], eax
call dword [sym.imp.kernel32.dll_GetModuleHandleW]
mov ecx, dword [0x40d2f4]
sub esp, 4
mov dword [ebp - 0x274], eax
mov dword [ebp - 0x278], ecx
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x40c050
mov dword [esp + 4], 0x64
mov dword [esp], eax
call ecx
mov eax, dword [ebp - 0x274]
mov ecx, dword [ebp - 0x278]
sub esp, 0x10
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x40c048
mov dword [esp + 4], 0x65
mov dword [esp], eax
call ecx
mov eax, dword [ebp - 0x274]
mov ecx, dword [ebp - 0x278]
sub esp, 0x10
mov dword [esp + 0xc], 4
mov dword [esp + 8], 0x40c040
mov dword [esp + 4], 0x66
mov dword [esp], eax
call ecx
mov eax, dword [ebp - 0x274]
mov ecx, dword [ebp - 0x278]
sub esp, 0x10
mov dword [esp + 0xc], 0x20
mov dword [esp + 8], 0x40c000
mov dword [esp + 4], 0x70
mov dword [esp], eax
call ecx
mov eax, section..bss
mov dword [ebp - 0x274], ebx
mov ebx, dword [ebp - 0x27c]
sub esp, 0x10
cmp word [esi], 0
mov dword [ebp - 0x278], esi
cmovne eax, esi
mov esi, eax
jmp 0x401f02
cmp ax, word [0x40c048]
je 0x4021a7
cmp ax, word [0x40c040]
je 0x4021bf
mov dword [esp + 8], esi
mov dword [esp + 4], ebx
mov dword [esp], 0xfb
call dbg.output_message
mov dword [esp], 0x68
call dbg.output_message
mov dword [esp], 0xfffffff6
call dword [sym.imp.kernel32.dll_GetStdHandle]
lea ecx, [ebp - 0x230]
sub esp, 4
mov dword [esp + 0xc], ecx
lea ecx, [subkey_src.hkey]
mov dword [esp + 4], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0x104
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadConsoleW]
movzx eax, word [subkey_src.hkey]
sub esp, 0x14
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_towupper]
mov word [subkey_src.hkey], ax
cmp ax, word [0x40c050]
jne 0x401ee8
mov ebx, dword [ebp - 0x274]
mov esi, dword [ebp - 0x278]
mov eax, dword [ebp - 0x260]
mov ecx, dword [ebp - 0x270]
mov eax, dword [eax + 8]
mov dword [ebp + 0xc], ecx
jmp 0x401c10
mov eax, dword [ebp + 8]
mov ebx, dword [sym.imp.ucrtbase.dll_free]
xor esi, esi
test eax, eax
je 0x401da7
mov dword [ebp - 0x278], ebx
mov ebx, dword [ebp - 0x268]
nop
mov eax, dword [ebp - 0x248]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [ebp - 0x244], eax
lea eax, [ebp - 0x244]
mov dword [esp + 0xc], eax
mov eax, dword [edi + 8]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegEnumKeyExW]
sub esp, 0x20
test eax, eax
jne 0x402188
mov eax, dword [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [ebp - 0x22c], ebx
mov dword [subkey_src.path], ebx
mov dword [ebp - 0x230], eax
mov eax, dword [ebp - 0x260]
mov eax, dword [eax + 8]
mov dword [subkey_src.hkey], eax
cmp word [edx], 0
je 0x4021a0
mov eax, edx
lea esi, [esi]
nop
add eax, 2
cmp word [eax], 0
jne 0x402060
sub eax, edx
sar eax, 1
mov ecx, dword [ebp - 0x244]
mov dword [ebp - 0x274], edx
lea ecx, [eax + ecx + 2]
lea eax, [ecx + ecx]
mov dword [ebp - 0x270], ecx
mov dword [esp], eax
mov eax, dword [ebp - 0x26c]
call eax
mov dword [subkey_src.subkey], eax
test eax, eax
je 0x4021f4
mov edx, dword [ebp - 0x274]
mov ecx, dword [ebp - 0x270]
mov dword [esp + 0x10], ebx
mov dword [esp + 8], 0x4090d4
mov dword [esp + 0xc], edx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym._swprintf.constprop.0
mov eax, dword [ebp + 0xc]
mov dword [esp], 1
lea edx, [subkey_src.hkey]
mov ecx, dword [ebp - 0x264]
mov dword [esp + 4], eax
lea eax, [ebp - 0x230]
call dbg.run_copy
mov edx, dword [subkey_src.subkey]
mov dword [ebp - 0x270], eax
mov eax, dword [ebp - 0x278]
mov dword [esp], edx
call eax
mov eax, dword [ebp - 0x270]
test eax, eax
jne 0x402188
add esi, 1
jmp 0x401fd0
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov esi, 1
jmp 0x401da7
cmp eax, 2
je 0x402165
mov dword [esp], 0x6b
mov dword [ebp - 0x264], eax
call dbg.output_message
mov eax, dword [ebp - 0x264]
mov ebx, dword [sym.imp.ucrtbase.dll_free]
cmp eax, 0x103
setne al
movzx eax, al
mov esi, eax
jmp 0x401da7
mov dword [esp], 0x6e
mov esi, 1
call dbg.output_message
mov ebx, dword [sym.imp.ucrtbase.dll_free]
jmp 0x401da7
mov ebx, dword [ebp - 0x278]
cmp eax, 0x103
setne al
movzx eax, al
mov esi, eax
jmp 0x401da7
xor eax, eax
jmp 0x40206d
mov dword [ebp + 0xc], 0
mov ebx, dword [ebp - 0x274]
mov esi, dword [ebp - 0x278]
jmp 0x401c4e
mov dword [ebp - 0x270], 1
mov ebx, dword [ebp - 0x274]
mov esi, dword [ebp - 0x278]
jmp 0x401f92
mov dword [ebp - 0x25c], 0
mov ebx, dword [sym.imp.ucrtbase.dll_free]
mov esi, 1
jmp 0x401da7
mov ebx, dword [ebp - 0x278]
mov eax, 8
jmp 0x40218e