Function at 0x520b20
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x128
mov eax, dword [0x57b2e0]
xor eax, ebp
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [eax], 0
mov ecx, dword [ebp + 8]
mov dl, byte [ecx]
mov byte [ebp - 1], dl
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp + 8], eax
movsx ecx, byte [ebp - 1]
cmp ecx, 1
jne 0x520b7b
movzx edx, byte [ebp + 0x10]
test edx, edx
jne 0x520b76
cmp dword [0x58a42c], 8
je 0x520b76
push 0
call fcn.005234a0
add esp, 4
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
jmp 0x520d10
movsx edx, byte [ebp - 1]
cmp edx, 2
je 0x520b91
movsx eax, byte [ebp - 1]
cmp eax, 3
jne 0x520d10
mov ecx, dword [ebp + 8]
movzx edx, word [ecx]
mov dword [0x58a464], 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 - 0x11c], edx
mov eax, dword [ebp + 8]
add eax, 4
mov dword [ebp + 8], eax
mov ecx, dword [ebp - 0x11c]
add ecx, 0x10000
push ecx
call fcn.0053ff64
add esp, 4
mov dword [ebp - 0x124], eax
mov edx, dword [ebp - 0x124]
mov dword [ebp - 0x118], edx
mov eax, dword [ebp - 0x118]
mov dword [ebp - 8], eax
mov ecx, 1
test ecx, ecx
je 0x520c47
mov edx, dword [ebp - 0x11c]
add edx, 0x10000
mov dword [ebp - 0x114], edx
push 0
lea eax, [ebp - 0x114]
push eax
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00520d90
add esp, 0x10
mov dword [ebp + 8], eax
cmp dword [ebp + 8], 0
jne 0x520c2e
xor eax, eax
jmp 0x520d7c
cmp dword [ebp - 0x114], 0
jne 0x520c39
jmp 0x520c47
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0x114]
mov dword [ebp - 8], eax
jmp 0x520bea
mov cl, byte [0x57c9ec]
mov byte [ebp - 0x110], cl
push 0xff
push 0
lea edx, [ebp - 0x10f]
push edx
call fcn.00540b70
add esp, 0xc
push 0x100
lea eax, [ebp - 0x110]
push eax
push 0x57cf38
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x520c8d
mov byte [ebp - 0x110], 0
jmp 0x520cb4
movsx ecx, byte [ebp - 0x110]
cmp ecx, 0x30
je 0x520ca4
movsx edx, byte [ebp - 0x110]
test edx, edx
jne 0x520cad
mov byte [ebp - 0x110], 0
jmp 0x520cb4
mov byte [ebp - 0x110], 1
movsx eax, byte [ebp - 0x110]
test eax, eax
jne 0x520cf5
movzx ecx, byte [ebp + 0x10]
test ecx, ecx
jne 0x520cf5
cmp dword [0x58a42c], 8
je 0x520cf5
cmp dword [0x58a42c], 9
je 0x520cf5
push 0
movsx edx, byte [ebp - 1]
cmp edx, 3
sete al
push eax
mov ecx, dword [ebp - 0x118]
push ecx
call fcn.005291a0
add esp, 0xc
mov edx, dword [ebp - 0x118]
mov dword [ebp - 0x128], edx
mov eax, dword [ebp - 0x128]
push eax
call fcn.00540f55
add esp, 4
mov ecx, dword [ebp + 8]
movsx edx, byte [ecx]
test edx, edx
je 0x520d70
mov eax, dword [ebp + 8]
add eax, 1
mov dword [ebp + 8], eax
mov ecx, dword [ebp + 8]
add ecx, 4
mov dword [ebp + 8], ecx
mov edx, 1
test edx, edx
je 0x520d6e
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x120], ecx
mov edx, dword [ebp + 8]
add edx, 4
mov dword [ebp + 8], edx
mov eax, dword [ebp - 0x120]
and eax, 0x7fffffff
mov dword [ebp - 0x120], eax
je 0x520d6a
mov ecx, dword [ebp + 8]
add ecx, dword [ebp - 0x120]
mov dword [ebp + 8], ecx
jmp 0x520d6c
jmp 0x520d6e
jmp 0x520d2c
jmp 0x520d10
mov edx, dword [ebp + 8]
add edx, 1
mov dword [ebp + 8], edx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
xor ecx, ebp
call fcn.005412c5
mov esp, ebp
pop ebp
ret