Function at 0x489760
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x43c
mov esi, ecx
lea ecx, [ebp - 0x448]
push dword [ebp + 8]
call fcn.00469460
add esp, 4
mov eax, dword [ebp - 0x448]
test eax, eax
mov dword [ebp - 0x20], eax
je 0x489888
mov eax, dword [ebp - 0x444]
mov dword [ebp - 0x24], esi
mov esi, 0x200
mov dword [ebp - 0x38], 2
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x1c], 2
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x28], eax
cmp esi, 0x201
jae 0x489800
jmp 0x4897ee
jbe 0x48989c
cmp esi, 0x201
jae 0x489800
mov dword [ebp - 0x2c], 0x200
lea ebx, [ebp - 0x448]
mov edi, esi
jmp 0x489834
mov edi, dword [ebp - 0x14]
mov eax, dword [ebp - 0x10]
sub esi, edi
sub eax, edi
cmp eax, esi
jae 0x489825
mov edx, edi
lea ecx, [ebp - 0x38]
push esi
call fcn.00469960
add esp, 4
mov eax, dword [ebp - 0x38]
mov edi, dword [ebp - 0x34]
mov dword [ebp - 0x1c], eax
mov ebx, dword [ebp - 0x1c]
mov dword [ebp - 0x30], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x14], edi
push 0
call sub.kernel32.dll_SetLastError
push edi
push ebx
push dword [ebp - 0x20]
call sub.kernel32.dll_GetEnvironmentVariableW
mov esi, eax
test eax, eax
jne 0x489858
call sub.kernel32.dll_GetLastError
test eax, eax
jne 0x489978
cmp esi, edi
jne 0x4897e0
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
jne 0x489992
lea esi, [edi + edi]
test edi, edi
mov eax, 0xffffffff
cmovs esi, eax
cmp esi, 0x201
jb 0x4897ee
jmp 0x489800
lea ecx, [ebp - 0x448]
call fcn.004695e0
mov byte [esi + 0xc], 2
jmp 0x48996d
mov edx, dword [ebp - 0x2c]
cmp esi, edx
ja 0x4899ab
mov edx, ebx
lea ecx, [ebp - 0x48]
push esi
call fcn.0046b4e0
add esp, 4
mov eax, dword [ebp - 0x40]
movzx edx, word [ebp - 0x3b]
movzx ecx, byte [ebp - 0x39]
mov edi, dword [ebp - 0x48]
mov esi, dword [ebp - 0x44]
movzx ebx, byte [ebp - 0x3c]
mov dword [ebp - 0x10], eax
mov word [ebp - 0x18], dx
mov byte [ebp - 0x16], cl
cmp dword [ebp - 0x14], 0
je 0x4898ea
push dword [ebp - 0x1c]
push 0
push dword [0x4e4100]
call sub.kernel32.dll_HeapFree
cmp bl, 2
jne 0x489938
mov eax, dword [ebp - 0x24]
mov byte [eax + 0xc], 2
mov eax, edi
cmp al, 3
jne 0x489957
mov ebx, dword [esi]
mov edi, esi
mov esi, dword [esi + 4]
mov eax, dword [esi]
push ebx
call eax
add esp, 4
cmp dword [esi + 4], 0
je 0x489928
cmp dword [esi + 8], 9
jb 0x48991a
mov ebx, dword [ebx - 4]
push ebx
push 0
push dword [0x4e4100]
call sub.kernel32.dll_HeapFree
push edi
push 0
push dword [0x4e4100]
call sub.kernel32.dll_HeapFree
jmp 0x489957
movzx eax, word [ebp - 0x18]
mov ecx, dword [ebp - 0x24]
mov bh, byte [ebp - 0x16]
mov edx, dword [ebp - 0x10]
mov word [ecx + 0xd], ax
mov byte [ecx + 0xf], bh
mov dword [ecx], edi
mov dword [ecx + 4], esi
mov dword [ecx + 8], edx
mov byte [ecx + 0xc], bl
cmp dword [ebp - 0x28], 0
je 0x48996d
push dword [ebp - 0x20]
push 0
push dword [0x4e4100]
call sub.kernel32.dll_HeapFree
add esp, 0x43c
pop esi
pop edi
pop ebx
pop ebp
ret
xor edi, edi
mov bl, 2
call sub.kernel32.dll_GetLastError
mov esi, eax
cmp dword [ebp - 0x14], 0
jne 0x4898da
jmp 0x4898ea
mov edx, 0x28
mov ecx, str.internal_error:_entered_unreachable_code
push 0x4ca414
call fcn.004478a0
add esp, 4
jmp 0x4899ba
mov ecx, esi
push 0x4ca404
call fcn.004475b0
add esp, 4
ud2