Function at 0x506008
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
push edi
mov eax, dword [ebp + 0xc]
mov dword [eax], 0
mov ecx, dword [ebp + 8]
mov dl, byte [ecx]
mov byte [ebp - 4], dl
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp + 8], eax
movsx ecx, byte [ebp - 4]
cmp ecx, 1
jne 0x506056
mov edx, dword [ebp + 0x10]
and edx, 0xff
test edx, edx
jne 0x506051
push 0
call fcn.00507710
add esp, 4
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
jmp 0x5061e3
movsx edx, byte [ebp - 4]
cmp edx, 2
je 0x50606c
movsx eax, byte [ebp - 4]
cmp eax, 3
jne 0x5061e3
mov ecx, dword [ebp + 8]
xor edx, edx
mov dx, word [ecx]
mov dword [0x5461b4], edx
mov eax, dword [ebp + 8]
add eax, 2
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx]
mov dword [ebp - 0x114], edx
mov eax, dword [ebp + 8]
add eax, 4
mov dword [ebp + 8], eax
mov ecx, dword [ebp - 0x114]
add ecx, 0x10000
push ecx
call fcn.0051a0e1
add esp, 4
mov dword [ebp - 0x11c], eax
mov edx, dword [ebp - 0x11c]
mov dword [ebp - 0x110], edx
mov eax, dword [ebp - 0x110]
mov dword [ebp - 8], eax
mov ecx, 1
test ecx, ecx
je 0x506118
mov edx, dword [ebp - 0x114]
add edx, 0x10000
mov dword [ebp - 0xc], edx
push 0
lea eax, [ebp - 0xc]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.0050625c
add esp, 0x10
mov dword [ebp + 8], eax
cmp dword [ebp + 8], 0
jne 0x506105
xor eax, eax
jmp 0x506257
cmp dword [ebp - 0xc], 0
jne 0x50610d
jmp 0x506118
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0xc]
mov dword [ebp - 8], eax
jmp 0x5060c7
mov cl, byte [0x545e40]
mov byte [ebp - 0x10c], cl
mov ecx, 0x3f
xor eax, eax
lea edi, [ebp - 0x10b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push pe_nt_image_headers32
lea edx, [ebp - 0x10c]
push edx
push 0x53f5ac
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x50615a
mov byte [ebp - 0x10c], 0
jmp 0x506181
movsx eax, byte [ebp - 0x10c]
cmp eax, 0x30
je 0x506171
movsx ecx, byte [ebp - 0x10c]
test ecx, ecx
jne 0x50617a
mov byte [ebp - 0x10c], 0
jmp 0x506181
mov byte [ebp - 0x10c], 1
movsx edx, byte [ebp - 0x10c]
test edx, edx
jne 0x5061c8
mov eax, dword [ebp + 0x10]
and eax, 0xff
test eax, eax
jne 0x5061c8
cmp dword [0x5461a4], 8
je 0x5061c8
cmp dword [0x5461a4], 9
je 0x5061c8
push 0
movsx ecx, byte [ebp - 4]
xor edx, edx
cmp ecx, 3
sete dl
push edx
mov eax, dword [ebp - 0x110]
push eax
call fcn.00508267
add esp, 0xc
mov ecx, dword [ebp - 0x110]
mov dword [ebp - 0x120], ecx
mov edx, dword [ebp - 0x120]
push edx
call fcn.0051a0d6
add esp, 4
mov eax, dword [ebp + 8]
movsx ecx, byte [eax]
test ecx, ecx
je 0x50624b
mov edx, dword [ebp + 8]
add edx, 1
mov dword [ebp + 8], edx
mov eax, dword [ebp + 8]
add eax, 4
mov dword [ebp + 8], eax
mov ecx, 1
test ecx, ecx
je 0x506249
mov edx, dword [ebp + 8]
mov eax, dword [edx]
mov dword [ebp - 0x118], eax
mov ecx, dword [ebp + 8]
add ecx, 4
mov dword [ebp + 8], ecx
mov edx, dword [ebp - 0x118]
and edx, 0x7fffffff
mov dword [ebp - 0x118], edx
cmp dword [ebp - 0x118], 0
je 0x506245
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x118]
mov dword [ebp + 8], eax
jmp 0x506247
jmp 0x506249
jmp 0x5061ff
jmp 0x5061e3
mov ecx, dword [ebp + 8]
add ecx, 1
mov dword [ebp + 8], ecx
mov eax, dword [ebp + 8]
pop edi
mov esp, ebp
pop ebp
ret