Function at 0x1004a32
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xa20
mov eax, dword [0x100f6ec]
push ebx
mov ebx, dword [ebp + 0x10]
mov edx, dword [ebx]
test edx, edx
push esi
mov dword [ebp - 4], eax
push edi
je 0x1004a61
mov edi, dword [ebp + 0xc]
mov eax, dword [edi]
mov ecx, eax
cmp byte [ecx], 0xf0
je 0x1004aba
dec edx
inc ecx
test edx, edx
jne 0x1004a56
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x514]
mov byte [ecx], 0xff
mov ecx, dword [eax + 0x514]
mov byte [ecx + 1], 0xfa
mov ecx, dword [ebx]
push 2
pop edi
add ecx, edi
cmp ecx, edi
mov esi, edi
jle 0x1004a9e
mov edx, dword [ebp + 0xc]
mov edx, dword [edx]
mov dl, byte [edx + esi - 2]
mov ebx, dword [eax + 0x514]
mov byte [esi + ebx], dl
inc esi
cmp esi, ecx
jl 0x1004a84
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebx]
add ecx, edi
mov dword [eax + 0x510], ecx
and dword [ebx], 0
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.0100c260
leave
ret 0xc
movzx ecx, byte [eax]
sub ecx, 0x18
je 0x1004f82
sub ecx, 0xd
je 0x1004e84
dec ecx
dec ecx
jne 0x1005061
cmp byte [eax + 1], 1
jne 0x1005061
push 4
lea ecx, [eax + 2]
mov byte [ebp - 0xa18], 0xff
mov byte [ebp - 0xa17], 0xfa
mov byte [ebp - 0xa16], 0x27
mov byte [ebp - 0xa15], 0
cmp byte [ecx], 0xff
pop ebx
mov dword [ebp - 0xa1c], ebx
jne 0x1004b57
cmp byte [eax + 3], 0xf0
jne 0x1004b57
lea eax, [ebp - 0xa1c]
push eax
lea eax, [ebp - 0xa18]
push eax
call fcn.0100496c
mov ebx, dword [ebp - 0xa1c]
mov byte [ebp + ebx - 0xa18], 0xff
inc ebx
mov byte [ebp + ebx - 0xa18], 0xf0
inc ebx
push ebx
lea eax, [ebp - 0xa18]
push eax
push dword [ebp + 8]
call fcn.010043e6
mov ebx, dword [ebp + 0x10]
jmp 0x1005058
mov dword [ebp - 0xa20], ecx
mov esi, dword [ebp - 0xa20]
mov al, byte [esi]
cmp al, 0xff
jne 0x1004b6f
cmp byte [esi + 1], 0xf0
je 0x1004b2d
mov edi, 0x800
cmp ebx, edi
jge 0x1004b2d
test al, al
je 0x1004d13
cmp al, 3
jne 0x1004b5d
inc esi
mov al, byte [esi]
cmp al, 0xff
mov dword [ebp - 0xa20], esi
jne 0x1004b97
cmp byte [esi + 1], 0xf0
je 0x1004b5d
test al, al
je 0x1004b5d
lea eax, [ebp - 0x214]
push eax
push esi
call fcn.01004920
add esi, eax
lea eax, [ebp - 0x214]
mov dword [ebp - 0xa20], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004bb9
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, edi
jae 0x1004c08
mov byte [ebp + ebx - 0xa18], 3
inc ebx
sub edi, ebx
push edi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp + ebx - 0xa18]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
lea eax, [ebp - 0x214]
add esp, 0xc
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004bf7
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
push 0
push 0
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edi, eax
test edi, edi
jbe 0x1004b5d
lea eax, [edi + 0x64]
push eax
call dword [sym.imp.msvcrt.dll_malloc]
mov esi, eax
test esi, esi
pop ecx
je 0x1004aab
push edi
push esi
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x1004d06
mov eax, esi
xor edi, edi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x1004c56
sub eax, ecx
dec eax
js 0x1004cb4
mov cl, byte [eax + esi]
test cl, cl
jl 0x1004c6f
cmp cl, 3
jg 0x1004c6f
inc edi
dec eax
jns 0x1004c62
test edi, edi
je 0x1004cb4
cmp edi, 0x64
jge 0x1004cb4
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004c80
sub eax, edx
mov dl, byte [eax + esi]
lea ecx, [edi + eax]
mov byte [ecx + esi], dl
jmp 0x1004cb1
mov dl, byte [eax + esi]
lea ecx, [edi + eax]
mov byte [ecx + esi], dl
cmp byte [eax + esi], 0
jl 0x1004cb1
cmp byte [eax + esi], 3
jg 0x1004cb1
dec edi
lea ecx, [edi + eax]
mov byte [ecx + esi], 2
dec eax
jns 0x1004c94
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004cb9
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, 0x200
jae 0x1004d06
mov byte [ebp + ebx - 0xa18], 1
inc ebx
mov eax, 0x800
sub eax, ebx
push eax
lea eax, [ebp + ebx - 0xa18]
push esi
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
mov eax, esi
add esp, 0xc
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004cf5
sub eax, edi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
push esi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x1004b5d
inc esi
mov al, byte [esi]
cmp al, 0xff
mov dword [ebp - 0xa20], esi
jne 0x1004d26
cmp byte [esi + 1], 0xf0
je 0x1004d2a
cmp al, 3
jne 0x1004d48
lea eax, [ebp - 0xa1c]
push eax
lea eax, [ebp - 0xa18]
push eax
call fcn.0100496c
mov ebx, dword [ebp - 0xa1c]
jmp 0x1004b5d
lea eax, [ebp - 0x214]
push eax
push esi
call fcn.01004920
add esi, eax
lea eax, [ebp - 0x214]
mov dword [ebp - 0xa20], esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004d66
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, edi
jae 0x1004db4
mov byte [ebp + ebx - 0xa18], cl
inc ebx
sub edi, ebx
push edi
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp + ebx - 0xa18]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
lea eax, [ebp - 0x214]
add esp, 0xc
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004da3
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
push 5
mov edi, 0x1001d48
lea esi, [ebp - 0x214]
pop ecx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x1004e2e
mov eax, dword [0x100fbe8]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004dd0
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, 0x800
jae 0x1004b5d
mov byte [ebp + ebx - 0xa18], 1
inc ebx
mov eax, 0x800
sub eax, ebx
push eax
push dword [0x100fbe8]
lea eax, [ebp + ebx - 0xa18]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
mov eax, dword [0x100fbe8]
add esp, 0xc
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004e18
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
jmp 0x1004b5d
push 0xa
lea eax, [ebp - 0x214]
push 0x1001d3c
push eax
call dword [sym.imp.msvcrt.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x1004b5d
lea ecx, [ebx + 6]
mov eax, 0x800
cmp ecx, eax
jge 0x1004b5d
mov byte [ebp + ebx - 0xa18], 1
inc ebx
sub eax, ebx
push eax
lea eax, [ebp + ebx - 0xa18]
push 0x1001d34
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
add esp, 0xc
add ebx, 5
jmp 0x1004e23
mov cl, byte [eax + 1]
cmp cl, 1
jne 0x1004ee9
cmp byte [eax + 2], 0xf
jne 0x1004ee9
mov edi, dword [ebp + 8]
lea esi, [edi + 0x7dc]
cmp dword [esi], 0
jne 0x1004eb7
call fcn.0100206e
test eax, eax
je 0x1004eb7
push edi
call fcn.010056ce
test eax, eax
jne 0x1005058
push 8
lea eax, [ebp - 0x14]
push eax
mov dword [esi], 3
mov byte [ebp - 0x14], 0xff
mov byte [ebp - 0x13], 0xfa
mov byte [ebp - 0x12], 0x25
mov byte [ebp - 0x11], 0
mov byte [ebp - 0x10], 0
mov byte [ebp - 0xf], 0
mov byte [ebp - 0xe], 0xff
mov byte [ebp - 0xd], 0xf0
push edi
jmp 0x1005053
cmp cl, 2
jne 0x1004f6c
cmp byte [eax + 2], 0xf
jne 0x1004f6c
movzx ecx, byte [eax + 4]
dec ecx
je 0x1004f0d
mov eax, dword [ebp + 8]
mov dword [eax + 0x7dc], 3
jmp 0x1005061
mov esi, dword [ebp + 8]
cmp dword [esi + 0x7dc], 1
jne 0x1004f31
mov ecx, dword [ebx]
add ecx, 0xfffffffb
push ecx
add eax, 5
push eax
push esi
call fcn.01005a41
test eax, eax
jne 0x1005061
push 8
lea eax, [ebp - 0x14]
push eax
mov dword [esi + 0x7dc], 3
push esi
mov byte [ebp - 0x14], 0xff
mov byte [ebp - 0x13], 0xfa
mov byte [ebp - 0x12], 0x25
mov byte [ebp - 0x11], 0
mov byte [ebp - 0x10], 0
mov byte [ebp - 0xf], 0
mov byte [ebp - 0xe], 0xff
mov byte [ebp - 0xd], 0xf0
call fcn.010043e6
jmp 0x1005061
mov eax, dword [ebp + 8]
push 8
lea ecx, [ebp - 0x14]
push ecx
mov dword [eax + 0x7dc], 3
push eax
jmp 0x1004f42
mov eax, dword [0x100f758]
or dword [0x100f740], eax
mov eax, dword [edi]
cmp byte [eax + 1], 1
jne 0x1005061
mov esi, dword [ebp + 8]
mov ecx, dword [esi + 0x530]
cmp ecx, 0xffffffff
mov byte [ebp - 0x14], 0xff
mov byte [ebp - 0x13], 0xfa
mov byte [ebp - 0x12], 0x18
mov byte [ebp - 0x11], 0
jne 0x1004fcf
mov eax, dword [esi + 0x534]
cmp eax, ecx
je 0x1004fcf
mov dword [esi + 0x52c], eax
mov dword [esi + 0x538], eax
jmp 0x1004ff0
mov eax, dword [esi + 0x52c]
inc eax
push 4
cdq
pop edi
idiv edi
cmp edx, dword [esi + 0x538]
mov dword [esi + 0x52c], edx
jne 0x1004ff0
mov dword [esi + 0x52c], ecx
lea eax, [ebp - 0x14]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004ff6
push 0xd
sub eax, edx
pop ecx
sub ecx, eax
mov eax, dword [esi + 0x52c]
push ecx
push dword [eax*4 + 0x100e830]
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
mov ecx, dword [esi + 0x52c]
mov eax, dword [ecx*4 + 0x100e830]
add esp, 0xc
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x100502f
sub eax, edi
add eax, 4
mov byte [ebp + eax - 0x14], 0xff
inc eax
mov byte [ebp + eax - 0x14], 0xf0
inc eax
push eax
lea eax, [ebp - 0x14]
push eax
mov dword [esi + 0x530], ecx
push esi
call fcn.010043e6
mov edi, dword [ebp + 0xc]
jmp 0x1005061
inc dword [edi]
dec dword [ebx]
mov eax, dword [edi]
cmp byte [eax], 0xf0
jne 0x100505d
inc dword [edi]
dec dword [ebx]
jmp 0x1004aab