Function at 0x49756c
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 0x497894
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x4977d8
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x2c], eax
mov esi, dword [ebx + 0x30]
test esi, esi
je 0x4977e4
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.0049aec0
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 0x49760c
rol ax, 8
rol eax, 0x10
rol ax, 8
test eax, eax
je 0x4977d8
lea esi, [eax - 1]
cmp dword [ebp - 0x2c], esi
jbe 0x4977b0
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x18]
mov eax, dword [ecx + esi*8]
test edx, edx
je 0x497638
rol ax, 8
rol eax, 0x10
rol ax, 8
cmp eax, dword [ebp - 0x34]
jb 0x497680
mov eax, dword [ebx]
test edx, edx
mov edx, dword [ecx + esi*8 + 4]
je 0x497652
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 0x497686
cmp edi, dword [ebp - 0x38]
jb 0x4977d0
add edi, dword [ebp - 0x40]
jmp 0x4975f4
xor eax, eax
test al, al
je 0x49766c
mov edx, esi
cmp edx, dword [ebp - 0x2c]
jae 0x49784c
mov ecx, dword [ebx]
mov eax, dword [ebx + 0xc]
test eax, eax
mov eax, dword [ebx + 0x1c]
je 0x497880
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 0x49786d
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x49794f
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 8]
test esi, esi
je 0x49794f
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.004987c0
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x497a84
mov esi, dword [ebx + 0x3c]
test esi, esi
je 0x4978bb
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 0x49773b
sub esi, 0xc
test ebx, ebx
je 0x4978b5
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 0x497730
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.00498a38
test eax, eax
mov edx, dword [ebp - 0x30]
jne 0x497a84
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 4], 0xffffffff
je 0x49786d
mov eax, dword [eax + 8]
test eax, eax
je 0x497cfa
cmp eax, 0xffffffff
je 0x497cf2
mov eax, dword [eax + edx*4]
test eax, eax
je 0x4979b0
lea ecx, [eax + 4]
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
jmp 0x49786d
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 0x497680
mov eax, dword [eax + 4]
jmp 0x497654
add edi, dword [ebp - 0x3c]
jmp 0x4975f4
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 0x4977f9
je 0x4978ac
lea edi, [ebx + 1]
cmp edi, dword [ebp - 0x30]
jae 0x4977d8
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 0x49782a
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 0x4977f0
cmp ebx, edi
jbe 0x4977d8
mov dword [ebp - 0x30], ebx
jmp 0x497809
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 0x4976d3
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 0x497862
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.0049aef0
jmp 0x497583
mov edx, ebx
mov ebx, esi
jmp 0x497688
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.00498a38
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x497a84
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.00498900
test eax, eax
jne 0x497a84
mov eax, dword [ebx + 0x3c]
mov dword [ebp - 0x40], eax
test eax, eax
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebx + 0x38]
je 0x497d6b
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 0x49792b
sub ebx, 0xc
test edi, edi
je 0x497b0a
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 0x497920
mov edx, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
mov dword [ebp - 0x30], edx
jmp 0x49775d
mov ecx, dword [0x4f758c]
test ecx, ecx
je 0x49797d
mov esi, dword [0x4f7588]
mov dword [ebp - 0x30], esi
test esi, esi
jne 0x4976ef
mov dword [ebp - 0x3c], edx
call fcn.004984a0
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x3c]
jmp 0x4976ef
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 0x49799e
cmp byte [eax], 0
jne 0x497c57
mov esi, dword [0x4f7588]
mov dword [0x4f758c], 1
jmp 0x49795f
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x4aa440
call fcn.00498698
test eax, eax
mov edx, dword [ebp - 0x2c]
jne 0x497a84
mov eax, dword [0x4f7594]
add eax, 4
xor esi, esi
xor edi, edi
lea ebx, [ebp - 0x20]
mov dword [ebp - 0x2c], edx
jmp 0x497a19
test edi, edi
je 0x497a8c
inc edi
mov ecx, edi
shl ecx, 4
mov eax, edi
shl eax, 0xc
sub eax, ecx
mov dword [0x4f7590], eax
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_realloc
mov esi, eax
test esi, esi
je 0x497d42
mov dword [0x4f7594], 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 [0x4f7590]
cmp eax, 3
jbe 0x4979e0
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 0x497aae
call sub.msvcrt.dll__errno
cmp dword [eax], 7
je 0x4979e0
mov dword [esp], 0x4aa440
call fcn.00498700
test eax, eax
je 0x4977da
call sub.msvcrt.dll_abort
lea esi, [esi]
mov dword [0x4f7590], 0xff0
mov dword [esp], 0xff0
call sub.msvcrt.dll_malloc
mov esi, eax
mov edi, 1
jmp 0x497a08
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x20]
mov eax, dword [0x4f7594]
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 [0x4f7590]
mov edx, eax
and edx, 3
add ecx, edx
mov dword [0x4f7594], ecx
and eax, 0xfffffffc
mov dword [0x4f7590], eax
mov dword [esp], 0x4aa440
call fcn.00498700
test eax, eax
jne 0x497a84
mov eax, dword [edi + 8]
mov eax, dword [eax + esi]
jmp 0x49779f
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 0x497c8c
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 0x497cdf
mov dword [ebp - 0x48], edx
mov dword [ebx + 0x38], esi
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call fcn.0049ee48
mov edx, eax
mov dword [ebp - 0x30], eax
test eax, eax
je 0x497cdf
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], 0x4d1af3
mov ecx, dword [ebp + 0xc]
mov dword [esp + 4], ecx
mov ecx, dword [ebp + 8]
mov dword [esp], ecx
call fcn.0049756c
test eax, eax
mov edx, dword [ebp - 0x48]
je 0x497c45
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 0x497c45
mov dword [ebp - 0x4c], edx
lea esi, [eax + 8]
mov dword [esp + 4], 0x4d1afd
mov dword [esp], esi
call sub.msvcrt.dll_strcspn
mov ecx, eax
lea eax, [eax + 0x1f]
and eax, 0xfffffff0
call fcn.0049e8a0
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 0x497c9e
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 0x497947
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 0x497c80
mov edi, eax
mov ecx, dword [ebp - 0x30]
rep movsb byte es:[edi], byte [esi]
mov dword [0x4f7588], eax
mov esi, eax
jmp 0x4979a4
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov esi, eax
mov edx, dword [ebp - 0x3c]
jmp 0x497b3d
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.0049e8a0
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 0x497c34
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.00498a38
test eax, eax
jne 0x497a84
or eax, 0xffffffff
jmp 0x4977da
mov dword [ebp - 0x30], edx
mov dword [esp], 0x4aa440
call fcn.00498698
test eax, eax
jne 0x497a84
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 8], 0
mov edx, dword [ebp - 0x30]
je 0x497d73
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x4aa440
call fcn.00498700
test eax, eax
jne 0x497a84
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x2c]
jmp 0x49778b
mov dword [0x4f7594], 0
mov dword [0x4f7590], 0
mov dword [esp], 0x4aa440
call fcn.00498700
test eax, eax
je 0x497cf2
jmp 0x497a84
mov dword [ebp - 0x48], eax
jmp 0x497b10
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 0x4979ca
mov dword [ecx + 8], 0xffffffff
jmp 0x497d1d