Function at 0x1008053
Capabilities:
Persist via run registry key
Query environment variable
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
push edi
xor esi, esi
cmp dword [ebp + 0xc], esi
lea eax, [ebp - 4]
push eax
mov dword [ebp - 4], esi
mov dword [ebp - 8], esi
push 0x1002230
je 0x100807b
push 0x80000001
jmp 0x1008080
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
cmp eax, esi
mov ebx, dword [sym.imp.KERNEL32.dll_LocalAlloc]
jne 0x1008167
cmp dword [ebp - 4], esi
je 0x1008167
lea eax, [ebp - 0xc]
push eax
push esi
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp + 8]
mov dword [ebp - 0xc], esi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x100813f
cmp dword [ebp - 0x10], 1
je 0x10080ca
cmp dword [ebp - 0x10], 2
jne 0x100813f
push dword [ebp - 0xc]
push 0x40
call ebx
mov edi, eax
cmp edi, esi
je 0x100813f
lea eax, [ebp - 0xc]
push eax
push edi
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1008138
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x1008122
lea eax, [esi + esi + 2]
push eax
push 0x40
call ebx
push esi
push eax
push edi
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x1008127
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 8], edi
jmp 0x1008134
mov eax, dword [ebp - 8]
push edi
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x100813f
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 8]
cmp eax, esi
je 0x1008167
cmp word [eax], si
jne 0x100815e
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 8], esi
cmp dword [ebp - 8], esi
jne 0x100823e
cmp dword [ebp + 0xc], esi
lea eax, [ebp - 4]
push eax
push 0x10021a8
je 0x100817c
push 0x80000001
jmp 0x1008181
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
cmp eax, esi
jne 0x1008239
cmp dword [ebp - 4], esi
je 0x1008239
lea eax, [ebp - 0xc]
push eax
push esi
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp + 8]
mov dword [ebp - 0xc], esi
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1008230
cmp dword [ebp - 0x10], 1
je 0x10081c1
cmp dword [ebp - 0x10], 2
jne 0x1008230
push dword [ebp - 0xc]
push 0x40
call ebx
mov edi, eax
cmp edi, esi
je 0x1008230
lea eax, [ebp - 0xc]
push eax
push edi
lea eax, [ebp - 0x10]
push eax
push esi
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x1008229
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov esi, eax
test esi, esi
je 0x1008216
lea eax, [esi + esi + 2]
push eax
push 0x40
call ebx
push esi
mov ebx, eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x100821b
push ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 8], edi
jmp 0x1008225
push edi
mov dword [ebp - 8], ebx
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor esi, esi
jmp 0x1008230
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 8], esi
je 0x1008250
mov eax, dword [ebp - 8]
cmp word [eax], si
jne 0x1008250
push eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 8], esi
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
leave
ret 8