Function at 0x4a6fdc
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x5c
mov eax, dword [ebp + 8]
mov edi, dword [eax + 4]
test edi, edi
jle 0x4a7304
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x4a7248
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x2c], eax
mov esi, dword [ebx + 0x30]
test esi, esi
je 0x4a7254
xor eax, eax
mov ecx, 0xffffffff
mov edi, dword [ebp + 0x10]
repne scasb al, byte es:[edi]
not ecx
lea eax, [ecx - 1]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call fcn.004b153c
mov esi, eax
mov ecx, dword [ebx + 0x2c]
xor edx, edx
div ecx
mov edi, edx
lea eax, [ecx - 2]
mov dword [ebp - 0x30], eax
mov eax, esi
xor edx, edx
div dword [ebp - 0x30]
lea eax, [edx + 1]
mov dword [ebp - 0x3c], eax
mov edx, dword [ebx + 0x34]
mov dword [ebp - 0x30], edx
mov edx, ecx
sub edx, eax
mov dword [ebp - 0x38], edx
sub eax, ecx
mov dword [ebp - 0x40], eax
lea esi, [esi]
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + edi*4]
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x4a707c
rol ax, 8
rol eax, 0x10
rol ax, 8
test eax, eax
je 0x4a7248
lea esi, [eax - 1]
cmp dword [ebp - 0x2c], esi
jbe 0x4a7220
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x18]
mov eax, dword [ecx + esi*8]
test edx, edx
je 0x4a70a8
rol ax, 8
rol eax, 0x10
rol ax, 8
cmp eax, dword [ebp - 0x34]
jb 0x4a70f0
mov eax, dword [ebx]
test edx, edx
mov edx, dword [ecx + esi*8 + 4]
je 0x4a70c2
rol dx, 8
rol edx, 0x10
rol dx, 8
add eax, edx
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
sete al
test al, al
jne 0x4a70f6
cmp edi, dword [ebp - 0x38]
jb 0x4a7240
add edi, dword [ebp - 0x40]
jmp 0x4a7064
xor eax, eax
test al, al
je 0x4a70dc
mov edx, esi
cmp edx, dword [ebp - 0x2c]
jae 0x4a72bc
mov ecx, dword [ebx]
mov eax, dword [ebx + 0xc]
test eax, eax
mov eax, dword [ebx + 0x1c]
je 0x4a72f0
lea esi, [eax + edx*8]
mov eax, dword [esi + 4]
rol ax, 8
rol eax, 0x10
rol ax, 8
add eax, ecx
mov dword [ebp - 0x34], eax
mov eax, dword [esi]
rol ax, 8
rol eax, 0x10
rol ax, 8
inc eax
mov dword [ebp - 0x38], eax
mov edi, dword [ebp + 0x14]
test edi, edi
je 0x4a72dd
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x4a73bf
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 8]
test esi, esi
je 0x4a73bf
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x3c], edx
lea eax, [ebx + 0x40]
mov dword [ebp - 0x44], eax
mov dword [esp], eax
call fcn.004a8334
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x4a74f4
mov esi, dword [ebx + 0x3c]
test esi, esi
je 0x4a732b
lea eax, [esi + esi]
add eax, esi
mov ecx, dword [ebx + 0x38]
lea edi, [ecx + eax*4 - 0xc]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x40], ebx
mov ebx, esi
mov esi, edi
jmp 0x4a71ab
sub esi, 0xc
test ebx, ebx
je 0x4a7325
dec ebx
mov eax, dword [ebp - 0x30]
mov dword [esp + 4], eax
mov eax, dword [esi]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a71a0
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x3c], esi
mov ebx, dword [ebp - 0x40]
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a85ac
test eax, eax
mov edx, dword [ebp - 0x30]
jne 0x4a74f4
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 4], 0xffffffff
je 0x4a72dd
mov eax, dword [eax + 8]
test eax, eax
je 0x4a776a
cmp eax, 0xffffffff
je 0x4a7762
mov eax, dword [eax + edx*4]
test eax, eax
je 0x4a7420
lea ecx, [eax + 4]
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
jmp 0x4a72dd
mov edx, esi
sub edx, dword [ebp - 0x2c]
mov eax, dword [ebx + 0x24]
lea eax, [eax + edx*8]
mov ecx, dword [ebp - 0x34]
cmp ecx, dword [eax]
jae 0x4a70f0
mov eax, dword [eax + 4]
jmp 0x4a70c4
add edi, dword [ebp - 0x3c]
jmp 0x4a7064
xor eax, eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x30], eax
xor edi, edi
mov esi, ebx
jmp 0x4a7269
je 0x4a731c
lea edi, [ebx + 1]
cmp edi, dword [ebp - 0x30]
jae 0x4a7248
mov eax, dword [esi]
mov dword [ebp - 0x38], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x30]
lea ebx, [eax + edi]
shr ebx, 1
mov eax, dword [esi + 0x18]
mov eax, dword [eax + ebx*8 + 4]
mov edx, dword [ebp - 0x34]
test edx, edx
je 0x4a729a
rol ax, 8
rol eax, 0x10
rol ax, 8
add eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jns 0x4a7260
cmp ebx, edi
jbe 0x4a7248
mov dword [ebp - 0x30], ebx
jmp 0x4a7279
mov ecx, edx
sub ecx, dword [ebp - 0x2c]
mov eax, dword [ebx + 0x28]
lea eax, [eax + ecx*8]
mov ecx, dword [eax + 4]
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
mov edi, dword [ebp + 0x14]
test edi, edi
jne 0x4a7143
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp - 0x38]
mov dword [eax], ecx
mov eax, dword [ebp - 0x34]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [eax + edx*8]
add ecx, dword [eax + 4]
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
inc eax
mov dword [ebp - 0x38], eax
jmp 0x4a72d2
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004a5978
jmp 0x4a6ff3
mov edx, ebx
mov ebx, esi
jmp 0x4a70f8
mov edx, dword [ebp - 0x3c]
mov ebx, dword [ebp - 0x40]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a85ac
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x4a74f4
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a8474
test eax, eax
jne 0x4a74f4
mov eax, dword [ebx + 0x3c]
mov dword [ebp - 0x40], eax
test eax, eax
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebx + 0x38]
je 0x4a77db
mov edi, eax
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x40]
mov eax, ecx
add eax, ecx
add eax, ecx
lea edi, [edi + eax*4 - 0xc]
mov dword [ebp - 0x4c], edx
mov dword [ebp - 0x50], ebx
mov ebx, edi
mov edi, ecx
mov esi, dword [ebp - 0x30]
jmp 0x4a739b
sub ebx, 0xc
test edi, edi
je 0x4a757a
dec edi
mov dword [ebp - 0x3c], ebx
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_strcmp
test eax, eax
jne 0x4a7390
mov edx, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
mov dword [ebp - 0x30], edx
jmp 0x4a71cd
mov ecx, dword [0x50d80c]
test ecx, ecx
je 0x4a73ed
mov esi, dword [0x50d808]
mov dword [ebp - 0x30], esi
test esi, esi
jne 0x4a715f
mov dword [ebp - 0x3c], edx
call fcn.004a8014
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x3c]
jmp 0x4a715f
mov dword [ebp - 0x30], edx
mov dword [esp], str.OUTPUT_CHARSET
call sub.msvcrt.dll_getenv
mov esi, eax
test eax, eax
mov edx, dword [ebp - 0x30]
je 0x4a740e
cmp byte [eax], 0
jne 0x4a76c7
mov esi, dword [0x50d808]
mov dword [0x50d80c], 1
jmp 0x4a73cf
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x4bf4a0
call fcn.004a820c
test eax, eax
mov edx, dword [ebp - 0x2c]
jne 0x4a74f4
mov eax, dword [0x50d814]
add eax, 4
xor esi, esi
xor edi, edi
lea ebx, [ebp - 0x20]
mov dword [ebp - 0x2c], edx
jmp 0x4a7489
test edi, edi
je 0x4a74fc
inc edi
mov ecx, edi
shl ecx, 4
mov eax, edi
shl eax, 0xc
sub eax, ecx
mov dword [0x50d810], eax
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_realloc
mov esi, eax
test esi, esi
je 0x4a77b2
mov dword [0x50d814], esi
lea eax, [esi + 4]
mov ecx, dword [ebp - 0x34]
mov dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x38]
mov dword [ebp - 0x24], ecx
mov dword [ebp - 0x20], eax
mov eax, dword [0x50d810]
cmp eax, 3
jbe 0x4a7450
sub eax, 4
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], ebx
lea eax, [ebp - 0x24]
mov dword [esp + 8], eax
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 4]
mov dword [esp], eax
call sub.libiconv_2.dll_libiconv
inc eax
jne 0x4a751e
call sub.msvcrt.dll__errno
cmp dword [eax], 7
je 0x4a7450
mov dword [esp], 0x4bf4a0
call fcn.004a8274
test eax, eax
je 0x4a724a
call sub.msvcrt.dll_abort
lea esi, [esi]
mov dword [0x50d810], 0xff0
mov dword [esp], 0xff0
call sub.msvcrt.dll_malloc
mov esi, eax
mov edi, 1
jmp 0x4a7478
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x20]
mov eax, dword [0x50d814]
mov esi, ecx
sub esi, eax
sub esi, 4
mov dword [eax], esi
lea esi, [edx*4]
mov edi, dword [ebp - 0x3c]
mov edx, dword [edi + 8]
mov dword [edx + esi], eax
sub eax, ecx
add eax, dword [0x50d810]
mov edx, eax
and edx, 3
add ecx, edx
mov dword [0x50d814], ecx
and eax, 0xfffffffc
mov dword [0x50d810], eax
mov dword [esp], 0x4bf4a0
call fcn.004a8274
test eax, eax
jne 0x4a74f4
mov eax, dword [edi + 8]
mov eax, dword [eax + esi]
jmp 0x4a720f
mov edx, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
mov edi, dword [ebp - 0x48]
mov dword [ebp - 0x3c], edx
mov ecx, dword [ebp - 0x40]
mov eax, ecx
add eax, ecx
lea eax, [eax + ecx + 3]
shl eax, 2
test edi, edi
je 0x4a76fc
mov dword [esp + 4], eax
mov dword [esp], edi
call sub.msvcrt.dll_realloc
mov esi, eax
mov edx, dword [ebp - 0x3c]
test esi, esi
je 0x4a774f
mov dword [ebp - 0x48], edx
mov dword [ebx + 0x38], esi
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call fcn.004b3fe8
mov edx, eax
mov dword [ebp - 0x30], eax
test eax, eax
je 0x4a774f
mov ecx, dword [ebp - 0x40]
mov eax, ecx
add eax, ecx
add eax, ecx
lea eax, [esi + eax*4]
mov ecx, eax
mov dword [ebp - 0x3c], eax
mov dword [ecx], edx
mov dword [ecx + 4], 0xffffffff
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x4eb4a3
mov ecx, dword [ebp + 0xc]
mov dword [esp + 4], ecx
mov ecx, dword [ebp + 8]
mov dword [esp], ecx
call fcn.004a6fdc
test eax, eax
mov edx, dword [ebp - 0x48]
je 0x4a76b5
mov dword [ebp - 0x40], edx
mov dword [esp + 4], str.charset
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
mov edx, dword [ebp - 0x40]
je 0x4a76b5
mov dword [ebp - 0x4c], edx
lea esi, [eax + 8]
mov dword [esp + 4], 0x4eb4ad
mov dword [esp], esi
call sub.msvcrt.dll_strcspn
mov ecx, eax
lea eax, [eax + 0x1f]
and eax, 0xfffffff0
call fcn.004b3a40
sub esp, eax
lea edi, [esp + 0x23]
mov dword [ebp - 0x40], edi
and dword [ebp - 0x40], 0xfffffff0
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x48], ecx
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 0x40]
mov ecx, dword [ebp - 0x48]
mov byte [edi + ecx], 0
mov dword [esp + 4], 0x2f
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll_strchr
test eax, eax
mov edx, dword [ebp - 0x4c]
mov dword [ebp - 0x48], edx
je 0x4a770e
mov eax, dword [ebp - 0x40]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.libiconv_2.dll_libiconv_open
mov ecx, dword [ebp - 0x3c]
mov dword [ecx + 4], eax
mov edx, dword [ebp - 0x48]
mov eax, dword [ebp - 0x3c]
mov dword [eax + 8], 0
inc dword [ebx + 0x3c]
jmp 0x4a73b7
mov dword [ebp - 0x3c], edx
xor eax, eax
mov ecx, 0xffffffff
mov edi, esi
repne scasb al, byte es:[edi]
not ecx
mov dword [esp], ecx
mov dword [ebp - 0x30], ecx
call sub.msvcrt.dll_malloc
test eax, eax
mov edx, dword [ebp - 0x3c]
je 0x4a76f0
mov edi, eax
mov ecx, dword [ebp - 0x30]
rep movsb byte es:[edi], byte [esi]
mov dword [0x50d808], eax
mov esi, eax
jmp 0x4a7414
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov esi, eax
mov edx, dword [ebp - 0x3c]
jmp 0x4a75ad
mov ecx, 0xffffffff
mov edi, dword [ebp - 0x30]
repne scasb al, byte es:[edi]
mov eax, ecx
not eax
lea ecx, [eax - 1]
add eax, 0x28
and eax, 0xfffffff0
call fcn.004b3a40
sub esp, eax
lea eax, [esp + 0x23]
and eax, 0xfffffff0
mov edi, eax
mov esi, dword [ebp - 0x30]
rep movsb byte es:[edi], byte [esi]
mov esi, str.__TRANSLIT
mov cl, 0xb
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp - 0x40]
mov dword [esp + 4], ecx
jmp 0x4a76a4
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.004a85ac
test eax, eax
jne 0x4a74f4
or eax, 0xffffffff
jmp 0x4a724a
mov dword [ebp - 0x30], edx
mov dword [esp], 0x4bf4a0
call fcn.004a820c
test eax, eax
jne 0x4a74f4
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 8], 0
mov edx, dword [ebp - 0x30]
je 0x4a77e3
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x4bf4a0
call fcn.004a8274
test eax, eax
jne 0x4a74f4
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x2c]
jmp 0x4a71fb
mov dword [0x50d814], 0
mov dword [0x50d810], 0
mov dword [esp], 0x4bf4a0
call fcn.004a8274
test eax, eax
je 0x4a7762
jmp 0x4a74f4
mov dword [ebp - 0x48], eax
jmp 0x4a7580
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 ecx, dword [ebp - 0x3c]
mov dword [ecx + 8], eax
test eax, eax
mov edx, dword [ebp - 0x30]
jne 0x4a743a
mov dword [ecx + 8], 0xffffffff
jmp 0x4a778d