Function at 0x420180
Capabilities:
Query environment variable

Disassembly:
mov ecx, dword [esp + 4]
movzx edx, byte [ecx + 1]
mov eax, dword [esp + 8]
sub esp, 8
push ebx
push ebp
push esi
push edi
cmp eax, edx
jge 0x4204a2
shl eax, 4
add eax, dword [ecx + 8]
mov ebx, eax
cmp byte [ebx], 0
mov dword [esp + 0x14], ebx
je 0x4204a2
mov edi, dword [ebx + 4]
cmp word [edi], 0
jne 0x4201c6
mov eax, dword [ebx + 8]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
mov ebp, dword [ebx + 8]
xor esi, esi
test ebp, ebp
je 0x4202dd
mov eax, dword [ebp]
test eax, eax
je 0x4202dd
mov edi, edi
cmp edi, eax
jae 0x420200
cmp esi, 0xfd
jae 0x420208
mov ax, word [edi]
mov word [esi*2 + 0x4c77c0], ax
add edi, 2
inc esi
cmp edi, dword [ebp]
jb 0x4201e4
cmp esi, 0xfd
jb 0x420211
cmp edi, dword [ebp]
jb 0x42032b
mov ebx, dword [ebp + 4]
movzx eax, byte [ebx + 0x17]
cmp eax, 3
ja case.default.0x42021d
jmp dword [eax*4 + 0x4204b0]
mov eax, ebx
call fcn.00401160
cmp dword [0x4c404c], 0
jne 0x420266
cmp dword [ebx + 0xc], 0
jne 0x420266
mov edx, dword [ebx + 0x18]
push 0
lea ecx, [esp + 0x24]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x42025c
mov dword [0x4c7718], 0
dec eax
jmp 0x42029f
mov dword [0x4c7718], ebx
xor eax, eax
jmp 0x42029f
mov eax, dword [ebx + 0xc]
shr eax, 1
jmp 0x42029f
mov ecx, dword [ebx + 0xc]
push 0
call fcn.004751b0
jmp 0x42029f
xor ecx, ecx
mov ebx, 0x4c6b48
call fcn.00403b00
cmp eax, 0xffffffff
jne 0x42029f
xor eax, eax
jmp 0x42029f
mov eax, dword [ebx + 0x18]
mov ecx, dword [ebx + 0x10]
push eax
push 0
call ecx
add esp, 8
mov edx, 0xfd
sub edx, esi
cmp eax, edx
ja 0x420347
mov ecx, dword [ebp + 4]
lea eax, [esi*2 + 0x4c77c0]
push eax
call fcn.004751b0
movzx ecx, word [ebp + 0xa]
mov ebx, dword [esp + 0x14]
add ebp, 0xc
add esi, eax
mov eax, dword [ebp]
lea edi, [edi + ecx*2]
mov ecx, dword [esp + 0x1c]
test eax, eax
jne 0x4201e0
movzx eax, word [edi]
xor edx, edx
cmp ax, dx
je 0x420303
cmp esi, 0xfd
jae 0x42030b
add edi, 2
mov word [esi*2 + 0x4c77c0], ax
movzx eax, word [edi]
inc esi
cmp ax, dx
jne 0x4202e7
cmp esi, 0xfd
jb 0x42036b
cmp word [edi], dx
je 0x42036b
mov eax, dword [ebx + 4]
push eax
push edx
push str.This_dynamically_built_variable_name_is_too_long.__If_this_variable_was_not_intended_to_be_dynamic__remove_the___symbols_from_it.
call fcn.0042f3b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
mov edx, dword [ebx + 4]
push edx
push 0
push str.This_dynamically_built_variable_name_is_too_long.__If_this_variable_was_not_intended_to_be_dynamic__remove_the___symbols_from_it.
call fcn.0042f3b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + 4]
push ecx
mov ecx, dword [esp + 0x20]
push 0
push str.This_dynamically_built_variable_name_is_too_long.__If_this_variable_was_not_intended_to_be_dynamic__remove_the___symbols_from_it.
call fcn.0042f3b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
cmp esi, edx
jne 0x42038a
mov eax, dword [ebx + 4]
push eax
push edx
push str.This_dynamic_variable_is_blank._If_this_variable_was_not_intended_to_be_dynamic__remove_the___symbols_from_it.
call fcn.0042f3b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
xor ecx, ecx
test byte [0x4c77b8], 1
mov word [esi*2 + 0x4c77c0], cx
jne 0x4203ce
or dword [0x4c77b8], 1
mov dword [0x4c77a4], 0x4c5ff0
mov dword [0x4c77a8], edx
mov dword [0x4c77b4], 0x4c77c0
mov dword [0x4c77b0], 0x1000400
mov dword [0x4c77ac], edx
cmp byte [esp + 0x24], cl
jne 0x420427
push 1
push 0x4c77c0
call fcn.00475870
add esp, 8
test eax, eax
je 0x4204a2
push 0
push 3
push 0
push esi
push 0x4c77c0
mov ecx, 0x4c6048
call fcn.00420520
test eax, eax
jne 0x4204a4
mov eax, 0x4c77c0
call fcn.00420cc0
cmp eax, 1
jne 0x420427
mov eax, 0x4c779c
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc
cmp word [0x4c77c0], 0
je 0x4204a2
lea edx, [esp + 0x24]
push edx
push 3
lea eax, [esp + 0x28]
push eax
push esi
push 0x4c77c0
mov ecx, 0x4c6048
call fcn.00420520
test eax, eax
jne 0x420476
mov edx, dword [esp + 0x20]
xor ecx, ecx
cmp byte [esp + 0x24], cl
setne cl
inc ecx
push ecx
push edx
push 0x4c6048
mov ecx, esi
mov edx, 0x4c77c0
call fcn.004207c0
test eax, eax
je 0x4204a2
cmp byte [ebx], 2
jne 0x4204a4
mov cl, byte [eax + 0x17]
test cl, cl
jne 0x420488
mov ecx, dword [eax + 0xc]
mov cl, byte [ecx + 0x17]
cmp cl, 2
jbe 0x4204a4
mov ecx, dword [esp + 0x1c]
push 0x4c77c0
push 0
push str.Not_allowed_as_an_output_variable.
call fcn.0042f3b0
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret 0xc