Function at 0x4a2010
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x6c
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
test ecx, ecx
jle 0x4a2330
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x4a2200
mov edx, dword [ebx + 0x30]
mov eax, dword [ebx + 0x14]
test edx, edx
mov dword [ebp - 0x2c], eax
je 0x4a2190
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call fcn.004a9af0
mov ecx, dword [ebx + 0x2c]
xor edx, edx
mov edi, eax
div ecx
lea eax, [ecx - 2]
mov esi, edx
mov edx, eax
mov eax, edi
mov edi, edx
xor edx, edx
div edi
mov edi, ecx
lea eax, [edx + 1]
mov edx, dword [ebx + 0x34]
sub edi, eax
mov dword [ebp - 0x38], eax
sub eax, ecx
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x3c], eax
mov edx, dword [ebx + 0x30]
mov dword [ebp - 0x40], edi
jmp 0x4a20e1
mov ecx, dword [ebx + 0xc]
mov eax, dword [ebx + 0x18]
test ecx, ecx
je 0x4a2170
lea ecx, [eax + edi*8]
mov eax, dword [ecx]
bswap eax
cmp dword [ebp - 0x34], eax
ja 0x4a20cd
mov eax, dword [ecx + 4]
mov edx, dword [ebx]
bswap eax
add edx, eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
je 0x4a2125
mov edx, dword [ebx + 0x30]
mov edi, dword [ebp - 0x40]
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x38]
add eax, esi
add ecx, esi
cmp esi, edi
cmovb eax, ecx
mov esi, eax
mov eax, dword [ebp - 0x30]
mov edi, dword [edx + esi*4]
test eax, eax
je 0x4a20ed
bswap edi
test edi, edi
je 0x4a2200
sub edi, 1
cmp dword [ebp - 0x2c], edi
ja 0x4a2094
mov ecx, edi
sub ecx, dword [ebp - 0x2c]
mov eax, dword [ebx + 0x24]
lea eax, [eax + ecx*8]
mov ecx, dword [ebp - 0x34]
cmp ecx, dword [eax]
jae 0x4a20cd
mov eax, dword [eax + 4]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a20ca
mov dword [ebp - 0x30], edi
mov esi, dword [ebp - 0x30]
mov edx, dword [ebp - 0x2c]
cmp esi, edx
jb 0x4a2210
mov edx, dword [ebp - 0x30]
sub edx, dword [ebp - 0x2c]
mov eax, dword [ebx + 0x28]
lea eax, [eax + edx*8]
mov edx, dword [eax + 4]
mov eax, dword [eax]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x3c], eax
mov esi, dword [ebp + 0x14]
test esi, esi
jne 0x4a2242
mov eax, dword [ebp + 0x18]
mov edx, dword [ebp - 0x3c]
mov dword [eax], edx
mov eax, dword [ebp - 0x38]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [eax + edi*8]
mov ecx, dword [ebp - 0x34]
cmp ecx, dword [eax]
ja 0x4a20cd
mov edx, dword [ebx]
mov eax, dword [eax + 4]
jmp 0x4a20b5
xor edi, edi
mov ecx, eax
jmp 0x4a21ad
mov ecx, ebx
mov ebx, edi
je 0x4a2350
lea edi, [esi + 1]
cmp edi, ecx
jae 0x4a2200
mov eax, dword [ebx]
mov dword [ebp - 0x30], edi
mov edi, ebx
mov dword [ebp - 0x34], eax
mov eax, dword [ebx + 0xc]
mov ebx, ecx
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x30]
mov edx, dword [ebp - 0x38]
lea esi, [eax + ebx]
mov eax, dword [edi + 0x18]
shr esi, 1
test edx, edx
mov eax, dword [eax + esi*8 + 4]
je 0x4a21db
bswap eax
add eax, dword [ebp - 0x34]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jns 0x4a21a0
cmp dword [ebp - 0x30], esi
mov ebx, esi
jb 0x4a21c3
nop
lea esi, [esi]
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov edi, dword [ebx + 0xc]
mov eax, dword [ebx]
mov edx, dword [ebx + 0x1c]
test edi, edi
je 0x4a2310
lea ecx, [edx + esi*8]
mov esi, dword [ebp + 0x14]
mov edx, dword [ecx + 4]
bswap edx
add eax, edx
mov dword [ebp - 0x38], eax
mov eax, dword [ecx]
bswap eax
add eax, 1
test esi, esi
mov dword [ebp - 0x3c], eax
je 0x4a2158
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x4a2373
mov eax, dword [ebp + 0xc]
mov eax, dword [eax + 8]
test eax, eax
mov dword [ebp - 0x34], eax
je 0x4a2373
lea eax, [ebx + 0x40]
mov dword [esp], eax
mov dword [ebp - 0x44], eax
call fcn.004a8f00
test eax, eax
jne 0x4a236e
mov esi, dword [ebx + 0x3c]
test esi, esi
je 0x4a235b
mov ecx, dword [ebx + 0x38]
lea eax, [esi + esi*2]
mov dword [ebp - 0x48], ebx
mov ebx, esi
lea edi, [ecx + eax*4 - 0xc]
mov esi, edi
jmp 0x4a229d
sub esi, 0xc
test ebx, ebx
je 0x4a2358
mov eax, dword [ebp - 0x34]
sub ebx, 1
mov dword [esp + 4], eax
mov eax, dword [esi]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a2292
mov ebx, dword [ebp - 0x48]
mov dword [ebp - 0x40], esi
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a9430
test eax, eax
jne 0x4a236e
mov eax, dword [ebp - 0x40]
cmp dword [eax + 4], 0xffffffff
je 0x4a2158
mov eax, dword [eax + 8]
test eax, eax
je 0x4a23f6
cmp eax, 0xffffffff
je 0x4a23bf
mov edx, dword [ebp - 0x30]
mov eax, dword [eax + edx*4]
test eax, eax
je 0x4a249f
lea edx, [eax + 4]
mov eax, dword [eax]
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x3c], eax
jmp 0x4a2158
mov ecx, dword [ebp - 0x30]
lea edx, [edx + ecx*8]
add eax, dword [edx + 4]
mov dword [ebp - 0x38], eax
mov eax, dword [edx]
add eax, 1
mov dword [ebp - 0x3c], eax
jmp 0x4a214d
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004a0b30
jmp 0x4a2027
mov dword [ebp - 0x30], esi
jmp 0x4a2128
mov ebx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a9430
test eax, eax
je 0x4a2437
call sub.msvcrt.dll_abort
mov edx, dword [0x74c4e4]
mov esi, dword [0x74c4e0]
test edx, edx
je 0x4a23c9
test esi, esi
mov dword [ebp - 0x34], esi
jne 0x4a225e
call fcn.004a30f0
mov dword [ebp - 0x34], eax
jmp 0x4a225e
mov dword [esp], 0x61cb60
mov dword [0x74c4ec], 0
mov dword [0x74c4e8], 0
call fcn.004a8d10
test eax, eax
jne 0x4a236e
mov eax, 0xffffffff
jmp 0x4a2202
mov dword [esp], str.OUTPUT_CHARSET
call sub.msvcrt.dll_getenv
test eax, eax
mov edi, eax
je 0x4a23e4
cmp byte [eax], 0
jne 0x4a26bd
mov esi, dword [0x74c4e0]
mov dword [0x74c4e4], 1
jmp 0x4a2383
mov dword [esp], 0x61cb60
call fcn.004a8c20
test eax, eax
jne 0x4a236e
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 8]
test eax, eax
je 0x4a26f7
mov dword [esp], 0x61cb60
call fcn.004a8d10
test eax, eax
jne 0x4a236e
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 8]
jmp 0x4a22e6
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a90a0
test eax, eax
jne 0x4a236e
mov eax, dword [ebx + 0x3c]
test eax, eax
mov dword [ebp - 0x48], eax
mov eax, dword [ebx + 0x38]
je 0x4a281f
mov edx, dword [ebp - 0x48]
mov ecx, eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x50], ebx
mov esi, dword [ebp - 0x34]
lea eax, [edx + edx*2]
mov ebx, edx
lea edi, [ecx + eax*4 - 0xc]
jmp 0x4a247f
sub edi, 0xc
test ebx, ebx
je 0x4a2592
mov dword [esp + 4], esi
mov eax, dword [edi]
sub ebx, 1
mov dword [ebp - 0x40], edi
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a2474
mov ebx, dword [ebp - 0x50]
jmp 0x4a22bb
mov dword [esp], 0x61cb60
call fcn.004a8c20
test eax, eax
jne 0x4a236e
mov eax, dword [0x74c4ec]
xor esi, esi
xor edi, edi
lea ebx, [ebp - 0x1c]
add eax, 4
jmp 0x4a24f9
test esi, esi
je 0x4a2570
add esi, 1
mov dword [esp], edi
imul eax, esi, 0xff0
mov dword [esp + 4], eax
mov dword [0x74c4e8], eax
call sub.msvcrt.dll_realloc
mov edi, eax
test edi, edi
je 0x4a239b
lea eax, [edi + 4]
mov dword [0x74c4ec], edi
mov edx, dword [ebp - 0x38]
mov dword [ebp - 0x20], eax
mov eax, dword [0x74c4e8]
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x3c]
cmp eax, 3
mov dword [ebp - 0x24], edx
jbe 0x4a24c4
sub eax, 4
mov dword [esp + 0x10], ebx
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x40]
mov eax, dword [eax + 4]
mov dword [esp], eax
call fcn.004be5e0
cmp eax, 0xffffffff
jne 0x4a2750
call dword [sym.imp.msvcrt.dll__errno]
cmp dword [eax], 7
je 0x4a24c4
mov dword [esp], 0x61cb60
call fcn.004a8d10
test eax, eax
je 0x4a2202
jmp 0x4a236e
mov dword [esp], 0xff0
mov dword [0x74c4e8], 0xff0
mov esi, 1
call sub.msvcrt.dll_malloc
mov edi, eax
jmp 0x4a24e8
mov ebx, dword [ebp - 0x50]
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 0x48]
test edx, edx
lea eax, [eax + eax*2 + 3]
je 0x4a27a8
shl eax, 2
mov dword [esp], edx
mov dword [esp + 4], eax
call sub.msvcrt.dll_realloc
mov edi, eax
test edi, edi
je 0x4a272f
mov eax, dword [ebp - 0x34]
mov dword [ebx + 0x38], edi
mov dword [esp], eax
call sub.msvcrt.dll__strdup_1
test eax, eax
mov esi, eax
je 0x4a272f
mov eax, dword [ebp - 0x48]
lea eax, [eax + eax*2]
lea eax, [edi + eax*4]
mov dword [eax], esi
mov dword [eax + 4], 0xffffffff
mov dword [ebp - 0x40], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x6679db
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004a2010
cmp eax, 0xffffffff
je 0x4a2727
test eax, eax
je 0x4a26aa
mov dword [esp + 4], str.charset
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
je 0x4a26aa
lea edi, [eax + 8]
mov dword [esp + 4], 0x6679e5
mov dword [esp], edi
call sub.msvcrt.dll_strcspn
mov edx, eax
lea eax, [eax + 0x1f]
shr eax, 4
shl eax, 4
call fcn.004ce940
sub esp, eax
lea eax, [esp + 0x23]
mov dword [esp + 8], edx
mov dword [esp + 4], edi
and eax, 0xfffffff0
mov dword [esp], eax
mov dword [ebp - 0x34], eax
call fcn.004d0b40
mov byte [eax], 0
mov dword [esp + 4], 0x2f
mov dword [esp], esi
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4a27ba
mov eax, dword [ebp - 0x34]
mov dword [esp], esi
mov dword [esp + 4], eax
call fcn.004be280
mov edx, dword [ebp - 0x40]
mov dword [edx + 4], eax
mov eax, dword [ebp - 0x40]
mov dword [eax + 8], 0
add dword [ebx + 0x3c], 1
jmp 0x4a22bb
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea edx, [eax + 1]
mov dword [esp], edx
mov dword [ebp - 0x34], edx
call sub.msvcrt.dll_malloc
test eax, eax
mov esi, eax
je 0x4a26ec
mov edx, dword [ebp - 0x34]
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [esp + 8], edx
call sub.msvcrt.dll_memcpy
mov dword [0x74c4e0], esi
jmp 0x4a23ea
mov dword [esp + 4], 4
mov eax, dword [ebp - 0x2c]
add eax, dword [ebx + 0x20]
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov edx, dword [ebp - 0x40]
test eax, eax
mov dword [edx + 8], eax
jne 0x4a24b3
mov dword [edx + 8], 0xffffffff
jmp 0x4a2418
mov dword [esp], esi
call fcn.004defc0
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a9430
test eax, eax
je 0x4a23bf
jmp 0x4a236e
mov ecx, dword [ebp - 0x20]
mov eax, dword [0x74c4ec]
mov esi, dword [ebp - 0x40]
mov edi, dword [ebp - 0x30]
mov edx, ecx
sub edx, eax
lea ebx, [edx - 4]
mov dword [eax], ebx
mov ebx, dword [esi + 8]
mov dword [ebx + edi*4], eax
mov eax, dword [0x74c4e8]
mov dword [esp], 0x61cb60
sub eax, edx
mov edx, eax
and eax, 0xfffffffc
and edx, 3
mov dword [0x74c4e8], eax
add edx, ecx
mov dword [0x74c4ec], edx
call fcn.004a8d10
test eax, eax
jne 0x4a236e
mov eax, dword [esi + 8]
mov eax, dword [eax + edi*4]
jmp 0x4a22fd
shl eax, 2
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov edi, eax
jmp 0x4a25b8
mov edi, esi
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov eax, ecx
not eax
lea edi, [eax - 1]
add eax, 0x28
shr eax, 4
shl eax, 4
call fcn.004ce940
sub esp, eax
lea eax, [esp + 0x23]
mov dword [esp + 8], edi
mov dword [esp + 4], esi
and eax, 0xfffffff0
mov esi, eax
mov dword [esp], eax
call sub.msvcrt.dll_memcpy
mov eax, esi
mov edx, esi
mov ecx, 0xb
add eax, edi
mov esi, 0x6679e9
mov edi, eax
mov eax, dword [ebp - 0x34]
rep movsb byte es:[edi], byte [esi]
mov dword [esp], edx
mov dword [esp + 4], eax
call fcn.004be280
mov edx, dword [ebp - 0x40]
mov dword [edx + 4], eax
jmp 0x4a26aa
mov dword [ebp - 0x4c], eax
jmp 0x4a2595