Function at 0x13008b40
Capabilities:
Query environment variable
Query or enumerate registry value

Disassembly:
sub esp, 8
push ebx
push ebp
mov ebp, dword [esp + 0x20]
xor ebx, ebx
push esi
cmp ebp, ebx
push edi
mov dword [esp + 0x10], ebx
je 0x13008b58
mov dword [ebp], ebx
mov ecx, dword [esp + 0x1c]
cmp ecx, ebx
je 0x13008ce8
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x13008ce8
cmp byte [eax], 0
je 0x13008ce8
cmp ebp, ebx
je 0x13008ce8
lea edx, [esp + 0x14]
push edx
push 0x20019
push ebx
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x13008ce8
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x20]
push eax
push ebx
push ecx
push ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push edi
push edx
call ebx
test eax, eax
jne 0x13008cd3
mov eax, dword [esp + 0x1c]
push eax
call fcn.13039b3e
mov esi, eax
add esp, 4
test esi, esi
je 0x13008cd3
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push esi
push edx
push 0
push edi
push eax
call ebx
test eax, eax
jne 0x13008cca
mov eax, dword [esp + 0x20]
cmp eax, 1
jne 0x13008c53
mov ecx, dword [esp + 0x1c]
inc ecx
push ecx
call fcn.13039b3e
mov edi, eax
add esp, 4
test edi, edi
mov dword [ebp], edi
je 0x13008cca
mov edx, dword [esp + 0x1c]
xor eax, eax
lea ecx, [edx + 1]
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp]
push eax
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpynA]
mov dword [esp + 0x10], 1
jmp 0x13008cca
cmp eax, 2
jne 0x13008cca
mov ebx, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
lea edx, [esp + 0x28]
push eax
push edx
push esi
mov byte [esp + 0x34], 0
mov byte [esp + 0x35], 0
call ebx
cmp eax, 2
mov dword [esp + 0x1c], eax
jbe 0x13008cca
inc eax
push eax
call fcn.13039b3e
mov edi, eax
add esp, 4
test edi, edi
mov dword [ebp], edi
je 0x13008cca
mov eax, dword [esp + 0x1c]
lea ecx, [eax + 1]
xor eax, eax
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [ebp]
push eax
push ecx
push esi
call ebx
cmp eax, dword [esp + 0x1c]
ja 0x13008cc2
test eax, eax
mov dword [esp + 0x10], 1
ja 0x13008cca
mov dword [esp + 0x10], 0
push esi
call fcn.13039b67
add esp, 4
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x13008d36
mov ebx, eax
mov esi, dword [esp + 0x2c]
test esi, esi
je 0x13008d2c
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.13039b3e
mov edx, eax
add esp, 4
test edx, edx
mov dword [ebp], edx
je 0x13008d2c
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret