Function at 0x404fa8
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 0x4052d0
mov eax, dword [ebp + 8]
mov ebx, dword [eax + 8]
test ebx, ebx
je 0x405214
mov eax, dword [ebx + 0x14]
mov dword [ebp - 0x2c], eax
mov esi, dword [ebx + 0x30]
test esi, esi
je 0x405220
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.0040f508
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 0x405048
rol ax, 8
rol eax, 0x10
rol ax, 8
test eax, eax
je 0x405214
lea esi, [eax - 1]
cmp dword [ebp - 0x2c], esi
jbe 0x4051ec
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 0x18]
mov eax, dword [ecx + esi*8]
test edx, edx
je 0x405074
rol ax, 8
rol eax, 0x10
rol ax, 8
cmp eax, dword [ebp - 0x34]
jb 0x4050bc
mov eax, dword [ebx]
test edx, edx
mov edx, dword [ecx + esi*8 + 4]
je 0x40508e
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 0x4050c2
cmp edi, dword [ebp - 0x38]
jb 0x40520c
add edi, dword [ebp - 0x40]
jmp 0x405030
xor eax, eax
test al, al
je 0x4050a8
mov edx, esi
cmp edx, dword [ebp - 0x2c]
jae 0x405288
mov ecx, dword [ebx]
mov eax, dword [ebx + 0xc]
test eax, eax
mov eax, dword [ebx + 0x1c]
je 0x4052bc
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 0x4052a9
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x40538b
mov eax, dword [ebp + 0xc]
mov esi, dword [eax + 8]
test esi, esi
je 0x40538b
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.00406300
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x4054c0
mov esi, dword [ebx + 0x3c]
test esi, esi
je 0x4052f7
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 0x405177
sub esi, 0xc
test ebx, ebx
je 0x4052f1
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 0x40516c
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.00406578
test eax, eax
mov edx, dword [ebp - 0x30]
jne 0x4054c0
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 4], 0xffffffff
je 0x4052a9
mov eax, dword [eax + 8]
test eax, eax
je 0x405736
cmp eax, 0xffffffff
je 0x40572e
mov eax, dword [eax + edx*4]
test eax, eax
je 0x4053ec
lea ecx, [eax + 4]
mov dword [ebp - 0x34], ecx
mov eax, dword [eax]
mov dword [ebp - 0x38], eax
jmp 0x4052a9
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 0x4050bc
mov eax, dword [eax + 4]
jmp 0x405090
add edi, dword [ebp - 0x3c]
jmp 0x405030
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 0x405235
je 0x4052e8
lea edi, [ebx + 1]
cmp edi, dword [ebp - 0x30]
jae 0x405214
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 0x405266
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 0x40522c
cmp ebx, edi
jbe 0x405214
mov dword [ebp - 0x30], ebx
jmp 0x405245
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 0x40510f
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 0x40529e
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.00403944
jmp 0x404fbf
mov edx, ebx
mov ebx, esi
jmp 0x4050c4
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.00406578
test eax, eax
mov edx, dword [ebp - 0x3c]
jne 0x4054c0
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.00406440
test eax, eax
jne 0x4054c0
mov eax, dword [ebx + 0x3c]
mov dword [ebp - 0x40], eax
test eax, eax
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebx + 0x38]
je 0x4057a7
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 0x405367
sub ebx, 0xc
test edi, edi
je 0x405546
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 0x40535c
mov edx, dword [ebp - 0x4c]
mov ebx, dword [ebp - 0x50]
mov dword [ebp - 0x30], edx
jmp 0x405199
mov ecx, dword [0x427104]
test ecx, ecx
je 0x4053b9
mov esi, dword [0x427100]
mov dword [ebp - 0x30], esi
test esi, esi
jne 0x40512b
mov dword [ebp - 0x3c], edx
call fcn.00405fe0
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x3c]
jmp 0x40512b
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 0x4053da
cmp byte [eax], 0
jne 0x405693
mov esi, dword [0x427100]
mov dword [0x427104], 1
jmp 0x40539b
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x41c120
call fcn.004061d8
test eax, eax
mov edx, dword [ebp - 0x2c]
jne 0x4054c0
mov eax, dword [0x42710c]
add eax, 4
xor esi, esi
xor edi, edi
lea ebx, [ebp - 0x20]
mov dword [ebp - 0x2c], edx
jmp 0x405455
test edi, edi
je 0x4054c8
inc edi
mov ecx, edi
shl ecx, 4
mov eax, edi
shl eax, 0xc
sub eax, ecx
mov dword [0x427108], eax
mov dword [esp + 4], eax
mov dword [esp], esi
call sub.msvcrt.dll_realloc
mov esi, eax
test esi, esi
je 0x40577e
mov dword [0x42710c], 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 [0x427108]
cmp eax, 3
jbe 0x40541c
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 0x4054ea
call sub.msvcrt.dll__errno
cmp dword [eax], 7
je 0x40541c
mov dword [esp], 0x41c120
call fcn.00406240
test eax, eax
je 0x405216
call sub.msvcrt.dll_abort
lea esi, [esi]
mov dword [0x427108], 0xff0
mov dword [esp], 0xff0
call sub.msvcrt.dll_malloc
mov esi, eax
mov edi, 1
jmp 0x405444
mov edx, dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x20]
mov eax, dword [0x42710c]
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 [0x427108]
mov edx, eax
and edx, 3
add ecx, edx
mov dword [0x42710c], ecx
and eax, 0xfffffffc
mov dword [0x427108], eax
mov dword [esp], 0x41c120
call fcn.00406240
test eax, eax
jne 0x4054c0
mov eax, dword [edi + 8]
mov eax, dword [eax + esi]
jmp 0x4051db
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 0x4056c8
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 0x40571b
mov dword [ebp - 0x48], edx
mov dword [ebx + 0x38], esi
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sub.msvcrt.dll__strdup
mov edx, eax
mov dword [ebp - 0x30], eax
test eax, eax
je 0x40571b
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], 0x41e0e3
mov ecx, dword [ebp + 0xc]
mov dword [esp + 4], ecx
mov ecx, dword [ebp + 8]
mov dword [esp], ecx
call fcn.00404fa8
test eax, eax
mov edx, dword [ebp - 0x48]
je 0x405681
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 0x405681
mov dword [ebp - 0x4c], edx
lea esi, [eax + 8]
mov dword [esp + 4], 0x41e0ed
mov dword [esp], esi
call sub.msvcrt.dll_strcspn
mov ecx, eax
lea eax, [eax + 0x1f]
and eax, 0xfffffff0
call fcn.00413290
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 0x4056da
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 0x405383
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 0x4056bc
mov edi, eax
mov ecx, dword [ebp - 0x30]
rep movsb byte es:[edi], byte [esi]
mov dword [0x427100], eax
mov esi, eax
jmp 0x4053e0
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov esi, eax
mov edx, dword [ebp - 0x3c]
jmp 0x405579
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.00413290
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 0x405670
mov eax, dword [ebp - 0x44]
mov dword [esp], eax
call fcn.00406578
test eax, eax
jne 0x4054c0
or eax, 0xffffffff
jmp 0x405216
mov dword [ebp - 0x30], edx
mov dword [esp], 0x41c120
call fcn.004061d8
test eax, eax
jne 0x4054c0
mov eax, dword [ebp - 0x3c]
cmp dword [eax + 8], 0
mov edx, dword [ebp - 0x30]
je 0x4057af
mov dword [ebp - 0x2c], edx
mov dword [esp], 0x41c120
call fcn.00406240
test eax, eax
jne 0x4054c0
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x2c]
jmp 0x4051c7
mov dword [0x42710c], 0
mov dword [0x427108], 0
mov dword [esp], 0x41c120
call fcn.00406240
test eax, eax
je 0x40572e
jmp 0x4054c0
mov dword [ebp - 0x48], eax
jmp 0x40554c
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 0x405406
mov dword [ecx + 8], 0xffffffff
jmp 0x405759