Function at 0x1004d0a
Capabilities:
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa30
mov eax, dword [0x10106f0]
push ebx
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebx]
test ecx, ecx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov dword [ebp - 4], eax
mov dword [ebp - 0xa2c], esi
mov dword [ebp - 0xa20], edi
mov dword [ebp - 0xa30], ebx
je 0x1004d50
mov eax, dword [edi]
mov edx, eax
cmp byte [edx], 0xf0
je 0x1004d77
dec ecx
inc edx
test ecx, ecx
jne 0x1004d45
mov eax, dword [esi + 0x514]
mov byte [eax], 0xff
mov eax, dword [esi + 0x514]
mov byte [eax + 1], 0xfa
mov eax, dword [ebx]
push 2
pop ecx
add eax, ecx
cmp eax, ecx
jle 0x100538c
jmp 0x1005378
movzx ecx, byte [eax]
sub ecx, 0x18
je 0x1005286
sub ecx, 0xd
je 0x10051ac
dec ecx
dec ecx
jne 0x1005365
cmp byte [eax + 1], 1
jne 0x1005365
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 0x1004e1a
cmp byte [eax + 3], 0xf0
jne 0x1004e1a
lea eax, [ebp - 0xa1c]
push eax
lea eax, [ebp - 0xa18]
push eax
call fcn.01004c3f
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 - 0xa2c]
call fcn.01004662
mov ebx, dword [ebp - 0xa30]
jmp 0x1005359
mov dword [ebp - 0xa24], ecx
mov edi, dword [ebp - 0xa24]
mov al, byte [edi]
cmp al, 0xff
jne 0x1004e32
cmp byte [edi + 1], 0xf0
je 0x1004dea
mov esi, 0x800
cmp ebx, esi
jge 0x1004dea
test al, al
je 0x100503b
cmp al, 3
jne 0x1004e20
inc edi
mov al, byte [edi]
cmp al, 0xff
mov dword [ebp - 0xa24], edi
jne 0x1004e5a
cmp byte [edi + 1], 0xf0
je 0x1004e20
test al, al
je 0x1004e20
mov eax, dword [0x1010c70]
mov dword [ebp - 0xa28], eax
lea eax, [ebp - 0x214]
push eax
push edi
call fcn.01004bea
add edi, eax
lea eax, [ebp - 0x214]
mov dword [ebp - 0xa24], edi
lea edi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004e87
sub eax, edi
lea eax, [eax + ebx + 1]
cmp eax, esi
jae 0x1004ed6
mov byte [ebp + ebx - 0xa18], 3
inc ebx
sub esi, ebx
push esi
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 0x1004ec5
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
mov esi, dword [ebp - 0xa28]
test esi, esi
je 0x1004e20
jmp 0x1004eec
mov esi, dword [ebp - 0xa28]
cmp byte [esi], 0
je 0x1004e20
push 0x200
lea eax, [ebp - 0x214]
push esi
push eax
call dword [sym.imp.msvcrt.dll__strnicmp]
add esp, 0xc
test eax, eax
je 0x1004f30
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004f14
sub eax, edx
lea eax, [esi + eax + 1]
test eax, eax
mov dword [ebp - 0xa28], eax
jne 0x1004ee6
jmp 0x1004e20
push 0
push 0
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov edi, eax
test edi, edi
jbe 0x1004e20
lea eax, [edi + 0x64]
push eax
call dword [sym.imp.msvcrt.dll_malloc]
mov esi, eax
test esi, esi
pop ecx
je 0x1005399
push edi
push esi
lea eax, [ebp - 0x214]
push eax
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x100502e
mov eax, esi
xor edi, edi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x1004f7e
sub eax, ecx
dec eax
js 0x1004fdc
mov cl, byte [eax + esi]
test cl, cl
jl 0x1004f97
cmp cl, 3
jg 0x1004f97
inc edi
dec eax
jns 0x1004f8a
test edi, edi
je 0x1004fdc
cmp edi, 0x64
jge 0x1004fdc
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004fa8
sub eax, edx
mov dl, byte [eax + esi]
lea ecx, [edi + eax]
mov byte [ecx + esi], dl
jmp 0x1004fd9
mov dl, byte [eax + esi]
lea ecx, [edi + eax]
mov byte [ecx + esi], dl
cmp byte [eax + esi], 0
jl 0x1004fd9
cmp byte [eax + esi], 3
jg 0x1004fd9
dec edi
lea ecx, [edi + eax]
mov byte [ecx + esi], 2
dec eax
jns 0x1004fbc
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1004fe1
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, 0x200
jae 0x100502e
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 0x100501d
sub eax, edi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
push esi
call dword [sym.imp.msvcrt.dll_free]
pop ecx
jmp 0x1004e20
inc edi
mov al, byte [edi]
cmp al, 0xff
mov dword [ebp - 0xa24], edi
jne 0x100504e
cmp byte [edi + 1], 0xf0
je 0x1005052
cmp al, 3
jne 0x1005070
lea eax, [ebp - 0xa1c]
push eax
lea eax, [ebp - 0xa18]
push eax
call fcn.01004c3f
mov ebx, dword [ebp - 0xa1c]
jmp 0x1004e20
lea eax, [ebp - 0x214]
push eax
push edi
call fcn.01004bea
add edi, eax
lea eax, [ebp - 0x214]
mov dword [ebp - 0xa24], edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x100508e
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, esi
jae 0x10050dc
mov byte [ebp + ebx - 0xa18], cl
inc ebx
sub esi, ebx
push esi
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 0x10050cb
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
push 5
mov edi, 0x1001d58
lea esi, [ebp - 0x214]
pop ecx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x1005156
mov eax, dword [0x1010be8]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10050f8
sub eax, edx
lea eax, [eax + ebx + 1]
cmp eax, 0x800
jae 0x1004e20
mov byte [ebp + ebx - 0xa18], 1
inc ebx
mov eax, 0x800
sub eax, ebx
push eax
push dword [0x1010be8]
lea eax, [ebp + ebx - 0xa18]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
mov eax, dword [0x1010be8]
add esp, 0xc
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1005140
sub eax, esi
add ebx, eax
mov dword [ebp - 0xa1c], ebx
jmp 0x1004e20
push 0xa
lea eax, [ebp - 0x214]
push 0x1001d4c
push eax
call dword [sym.imp.msvcrt.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x1004e20
lea ecx, [ebx + 6]
mov eax, 0x800
cmp ecx, eax
jge 0x1004e20
mov byte [ebp + ebx - 0xa18], 1
inc ebx
sub eax, ebx
push eax
lea eax, [ebp + ebx - 0xa18]
push 0x1001d44
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
add esp, 0xc
add ebx, 5
jmp 0x100514b
mov cl, byte [eax + 1]
cmp cl, 1
jne 0x1005209
cmp byte [eax + 2], 0xf
jne 0x1005209
lea edi, [esi + 0x7dc]
cmp dword [edi], 0
jne 0x10051dc
call fcn.0100211b
test eax, eax
je 0x10051dc
push esi
call fcn.01005a6a
test eax, eax
jne 0x1005359
mov dword [edi], 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 8
jmp 0x100534f
cmp cl, 2
jne 0x100524b
cmp byte [eax + 2], 0xf
jne 0x100524b
movzx ecx, byte [eax + 4]
dec ecx
je 0x100522a
mov dword [esi + 0x7dc], 3
jmp 0x1005365
cmp dword [esi + 0x7dc], 1
jne 0x100524b
mov ecx, dword [ebx]
add ecx, 0xfffffffb
push ecx
add eax, 5
push eax
push esi
call fcn.01005f21
test eax, eax
jne 0x1005365
push 8
lea eax, [ebp - 0x14]
push eax
push esi
mov dword [esi + 0x7dc], 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
call fcn.01004662
jmp 0x1005365
mov eax, dword [0x1010758]
or dword [0x1010740], eax
mov eax, dword [edi]
cmp byte [eax + 1], 1
jne 0x1005365
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 0x10052d0
mov eax, dword [esi + 0x534]
cmp eax, ecx
je 0x10052d0
mov dword [esi + 0x52c], eax
mov dword [esi + 0x538], eax
jmp 0x10052f1
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 0x10052f1
mov dword [esi + 0x52c], ecx
lea eax, [ebp - 0x14]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x10052f7
push 0xd
sub eax, edx
pop ecx
sub ecx, eax
mov eax, dword [esi + 0x52c]
push ecx
push dword [eax*4 + 0x100f830]
lea eax, [ebp - 0x10]
push eax
call dword [sym.imp.msvcrt.dll_strncpy]
mov ecx, dword [esi + 0x52c]
mov eax, dword [ecx*4 + 0x100f830]
add esp, 0xc
lea edi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x1005330
sub eax, edi
add eax, 4
mov byte [ebp + eax - 0x14], 0xff
inc eax
mov byte [ebp + eax - 0x14], 0xf0
inc eax
mov dword [esi + 0x530], ecx
push eax
lea eax, [ebp - 0x14]
push eax
push esi
call fcn.01004662
mov edi, dword [ebp - 0xa20]
jmp 0x1005365
inc dword [edi]
dec dword [ebx]
mov eax, dword [edi]
cmp byte [eax], 0xf0
jne 0x1005361
inc dword [edi]
dec dword [ebx]
jmp 0x1005399
mov edi, dword [ebp - 0xa20]
mov edx, dword [edi]
mov dl, byte [edx + ecx - 2]
mov edi, dword [esi + 0x514]
mov byte [ecx + edi], dl
inc ecx
cmp ecx, eax
jl 0x1005372
mov eax, dword [ebx]
inc eax
inc eax
mov dword [esi + 0x510], eax
and dword [ebx], 0
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.0100cdd8
leave
ret 0xc