Function at 0x4a58a0
Capabilities:
Set registry value

Disassembly:
sub esp, 0xc
mov edx, dword [esp + 0x14]
mov dword [esp + 4], ecx
push ebx
push ebp
push esi
push edi
test edx, edx
je 0x4a5b4f
mov edi, dword [esp + 0x20]
test edi, edi
je 0x4a5b4f
cmp edi, 0xfffffffe
je 0x4a5b4f
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x28]
push eax
mov eax, dword [0x4f70f4]
push 0
mov eax, dword [eax + 0xd0]
or eax, 0x20006
push eax
push 0
push 0x4cdc40
push 0
push dword [esp + 0x44]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
mov esi, eax
test esi, esi
jne 0x4a5b54
dec edi
cmp edi, 6
ja case.0x4a5911.5
jmp dword [edi*4 + 0x4a5b84]
mov edx, dword [esp + 0x30]
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4a5921
sub ecx, esi
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 1
push 0
push dword [esp + 0x3c]
push dword [esp + 0x38]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [esp + 0x24]
mov esi, eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4a5b54
mov edx, dword [esp + 0x30]
mov ecx, edx
lea esi, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4a5965
sub ecx, esi
sar ecx, 1
lea eax, [ecx*2 + 2]
push eax
push edx
push 2
jmp 0x4a593b
mov ebx, dword [esp + 0x30]
mov esi, ebx
lea ecx, [esi + 2]
nop word [eax + eax]
mov ax, word [esi]
add esi, 2
test ax, ax
jne 0x4a5990
sub esi, ecx
sar esi, 1
lea eax, [esi*2 + 4]
push eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edi, eax
add esp, 4
test edi, edi
jne 0x4a59ca
push dword [esp + 0x24]
mov esi, 0xe
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4a5b54
push esi
push ebx
push edi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcsncpy]
xor eax, eax
lea ebx, [esi + esi]
add esp, 0xc
mov dword [ebx + edi], eax
test esi, esi
je 0x4a59f2
cmp word [ebx + edi - 2], 0xa
jne 0x4a59f2
dec esi
lea ebx, [esi + esi]
mov word [ebx + edi], ax
movzx eax, word [edi]
mov ecx, edi
test ax, ax
je 0x4a5a19
mov edx, eax
nop
cmp dx, 0xa
jne 0x4a5a0b
xor eax, eax
mov word [ecx], ax
movzx eax, word [ecx + 2]
add ecx, 2
mov edx, eax
test ax, ax
jne 0x4a5a00
neg esi
lea eax, [ebx + 4]
sbb esi, esi
and esi, eax
push esi
push edi
push 7
push 0
push dword [esp + 0x3c]
push dword [esp + 0x38]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push edi
mov esi, eax
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4a5b54
mov ecx, dword [esp + 0x30]
cmp word [ecx], 0
je 0x4a5a72
call fcn.00405220
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
push 4
push eax
push 4
jmp 0x4a593b
xor eax, eax
mov dword [esp + 0x28], eax
lea eax, [esp + 0x28]
push 4
push eax
push 4
jmp 0x4a593b
mov ebx, dword [esp + 0x30]
lea ecx, [ebx + 2]
nop dword [eax]
mov ax, word [ebx]
add ebx, 2
test ax, ax
jne 0x4a5a90
sub ebx, ecx
sar ebx, 1
test bl, 1
jne case.0x4a5911.5
mov eax, ebx
cdq
sub eax, edx
mov esi, eax
sar esi, 1
push esi
mov dword [esp + 0x14], esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edi, eax
add esp, 4
mov dword [esp + 0x20], edi
test edi, edi
je 0x4a59b6
xor ebp, ebp
xor edx, edx
test ebx, ebx
jle 0x4a5b2f
cmp ebp, esi
jge 0x4a5b2f
xor ecx, ecx
lea esi, [ecx + 0x10]
nop
mov eax, dword [esp + 0x30]
mov edi, ecx
movzx ecx, word [eax + edx*2]
lea eax, [ecx - 0x30]
cmp ax, 9
ja 0x4a5af8
lea eax, [ecx - 0x30]
jmp 0x4a5b12
lea eax, [ecx - 0x41]
cmp ax, 5
ja 0x4a5b06
lea eax, [ecx - 0x37]
jmp 0x4a5b12
lea eax, [ecx - 0x61]
cmp ax, 5
ja 0x4a5b38
lea eax, [ecx - 0x57]
mov ecx, esi
inc edx
imul ecx, eax
add ecx, edi
sub esi, 0xf
jns 0x4a5ae0
mov edi, dword [esp + 0x20]
mov esi, dword [esp + 0x10]
mov byte [edi + ebp], cl
inc ebp
cmp edx, ebx
jl 0x4a5ad5
push ebp
push edi
push 3
jmp 0x4a5a26
push dword [esp + 0x20]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, 0x57
mov ecx, dword [esp + 0x14]
test esi, esi
push esi
setne al
movzx eax, al
push eax
call fcn.0044d550
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret 0x14
push dword [esp + 0x24]
mov esi, 0x57
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x4a5b54