Function at 0x1005c28
Capabilities:
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
mov esi, dword [ebp + 8]
imul esi, esi, 3
add esi, dword [ebp + 0xc]
xor ebx, ebx
push edi
xor edi, edi
shl esi, 5
inc ebx
mov dword [ebp - 4], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0xc], edi
cmp dword [esi + 0x1022a18], ebx
je 0x1005e70
movzx eax, word [esi + 0x1022a08]
cmp eax, 3
je 0x1005ddd
cmp eax, 8
je 0x1005db2
cmp eax, 0x2000
je 0x1005cd0
push 0x1000
mov esi, 0x10206a0
push esi
push 0x4ea
push dword [0x1020644]
call dword [sym.imp.USER32.dll_LoadStringW]
test eax, eax
jne 0x1005ca4
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x1005e73
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1005ca9
sub eax, edx
sar eax, 1
push eax
push esi
push dword [0x1020634]
call fcn.01005a95
mov dword [ebp - 4], 0x80004005
jmp 0x1005e70
mov edx, dword [0x101fe10]
mov dword [ebp + 0x10], 7
jmp 0x1005d14
mov ecx, dword [edx]
lea ebx, [ecx + 2]
mov ax, word [ecx]
inc ecx
inc ecx
test ax, ax
jne 0x1005ce4
sub ecx, ebx
sar ecx, 1
lea eax, [edi + ecx*2 + 4]
cmp edi, eax
ja 0x1005cc4
mov eax, dword [edx]
lea ebx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1005cff
mov edx, dword [edx + 4]
sub eax, ebx
sar eax, 1
lea edi, [edi + eax*2 + 2]
test edx, edx
jne 0x1005cdf
inc edi
inc edi
push edi
call dword [sym.imp.msvcrt.dll_malloc]
pop ecx
mov dword [ebp - 8], eax
test eax, eax
jne 0x1005d35
mov dword [ebp - 4], 0x8007000e
jmp 0x1005e60
mov ecx, edi
shr ecx, 1
mov dword [ebp + 8], ecx
jmp 0x1005d9b
push dword [eax]
mov eax, dword [ebp - 0xc]
sub ecx, eax
push ecx
mov ecx, dword [ebp - 8]
lea eax, [ecx + eax*2]
push eax
call sub.msvcrt.dll_wcscpy_s
mov ecx, dword [0x101fe10]
mov eax, dword [ecx]
add esp, 0xc
lea edx, [eax + 2]
mov bx, word [eax]
inc eax
inc eax
test bx, bx
jne 0x1005d60
sub eax, edx
mov edx, dword [ebp - 0xc]
sar eax, 1
lea eax, [edx + eax + 1]
mov dword [ebp - 0xc], eax
mov eax, dword [ecx + 4]
mov ebx, ecx
mov dword [0x101fe10], eax
mov eax, dword [ebx]
test eax, eax
je 0x1005d90
push eax
call dword [sym.imp.msvcrt.dll_free]
pop ecx
push ebx
call dword [sym.imp.msvcrt.dll_free]
pop ecx
mov ecx, dword [ebp + 8]
mov eax, dword [0x101fe10]
test eax, eax
jne 0x1005d3e
mov eax, dword [ebp - 8]
xor edx, edx
mov word [eax + ecx*2 - 2], dx
mov ecx, eax
jmp 0x1005de9
mov eax, dword [ebp + 0x10]
cmp dword [eax + 8], edi
je 0x1005dd6
mov ecx, dword [eax + 8]
mov eax, ecx
lea edi, [eax + 2]
mov dx, word [eax]
inc eax
inc eax
test dx, dx
jne 0x1005dc2
sub eax, edi
sar eax, 1
lea edi, [eax + eax + 2]
jmp 0x1005dd8
xor ecx, ecx
mov dword [ebp + 0x10], ebx
jmp 0x1005de9
mov ecx, dword [ebp + 0x10]
push 4
pop edi
add ecx, 8
mov dword [ebp + 0x10], edi
test ecx, ecx
je 0x1005e60
mov eax, dword [esi + 0x1022a00]
push edi
push ecx
push dword [ebp + 0x10]
push 0
push dword [esi + 0x1022a04]
push dword [eax*4 + 0x1020628]
call dword [sym.imp.KERNEL32.dll_RegSetValueExW]
xor esi, esi
cmp eax, esi
mov dword [ebp - 4], eax
jge 0x1005e60
push esi
push esi
lea eax, [ebp + 0x10]
push eax
push 0x400
push dword [ebp - 4]
push esi
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
test eax, eax
je 0x1005e60
mov eax, dword [ebp + 0x10]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, si
jne 0x1005e3a
sub eax, edx
sar eax, 1
push eax
push dword [ebp + 0x10]
push dword [0x1020634]
call fcn.01005a95
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 8], 0
je 0x1005e70
push dword [ebp - 8]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0xc