Function at 0x407cf0
Capabilities:
Query environment variable

Disassembly:
push ebp
push edi
mov edi, edx
push esi
push ebx
sub esp, 0x3c
mov dword [esp + 0x1c], eax
mov eax, dword [0x414014]
mov dword [esp + 0x18], ecx
mov dword [0x41d0e4], 0
test eax, eax
jne 0x407274
mov dword [0x414014], 1
mov eax, 1
mov dword [esp], str.POSIXLY_CORRECT
mov dword [0x41d0e8], eax
mov dword [0x41d0ec], eax
mov dword [0x41d0f8], 0
call sub.msvcrt.dll_getenv
mov esi, dword [esp + 0x18]
movzx edx, word [esi]
mov dword [0x41d0f0], eax
cmp dx, 0x2d
je 0x4075d0
cmp dx, 0x2b
je 0x4074a6
test eax, eax
sete al
movzx eax, al
mov dword [0x41d0f4], eax
mov dword [0x41d0e0], 1
mov eax, dword [0x41d0f8]
test eax, eax
je 0x407287
cmp word [eax], 0
je 0x407287
mov eax, dword [esp + 0x50]
test eax, eax
je 0x407360
mov eax, dword [0x414014]
mov eax, dword [edi + eax*4]
movzx edx, word [eax + 2]
cmp dx, 0x2d
je 0x40712a
mov ebp, dword [esp + 0x58]
test ebp, ebp
je 0x407360
cmp word [eax + 4], 0
je 0x407341
mov edx, dword [0x41d0f8]
movzx eax, word [edx]
test ax, ax
je 0x407740
cmp ax, 0x3d
mov ebp, edx
jne 0x407155
jmp 0x407740
test ax, ax
je 0x407162
add ebp, 2
movzx eax, word [ebp]
cmp ax, 0x3d
jne 0x407150
mov eax, dword [esp + 0x50]
mov eax, dword [eax]
test eax, eax
je 0x4076b6
mov ebx, dword [esp + 0x50]
xor esi, esi
mov dword [esp + 0x2c], 0xffffffff
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x28], edi
jmp 0x4071a6
add ebx, 0x10
mov eax, dword [ebx]
add esi, 1
test eax, eax
je 0x4071fc
mov edx, dword [0x41d0f8]
mov ecx, ebp
sub ecx, edx
sar ecx, 1
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_wcsncmp
test eax, eax
jne 0x407194
mov eax, dword [ebx]
mov edi, ebp
sub edi, dword [0x41d0f8]
mov dword [esp], eax
sar edi, 1
call sub.msvcrt.dll_wcslen
cmp edi, eax
je 0x407630
mov edi, dword [esp + 0x20]
test edi, edi
je 0x4075c0
add ebx, 0x10
mov eax, dword [ebx]
add esi, 1
mov dword [esp + 0x24], 1
test eax, eax
jne 0x4071a0
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x28]
test esi, esi
je 0x4074c0
mov ebx, dword [0x414010]
test ebx, ebx
je 0x407240
mov eax, dword [0x414014]
mov eax, dword [edi + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___ls_is_ambiguous_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
add dword [0x414014], 1
mov dword [0x41400c], 0
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, 0x3f
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [0x41d0e0]
test ebx, ebx
je 0x407087
jmp 0x4070de
mov eax, dword [0x414014]
cmp dword [0x41d0e8], eax
jle 0x407299
mov dword [0x41d0e8], eax
cmp eax, dword [0x41d0ec]
jge 0x4072a6
mov dword [0x41d0ec], eax
cmp dword [0x41d0f4], 1
mov ecx, eax
je 0x4073f0
cmp dword [esp + 0x1c], ecx
je 0x407330
mov dword [esp + 4], 0x41b6b8
mov eax, dword [edi + ecx*4]
mov dword [esp], eax
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x407460
mov eax, dword [0x414014]
mov ecx, dword [0x41d0e8]
lea edx, [eax + 1]
mov eax, dword [0x41d0ec]
mov dword [0x414014], edx
cmp eax, ecx
je 0x4076a9
cmp edx, ecx
je 0x407307
mov eax, edi
call fcn.00406f40
mov eax, dword [0x41d0ec]
mov esi, dword [esp + 0x1c]
mov edx, esi
cmp edx, eax
mov dword [0x41d0e8], esi
mov dword [0x414014], esi
je 0x407322
mov dword [0x414014], eax
add esp, 0x3c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov edx, dword [0x41d0e8]
mov eax, dword [0x41d0ec]
cmp edx, eax
jne 0x40731d
jmp 0x407322
mov eax, dword [esp + 0x18]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_wcschr
test eax, eax
je 0x40712a
lea esi, [esi]
mov eax, dword [0x41d0f8]
movzx esi, word [eax]
lea edx, [eax + 2]
mov eax, dword [esp + 0x18]
mov dword [0x41d0f8], edx
movzx ebx, si
mov dword [esp + 4], ebx
mov dword [esp], eax
call sub.msvcrt.dll_wcschr
mov ecx, dword [0x41d0f8]
movzx ebp, word [ecx]
mov edx, eax
test bp, bp
jne 0x40739b
add dword [0x414014], 1
test edx, edx
jne 0x407567
mov eax, dword [0x414010]
test eax, eax
je 0x4073db
mov eax, dword [0x41d0f0]
mov dword [esp + 0xc], ebx
test eax, eax
mov eax, dword [edi]
mov dword [esp + 8], eax
je 0x407822
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str._ls:_illegal_option_____lc_n
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov dword [0x41400c], ebx
add esp, 0x3c
mov eax, 0x3f
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [0x41d0ec]
mov edx, dword [0x41d0e8]
cmp ecx, edx
je 0x407695
cmp eax, edx
mov ecx, eax
je 0x407418
mov eax, edi
call fcn.00406f40
mov eax, dword [0x414014]
mov ecx, eax
mov ebx, dword [esp + 0x1c]
cmp ebx, eax
jle 0x407447
mov ecx, eax
jmp 0x407431
add eax, 1
cmp eax, ebx
je 0x4075e4
mov ecx, eax
mov edx, dword [edi + eax*4]
cmp word [edx], 0x2d
jne 0x407424
cmp word [edx + 2], 0
je 0x407424
mov dword [0x414014], ecx
mov dword [0x41d0e8], eax
cmp dword [esp + 0x1c], ecx
jne 0x4072bb
jmp 0x407330
mov edx, dword [0x414014]
cmp edx, dword [esp + 0x1c]
je 0x407330
mov eax, dword [edi + edx*4]
cmp word [eax], 0x2d
je 0x407600
mov ecx, dword [0x41d0f4]
test ecx, ecx
je 0x407322
add edx, 1
mov dword [0x41d0e4], eax
mov eax, 1
mov dword [0x414014], edx
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [0x41d0f4], 0
add dword [esp + 0x18], 2
jmp 0x4070d4
mov ecx, dword [esp + 0x20]
test ecx, ecx
je 0x4076b6
mov eax, dword [0x414014]
cmp word [ebp], 0
mov esi, dword [esp + 0x20]
lea edx, [eax + 1]
mov dword [0x414014], edx
je 0x407641
mov edx, dword [esi + 4]
test edx, edx
jne 0x40783f
mov ebp, dword [0x414010]
test ebp, ebp
je 0x40753b
mov eax, dword [edi + eax*4]
cmp word [eax + 2], 0x2d
je 0x40797d
mov esi, dword [esp + 0x20]
mov edx, dword [esi]
mov dword [esp + 0x10], edx
movzx eax, word [eax]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___lc_ls_doesnt_allow_an_argument_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0xc]
mov dword [0x41400c], eax
mov eax, 0x3f
jmp 0x40726c
cmp si, 0x3a
je 0x4073a3
cmp word [edx], 0x57
movzx esi, word [edx + 2]
je 0x407747
cmp si, 0x3a
mov eax, ebx
jne 0x40726c
cmp word [edx + 4], 0x3a
je 0x40789f
test bp, bp
je 0x40786c
add dword [0x414014], 1
mov dword [0x41d0e4], ecx
mov dword [0x41d0f8], 0
jmp 0x40726c
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], ebx
jmp 0x407194
mov dword [0x41d0f4], 2
add dword [esp + 0x18], 2
jmp 0x4070d4
mov eax, dword [esp + 0x1c]
mov dword [0x414014], eax
mov ecx, eax
mov dword [0x41d0e8], eax
jmp 0x40744c
movzx ecx, word [eax + 2]
test cx, cx
je 0x40747d
mov edx, dword [esp + 0x50]
test edx, edx
je 0x40768e
xor edx, edx
cmp cx, 0x2d
sete dl
lea edx, [edx + edx + 2]
add eax, edx
mov dword [0x41d0f8], eax
jmp 0x4070f5
mov edi, dword [esp + 0x28]
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], ebx
jmp 0x4074cc
cmp dword [esi + 4], 1
je 0x40784d
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2]
mov ebx, dword [esp + 0x54]
mov dword [0x41d0f8], eax
test ebx, ebx
je 0x407673
mov eax, dword [esp + 0x54]
mov esi, dword [esp + 0x2c]
mov dword [eax], esi
mov esi, dword [esp + 0x20]
mov eax, dword [esi + 8]
test eax, eax
je 0x407893
mov edx, dword [esi + 0xc]
mov dword [eax], edx
xor eax, eax
jmp 0x40726c
mov edx, 2
jmp 0x407622
cmp eax, ecx
je 0x407bec
mov dword [0x41d0ec], eax
mov ecx, eax
jmp 0x407418
mov dword [0x41d0ec], edx
mov eax, edx
jmp 0x407307
mov ecx, dword [esp + 0x58]
mov eax, dword [0x414014]
test ecx, ecx
jne 0x4079aa
mov edx, dword [0x414010]
test edx, edx
je 0x407713
mov eax, dword [edi + eax*4]
cmp word [eax + 2], 0x2d
je 0x407a9a
mov edx, dword [0x41d0f8]
mov dword [esp + 0x10], edx
movzx eax, word [eax]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_unrecognized_option___lc_ls_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov eax, dword [0x414014]
add eax, 1
mov dword [0x414014], eax
mov eax, 0x3f
mov dword [0x41d0f8], 0x41b89a
mov dword [0x41400c], 0
jmp 0x40726c
mov ebp, edx
jmp 0x407162
cmp si, 0x3b
jne 0x40757f
test bp, bp
je 0x4079ef
add dword [0x414014], 1
mov edx, ecx
mov dword [0x41d0e4], ecx
test bp, bp
mov ebx, edx
mov dword [0x41d0f8], edx
je 0x407791
cmp bp, 0x3d
jne 0x407785
jmp 0x407791
test ax, ax
je 0x407791
add ebx, 2
movzx eax, word [ebx]
cmp ax, 0x3d
jne 0x407780
mov eax, dword [esp + 0x50]
mov ecx, dword [eax]
test ecx, ecx
je 0x407b52
xor ebp, ebp
xor esi, esi
mov dword [esp + 0x2c], edi
mov edi, eax
mov dword [esp + 0x28], 0
mov dword [esp + 0x24], 0
mov dword [esp + 0x20], ebp
jmp 0x4077d6
add edi, 0x10
mov ecx, dword [edi]
add esi, 1
test ecx, ecx
je 0x4078c6
mov edx, dword [0x41d0f8]
mov eax, ebx
sub eax, edx
sar eax, 1
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], ecx
call sub.msvcrt.dll_wcsncmp
test eax, eax
jne 0x4077c0
mov eax, dword [edi]
mov ebp, ebx
sub ebp, dword [0x41d0f8]
mov dword [esp], eax
sar ebp, 1
call sub.msvcrt.dll_wcslen
cmp ebp, eax
je 0x407af5
mov ebp, dword [esp + 0x20]
test ebp, ebp
je 0x4079e2
mov dword [esp + 0x24], 1
jmp 0x4077c0
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 4], str._ls:_invalid_option_____lc_n
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
jmp 0x4073db
add ebp, 2
mov dword [0x41d0e4], ebp
jmp 0x40764b
cmp dword [esp + 0x1c], edx
jle 0x407935
add eax, 2
mov dword [0x414014], eax
mov eax, dword [edi + edx*4]
mov dword [0x41d0e4], eax
jmp 0x40764b
mov edx, dword [0x414014]
cmp edx, dword [esp + 0x1c]
je 0x407a27
lea ecx, [edx + 1]
mov edx, dword [edi + edx*4]
mov dword [0x414014], ecx
mov dword [0x41d0e4], edx
jmp 0x4075ac
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0xc]
jmp 0x40726c
test bp, bp
je 0x407a18
add dword [0x414014], 1
mov dword [0x41d0e4], ecx
mov dword [0x41d0f8], 0
mov eax, ebx
jmp 0x40726c
mov esi, dword [esp + 0x24]
mov ebp, dword [esp + 0x20]
mov edi, dword [esp + 0x2c]
test esi, esi
je 0x407a51
mov ecx, dword [0x414010]
test ecx, ecx
je 0x40790e
mov eax, dword [0x414014]
mov eax, dword [edi + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___W__ls_is_ambiguous_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
add dword [0x414014], 1
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, 0x3f
jmp 0x40726c
mov esi, dword [0x414010]
test esi, esi
jne 0x407acb
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, dword [esp + 0x20]
mov eax, dword [eax + 0xc]
mov dword [0x41400c], eax
mov eax, dword [esp + 0x18]
cmp word [eax], 0x3a
jne 0x4073e1
mov eax, 0x3a
jmp 0x40726c
mov eax, dword [esp + 0x20]
mov eax, dword [eax]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option_____ls_doesnt_allow_an_argument_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
jmp 0x40753b
mov edx, dword [edi + eax*4]
cmp word [edx + 2], 0x2d
je 0x4076c7
mov eax, dword [0x41d0f8]
movzx eax, word [eax]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_wcschr
test eax, eax
jne 0x407360
mov eax, dword [0x414014]
jmp 0x4076c7
mov dword [esp + 0x28], esi
mov dword [esp + 0x20], edi
jmp 0x4077c0
mov eax, dword [0x414014]
cmp eax, dword [esp + 0x1c]
je 0x407b0a
lea edx, [eax + 1]
mov dword [0x414014], edx
mov edx, dword [edi + eax*4]
mov dword [0x41d0e4], edx
movzx ebp, word [edx]
jmp 0x407769
mov dword [0x41d0e4], 0
jmp 0x4078b5
mov eax, dword [0x414010]
test eax, eax
jne 0x407b66
mov eax, dword [esp + 0x18]
mov dword [0x41400c], ebx
cmp word [eax], 0x3a
setne al
movzx eax, al
lea eax, [eax + eax*4 + 0x3a]
jmp 0x4075ac
test ebp, ebp
je 0x407b52
cmp word [ebx], 0
je 0x407b8d
cmp dword [ebp + 4], 0
jne 0x407bf3
cmp dword [0x414010], 0
jne 0x407c06
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, 0x3f
jmp 0x40726c
mov eax, dword [0x41d0f8]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_unrecognized_option_____ls_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov eax, dword [0x414014]
jmp 0x407713
mov eax, dword [edi + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___ls_requires_an_argument_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
jmp 0x407943
mov dword [esp + 0x50], edi
mov edi, dword [esp + 0x2c]
mov dword [esp + 0x28], esi
mov ebp, dword [esp + 0x50]
jmp 0x407a59
mov eax, dword [0x414010]
test eax, eax
je 0x407b35
mov dword [esp + 0xc], ebx
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option_requires_an_argument_____lc_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov eax, dword [esp + 0x18]
mov dword [0x41400c], ebx
cmp word [eax], 0x3a
setne al
movzx eax, al
lea eax, [eax + eax*4 + 0x3a]
jmp 0x40726c
mov dword [0x41d0f8], 0
mov eax, 0x57
jmp 0x40726c
mov dword [esp + 0xc], ebx
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option_requires_an_argument_____lc_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
jmp 0x407a34
cmp dword [ebp + 4], 1
je 0x407bce
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
mov edx, dword [esp + 0x54]
test edx, edx
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
je 0x407bbb
mov eax, dword [esp + 0x54]
mov esi, dword [esp + 0x28]
mov dword [eax], esi
mov eax, dword [ebp + 8]
test eax, eax
je 0x407bfe
mov edx, dword [ebp + 0xc]
mov dword [eax], edx
xor eax, eax
jmp 0x40726c
mov eax, dword [0x414014]
cmp dword [esp + 0x1c], eax
jle 0x407c30
lea edx, [eax + 1]
mov eax, dword [edi + eax*4]
mov dword [0x414014], edx
mov dword [0x41d0e4], eax
jmp 0x407b93
mov ecx, eax
jmp 0x407418
add ebx, 2
mov dword [0x41d0e4], ebx
jmp 0x407b93
mov eax, dword [ebp + 0xc]
jmp 0x40726c
mov eax, dword [ebp]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___W__ls_doesnt_allow_an_argument_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
jmp 0x407a7a
cmp dword [0x414010], 0
je 0x407c5f
mov eax, dword [edi + eax*4 - 4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], str._ls:_option___ls_requires_an_argument_n
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call fcn.00407020
mov ebx, dword [0x41d0f8]
mov dword [esp], ebx
call sub.msvcrt.dll_wcslen
lea eax, [ebx + eax*2]
mov dword [0x41d0f8], eax
mov eax, dword [esp + 0x18]
cmp word [eax], 0x3a
jne 0x4073e1
jmp 0x407973
push ebx
mov ebx, dword [esp + 0x18]
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x10]
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x10], 1
mov dword [esp + 8], ebx
pop ebx
jmp 0x407050