Function at 0x4038a0
Capabilities:
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x12c
and esp, 0xfffffff0
mov eax, 0x10
call fcn.00409000
call fcn.00408b90
mov edx, dword [ebp + 0xc]
sub esp, 8
mov eax, dword [edx]
push 0x40b5f6
push 0
mov dword [0x40e698], eax
mov dword [ebp - 0x9c], 0
mov dword [ebp - 0xa0], 0
mov dword [ebp - 0xb0], 0
mov byte [0x40e6a8], 0xa
mov dword [0x40e248], 0xffffffff
mov dword [0x40e2f8], 0x7fffffff
mov dword [0x40e2a8], 0xffffffff
mov dword [0x40e2b8], 0xffffffff
mov dword [ebp - 0x6c], 0
mov dword [0x40e148], 0
call sub.msvcrt.dll_setlocale
pop edi
pop eax
push str.c:_progra1_Grep_share_locale
push str.grep
call dword [sym.imp.libintl3.dll_libintl_bindtextdomain]
mov dword [esp], str.grep
call dword [sym.imp.libintl3.dll_libintl_textdomain]
mov dword [esp], 0x40662c
call fcn.004012c0
mov dword [esp], str.GREP_OPTIONS
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
mov dword [ebp - 0xb8], eax
je case.0x403b6f.0
mov edi, dword [ebp - 0xb8]
cld
xor eax, eax
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
sub esp, 0xc
not ecx
push ecx
call fcn.00406ad4
mov dword [ebp - 0xbc], eax
add esp, 0x10
mov esi, dword [ebp - 0xb8]
mov edi, eax
xor ebx, ebx
mov ecx, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [ecx], 1
movzx edx, byte [esi]
jne 0x403a33
mov ecx, dword [sym.imp.msvcrt.dll__pctype]
mov eax, dword [ecx]
movzx eax, word [eax + edx*2]
and eax, 8
test eax, eax
jne 0x403a45
mov al, byte [esi]
test al, al
je 0x403b8b
inc ebx
jmp 0x4039f0
mov eax, dword [sym.imp.msvcrt.dll__pctype]
mov ecx, dword [eax]
movzx eax, word [ecx + edx*2]
and eax, 8
test eax, eax
jne 0x403a21
mov al, byte [esi]
inc esi
mov byte [edi], al
inc edi
cmp al, 0x5c
je 0x403b78
mov al, byte [esi]
test al, al
je 0x403a21
movzx edx, al
mov eax, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [eax], 1
je 0x4039dc
sub esp, 8
push 8
push edx
call sub.msvcrt.dll__isctype
add esp, 0x10
test eax, eax
je 0x4039ee
mov byte [edi], 0
inc edi
movzx edx, byte [esi]
mov ecx, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [ecx], 1
je 0x4039b9
sub esp, 8
push 8
push edx
call sub.msvcrt.dll__isctype
add esp, 0x10
test eax, eax
je 0x4039cc
inc esi
jmp 0x4039ab
mov eax, dword [0x40e644]
test eax, eax
jne 0x404916
mov dword [0x40e138], 2
cmp dword [0x40e138], 2
jne case.0x403b6f.0
sub esp, 0xc
push 1
call sub.msvcrt.dll__isatty
add esp, 0x10
test eax, eax
jne 0x404997
mov dword [0x40e138], 0
mov edx, dword [ebp + 8]
mov dword [ebp - 0xc4], edx
mov esi, dword [ebp + 0xc]
lea ebx, [ebp - 0x68]
mov byte [ebp - 0x68], 0
jmp 0x403aac
lea ecx, [ebp - 0x28]
cmp ecx, ebx
je 0x403ae2
mov eax, edi
mov byte [ebx], al
inc ebx
sub esp, 0xc
push 0
push 0x40b2e0
push str.0123456789A:B:C:D:HITUVabcd:e:f:hiKLlm:noqRrsuvwxyZz
push esi
push dword [ebp - 0xc4]
call fcn.00409b60
lea edx, [eax - 0x30]
add esp, 0x20
cmp edx, 9
mov edi, eax
ja 0x403aec
cmp byte [ebp - 0x68], 0x30
jne 0x403aa0
dec ebx
lea ecx, [ebp - 0x28]
cmp ecx, ebx
jne 0x403aa7
mov dword [ebp - 0x28], 0x2e2e2e
lea ebx, [ebp - 0x25]
lea ecx, [ebp - 0x68]
cmp ecx, ebx
je 0x403b5a
sub esp, 0xc
mov byte [ebx], 0
lea esi, [ebp - 0x78]
push 0x40b5f6
push esi
push 0xa
push 0
push ecx
call fcn.00406bd8
add esp, 0x20
test eax, eax
jne 0x403b34
mov eax, dword [ebp - 0x78]
test eax, eax
mov dword [ebp - 0x6c], eax
js 0x403b34
mov ebx, eax
sar ebx, 0x1f
mov ecx, eax
mov edx, dword [ebp - 0x74]
mov eax, dword [ebp - 0x78]
mov esi, ebx
xor esi, edx
xor eax, ecx
or esi, eax
je 0x403b5a
sub esp, 0xc
push str.invalid_context_length_argument
call dword [sym.imp.libintl3.dll_libintl_gettext]
mov dword [esp], eax
lea eax, [ebp - 0x68]
push eax
push str._s:__s_n
push 0
push 2
call fcn.004072c8
add esp, 0x20
cmp edi, 0xffffffff
je 0x403cab
cmp edi, 0x87
ja case.0x403b6f.1
jmp dword [edi*4 + 0x40c8cc]
mov al, byte [esi]
test al, al
je 0x403a21
inc esi
mov byte [edi - 1], al
jmp 0x4039fc
add ebx, dword [ebp + 8]
sub esp, 0xc
lea edx, [ebx*4 + 4]
mov esi, dword [ebp + 0xc]
push edx
call fcn.00406ad4
mov dword [ebp + 8], ebx
mov ebx, dword [esi]
add esi, 4
mov dword [ebp - 0xf0], esi
mov dword [eax], ebx
add esp, 0x10
mov dword [ebp + 0xc], eax
lea esi, [eax + 4]
mov edi, dword [ebp - 0xb8]
mov ebx, dword [ebp - 0xbc]
mov dword [ebp - 0xc0], 0
mov ecx, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [ecx], 1
movzx edx, byte [edi]
jne 0x403c73
mov ecx, dword [sym.imp.msvcrt.dll__pctype]
mov eax, dword [ecx]
movzx eax, word [eax + edx*2]
and eax, 8
test eax, eax
jne 0x403c89
mov al, byte [edi]
test al, al
je 0x403f25
test esi, esi
je 0x403c12
mov edx, dword [ebp - 0xc0]
mov dword [esi + edx*4], ebx
mov al, byte [edi]
inc dword [ebp - 0xc0]
jmp 0x403c30
mov eax, dword [sym.imp.msvcrt.dll__pctype]
mov ecx, dword [eax]
movzx eax, word [ecx + edx*2]
and eax, 8
test eax, eax
jne 0x403c5d
mov al, byte [edi]
inc edi
mov byte [ebx], al
inc ebx
cmp al, 0x5c
je 0x403c90
mov al, byte [edi]
test al, al
je 0x403c5d
movzx edx, al
mov eax, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [eax], 1
je 0x403c1c
sub esp, 8
push 8
push edx
call sub.msvcrt.dll__isctype
add esp, 0x10
test eax, eax
je 0x403c2e
mov byte [ebx], 0
inc ebx
movzx edx, byte [edi]
mov ecx, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [ecx], 1
je 0x403be2
sub esp, 8
push 8
push edx
call sub.msvcrt.dll__isctype
add esp, 0x10
test eax, eax
je 0x403bf9
inc edi
jmp 0x403bd0
mov al, byte [edi]
test al, al
je 0x403c5d
inc edi
mov byte [ebx - 1], al
jmp 0x403c38
mov eax, 2
call fcn.004036fc
jmp case.0x403b6f.0
mov eax, dword [0x40e388]
test eax, eax
je 0x403cbe
mov dword [0x40e2d8], 0
or eax, dword [0x40e2d8]
je 0x403cda
mov dword [0x40e2c8], 0
mov dword [0x40e378], 1
mov ebx, dword [0x40e378]
mov ecx, dword [0x40e2b8]
or ebx, dword [0x40e2c8]
test ecx, ecx
mov dword [0x40e258], ebx
js 0x4041ab
mov edx, dword [0x40e2a8]
test edx, edx
js 0x40419d
mov esi, dword [0x40e138]
test esi, esi
jne 0x403fa9
mov esi, dword [0x40e108]
test esi, esi
jne 0x404b40
mov edi, dword [0x40e0f8]
test edi, edi
jne 0x404131
mov eax, dword [ebp - 0x9c]
test eax, eax
je 0x403f4d
mov ebx, dword [ebp - 0xa0]
test ebx, ebx
jne 0x403d65
xor dword [0x40e268], 1
mov dword [0x40e6c8], 0
mov dword [0x40e6d8], 0
mov edx, dword [0x40e6b8]
test edx, edx
je 0x403ea1
mov esi, dword [sym.imp.msvcrt.dll___mb_cur_max]
mov ecx, dword [esi]
mov dword [ebp - 0xec], ecx
dec ecx
je 0x403ea1
mov ebx, dword [ebp - 0xa0]
mov dword [ebp - 0xdc], ebx
add ebx, dword [ebp - 0xec]
mov edi, ebx
sub esp, 0xc
inc edi
push edi
mov eax, dword [ebp - 0x9c]
xor edi, edi
mov dword [ebp - 0xe0], ebx
mov dword [ebp - 0xe4], eax
xor ebx, ebx
call fcn.00406ad4
add esp, 0x10
cmp edi, dword [ebp - 0xdc]
mov dword [ebp - 0xe8], eax
mov dword [ebp - 0xa4], 0
mov dword [ebp - 0xac], 0
jmp 0x403e0d
lea eax, [esi + 2]
cmp eax, 1
jbe 0x403df1
test esi, esi
jne 0x40414c
mov eax, ebx
mov ecx, dword [ebp - 0xe4]
mov dl, byte [eax + ecx]
mov esi, dword [ebp - 0xe8]
mov byte [edi + esi], dl
inc ebx
inc edi
cmp ebx, dword [ebp - 0xdc]
jae 0x403e74
lea ecx, [ebp - 0xa4]
mov eax, dword [ebp - 0xdc]
push ecx
sub eax, ebx
mov esi, dword [ebp - 0xe4]
push eax
add esi, ebx
push esi
lea edx, [ebp - 0xa6]
push edx
call sub.MSVCP60.DLL_mbrtowc
mov edx, dword [ebp - 0xec]
lea ecx, [edi + edx]
add esp, 0x10
cmp ecx, dword [ebp - 0xe0]
mov esi, eax
jbe 0x403de1
add dword [ebp - 0xe0], edx
mov edx, dword [ebp - 0xe0]
sub esp, 8
inc edx
push edx
push dword [ebp - 0xe8]
call fcn.00406b28
add esp, 0x10
mov dword [ebp - 0xe8], eax
jmp 0x403de1
mov esi, dword [ebp - 0xe8]
sub esp, 0xc
mov byte [edi + esi], 0
push dword [ebp - 0xe4]
call sub.msvcrt.dll_free
mov ebx, dword [ebp - 0xe8]
add esp, 0x10
mov dword [ebp - 0x9c], ebx
mov dword [ebp - 0xa0], edi
sub esp, 8
push dword [ebp - 0xa0]
push dword [ebp - 0x9c]
call fcn.00404c48
mov edi, dword [ebp + 8]
sub edi, dword [0x40b114]
add esp, 0x10
dec edi
jle 0x403ece
mov ecx, dword [0x40e2e8]
test ecx, ecx
je 0x403ed8
mov edx, dword [ebp - 0xb0]
test edx, edx
je 0x403ee2
mov dword [0x40e278], 1
sub esp, 0xc
push 1
call sub.msvcrt.dll__isatty
add esp, 0x10
test eax, eax
jne 0x403f0e
cmp dword [0x40e238], 1
je 0x403f0e
sub esp, 8
push 0x8000
push 1
call sub.msvcrt.dll__setmode
add esp, 0x10
mov eax, dword [0x40e2f8]
test eax, eax
jne 0x404a58
sub esp, 0xc
push 1
call sub.msvcrt.dll_exit
mov edi, dword [ebp - 0xc0]
lea edx, [esi + edi*4]
mov esi, dword [ebp - 0xf0]
mov ebx, dword [esi]
mov dword [edx], ebx
add esi, 4
add edx, 4
test ebx, ebx
mov dword [ebp - 0xf0], esi
jne 0x403f2e
jmp case.0x403b6f.0
mov edx, dword [0x40b114]
cmp edx, dword [ebp + 8]
jge 0x40413d
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebx + edx*4]
cld
xor eax, eax
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub esp, 0xc
lea esi, [ecx - 1]
push ecx
mov dword [ebp - 0xa0], esi
call fcn.00406ad4
pop edx
pop ecx
mov edx, dword [0x40b114]
mov dword [ebp - 0x9c], eax
mov ecx, dword [ebp + 0xc]
push dword [ecx + edx*4]
push eax
inc edx
mov dword [0x40b114], edx
call sub.msvcrt.dll_strcpy
add esp, 0x10
jmp 0x403d65
sub esp, 0xc
push str.GREP_COLOR
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
je 0x403fcc
cmp byte [eax], 0
je 0x403fcc
mov dword [section..data], eax
mov dword [str.01_31], eax
sub esp, 0xc
push str.GREP_COLORS
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
mov dword [ebp - 0xcc], eax
je 0x403d16
cmp byte [eax], 0
je 0x403d16
xor eax, eax
cld
mov edi, dword [ebp - 0xcc]
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
sub esp, 0xc
not ecx
push ecx
call fcn.00406ad4
add esp, 0x10
test eax, eax
mov esi, eax
je 0x403d16
sub esp, 8
push dword [ebp - 0xcc]
push eax
call sub.msvcrt.dll_strcpy
add esp, 0x10
mov edi, esi
mov dword [ebp - 0xd0], 0
mov cl, byte [esi]
cmp cl, 0x3a
mov byte [ebp - 0xd1], cl
je 0x40404a
test cl, cl
jne 0x404094
mov byte [esi], 0
mov edx, dword [0x40b020]
inc esi
test edx, edx
mov ebx, 0x40b020
je 0x4040cc
sub esp, 8
push edi
push dword [ebx]
call sub.msvcrt.dll_strcmp
add esp, 0x10
test eax, eax
je 0x4047ac
add ebx, 0xc
mov ecx, dword [ebx]
test ecx, ecx
jne 0x40405d
mov eax, dword [ebx + 8]
test eax, eax
jne 0x4040fd
cmp byte [ebp - 0xd1], 0
jne 0x40402d
jmp 0x403d16
cmp byte [ebp - 0xd1], 0x3d
je 0x4041b8
mov edx, dword [ebp - 0xd0]
test edx, edx
je 0x4040c6
cmp byte [ebp - 0xd1], 0x3b
je 0x4040c6
mov cl, byte [ebp - 0xd1]
sub ecx, 0x30
cmp cl, 9
ja 0x40477f
inc esi
jmp 0x404039
mov eax, dword [0x40b020]
test eax, eax
je 0x40407c
mov eax, dword [ebx + 4]
test eax, eax
je 0x4041dd
mov edx, dword [ebp - 0xd0]
test edx, edx
je 0x40494d
mov ecx, dword [ebp - 0xd0]
mov dword [eax], ecx
mov eax, dword [ebx + 8]
test eax, eax
je 0x404083
call eax
test eax, eax
je 0x404083
sub esp, 8
push eax
push edi
push dword [ebp - 0xcc]
sub esp, 8
push str.In_GREP_COLORS__s___the___s__capacity__s.
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 0
call fcn.004072c8
add esp, 0x20
jmp 0x404083
xor eax, eax
call fcn.004036fc
jmp 0x403d32
mov eax, 2
call fcn.004036fc
jmp 0x403d65
sub esp, 0xc
movzx eax, word [ebp - 0xa6]
push eax
call sub.msvcrt.dll_towupper
movzx edx, ax
mov dword [esp], edx
mov word [ebp - 0xa6], ax
call sub.msvcrt.dll_towlower
add esp, 0xc
lea ecx, [ebp - 0xac]
push ecx
mov word [ebp - 0xa6], ax
mov edx, dword [ebp - 0xe8]
movzx eax, ax
push eax
add edx, edi
push edx
call sub.MSVCP60.DLL_wcrtomb
add edi, eax
add esp, 0x10
add ebx, esi
jmp 0x403e07
mov edi, dword [ebp - 0x6c]
mov dword [0x40e2a8], edi
jmp 0x403d08
mov eax, dword [ebp - 0x6c]
mov dword [0x40e2b8], eax
jmp 0x403cfa
cmp esi, edi
je 0x40477f
mov ebx, dword [ebp - 0xd0]
test ebx, ebx
jne 0x40477f
mov byte [esi], 0
inc esi
mov dword [ebp - 0xd0], esi
jmp 0x404039
mov eax, dword [ebp - 0xd0]
test eax, eax
je 0x40407c
sub esp, 8
push dword [ebp - 0xd0]
push edi
push dword [ebp - 0xcc]
sub esp, 8
push str.In_GREP_COLORS__s___the___s__capacity_is_boolean_and_cannot_take_a_value____s____skipped.
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 0
call fcn.004072c8
add esp, 0x20
jmp 0x40407c
mov dword [0x40e238], 1
jmp case.0x403b6f.0
mov dword [0x40e238], 2
jmp case.0x403b6f.0
mov dword [0x40e018], 1
jmp case.0x403b6f.0
sub esp, 0xc
push 0
mov dword [0x40e388], 1
call fcn.00406588
add esp, 0x10
jmp case.0x403b6f.0
mov dword [0x40e248], 0
jmp case.0x403b6f.0
mov dword [ebp - 0xb0], 1
mov dword [0x40e2e8], 0
jmp case.0x403b6f.0
mov dword [0x40e158], 1
jmp case.0x403b6f.0
mov dword [0x40e2d8], 0xffffffff
jmp case.0x403b6f.0
mov ebx, dword [0x40e644]
cld
mov edi, str.read
mov esi, ebx
mov ecx, 5
repe cmpsb byte [esi], byte es:[edi]
jne 0x40482c
mov dword [0x40e048], 0
jmp case.0x403b6f.0
sub esp, 0xc
push 0x40b5f6
lea edx, [ebp - 0x90]
push edx
push 0xa
push 0
mov edi, dword [0x40e644]
push edi
call fcn.00406bd8
add esp, 0x20
test eax, eax
jne 0x40432b
mov eax, dword [ebp - 0x90]
test eax, eax
mov dword [ebp - 0x6c], eax
js 0x40432b
mov ebx, eax
mov ecx, eax
sar ebx, 0x1f
mov eax, dword [ebp - 0x90]
mov edx, dword [ebp - 0x8c]
mov esi, ebx
xor esi, edx
xor eax, ecx
or esi, eax
je case.0x403b6f.0
sub esp, 0xc
push str.invalid_context_length_argument
call dword [sym.imp.libintl3.dll_libintl_gettext]
mov dword [esp], eax
push edi
push str._s:__s_n
push 0
push 2
call fcn.004072c8
add esp, 0x20
jmp case.0x403b6f.0
sub esp, 0xc
push 0x40b5f6
lea ecx, [ebp - 0x88]
push ecx
push 0xa
push 0
mov edi, dword [0x40e644]
push edi
call fcn.00406bd8
add esp, 0x20
test eax, eax
jne 0x40432b
mov eax, dword [ebp - 0x88]
test eax, eax
mov dword [0x40e2a8], eax
js 0x40432b
mov ebx, eax
mov ecx, eax
sar ebx, 0x1f
mov eax, dword [ebp - 0x88]
mov edx, dword [ebp - 0x84]
jmp 0x40431d
sub esp, 0xc
push 0x40b5f6
lea esi, [ebp - 0x80]
push esi
push 0xa
push 0
mov edi, dword [0x40e644]
push edi
call fcn.00406bd8
add esp, 0x20
test eax, eax
jne 0x40432b
mov eax, dword [ebp - 0x80]
test eax, eax
mov dword [0x40e2b8], eax
js 0x40432b
mov ebx, eax
mov ecx, eax
sar ebx, 0x1f
mov eax, dword [ebp - 0x80]
mov edx, dword [ebp - 0x7c]
jmp 0x40431d
mov dword [0x40e108], 1
jmp case.0x403b6f.0
mov dword [0x40e038], 1
jmp case.0x403b6f.0
mov dword [0x40e148], 1
jmp case.0x403b6f.0
mov dword [0x40e288], 1
jmp case.0x403b6f.0
mov dword [0x40e6c8], 1
jmp case.0x403b6f.0
mov dword [0x40e268], 1
jmp case.0x403b6f.0
mov dword [0x40e028], 1
jmp case.0x403b6f.0
mov dword [0x40e118], 1
jmp case.0x403b6f.0
sub esp, 0xc
push 0x40b5f6
lea ebx, [ebp - 0x98]
push ebx
push 0xa
push 0
push dword [0x40e644]
call fcn.00406bd8
add esp, 0x20
test eax, eax
je 0x40487f
cmp eax, 3
je 0x404870
sub esp, 0xc
push str.invalid_max_count
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 2
call fcn.004072c8
add esp, 0x10
jmp case.0x403b6f.0
mov dword [0x40e2d8], 1
jmp case.0x403b6f.0
cld
mov edi, dword [0x40e644]
xor eax, eax
mov ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub esp, 8
lea ebx, [ecx - 1]
add ecx, dword [ebp - 0xa0]
push ecx
push dword [ebp - 0x9c]
call fcn.00406b28
pop ecx
pop esi
push dword [0x40e644]
mov dword [ebp - 0x9c], eax
add eax, dword [ebp - 0xa0]
push eax
call sub.msvcrt.dll_strcpy
add ebx, dword [ebp - 0xa0]
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0xa0], ebx
mov byte [ebx + eax], 0xa
inc dword [ebp - 0xa0]
add esp, 0x10
jmp case.0x403b6f.0
mov ebx, dword [0x40e644]
cld
mov edi, str.read
mov esi, ebx
mov ecx, 5
repe cmpsb byte [esi], byte es:[edi]
jne 0x404850
mov dword [0x40e018], 0
jmp case.0x403b6f.0
mov dword [0x40e2c8], 1
jmp case.0x403b6f.0
mov dword [0x40e298], 1
jmp case.0x403b6f.0
mov dword [ebp - 0xb0], 0
mov dword [0x40e2e8], 1
jmp case.0x403b6f.0
mov ebx, dword [0x40e644]
cld
mov ecx, 2
mov edi, 0x40c677
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4048fe
mov esi, dword [sym.imp.msvcrt.dll__iob]
test esi, esi
je 0x404971
mov eax, dword [ebp - 0xa0]
inc eax
mov ebx, 1
cmp eax, 1
jmp 0x4045c9
shl ebx, 1
cmp eax, ebx
jae 0x4045c5
sub esp, 8
push ebx
push dword [ebp - 0x9c]
call fcn.00406b28
mov dword [ebp - 0x9c], eax
mov edi, dword [ebp - 0xa0]
add esp, 0x10
test byte [esi + 0xc], 0x10
jne 0x4047b3
mov ecx, dword [ebp - 0xa0]
mov edx, ebx
sub edx, ecx
push esi
dec edx
push edx
push 1
add ecx, dword [ebp - 0x9c]
push ecx
call sub.msvcrt.dll_fread
add esp, 0x10
test eax, eax
jle 0x4047b3
mov edx, dword [ebp - 0xa0]
add edx, eax
lea eax, [ebx - 1]
cmp eax, edx
mov dword [ebp - 0xa0], edx
jne 0x4045e9
sub esp, 8
shl ebx, 1
push ebx
push dword [ebp - 0x9c]
call fcn.00406b28
mov dword [ebp - 0x9c], eax
jmp 0x4045e6
mov edx, dword [0x40e188]
test edx, edx
je 0x4048d1
sub esp, 8
push dword [0x40e644]
push dword [0x40e188]
call fcn.00406390
add esp, 0x10
jmp case.0x403b6f.0
mov esi, dword [0x40e644]
mov dword [0x40e008], esi
jmp case.0x403b6f.0
mov dword [0x40e308], 1
jmp case.0x403b6f.0
mov eax, dword [0x40e168]
test eax, eax
je 0x4048e0
push 0xa
push dword [0x40e644]
push dword [0x40e168]
push fcn.00406390
call fcn.004063ec
add esp, 0x10
test eax, eax
je case.0x403b6f.0
push dword [0x40e644]
push 0x40b675
sub esp, 8
call sub.msvcrt.dll__errno
pop edx
pop ecx
push dword [eax]
jmp 0x4044a4
mov ebx, dword [0x40e168]
test ebx, ebx
je 0x4048ef
sub esp, 8
push dword [0x40e644]
push dword [0x40e168]
call fcn.00406390
jmp 0x404669
mov ebx, dword [0x40e644]
cld
mov ecx, 7
mov edi, str.binary
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
jne 0x4047f5
mov dword [0x40e238], 0
jmp case.0x403b6f.0
mov edi, dword [0x40e178]
test edi, edi
je 0x40493e
sub esp, 8
push dword [0x40e644]
push dword [0x40e178]
call fcn.00406390
jmp 0x404669
mov dword [0x40e6b8], 1
jmp case.0x403b6f.0
mov byte [0x40e6a8], 0
jmp case.0x403b6f.0
mov dword [0x40e6d8], 1
jmp case.0x403b6f.0
sub esp, 0xc
push esi
push dword [ebp - 0xcc]
sub esp, 8
push str.Stopped_processing_of_ill_formed_GREP_COLORS__s__at_remaining_substring___s_.
call dword [sym.imp.libintl3.dll_libintl_gettext]
add esp, 0xc
push eax
push 0
push 0
call fcn.004072c8
add esp, 0x20
jmp 0x403d16
mov eax, dword [ebx]
jmp 0x4040d1
cmp dword [sym.imp.msvcrt.dll__iob], esi
je 0x4047c7
sub esp, 0xc
push esi
call sub.msvcrt.dll_fclose
add esp, 0x10
mov eax, dword [ebp - 0xa0]
cmp edi, eax
je case.0x403b6f.0
mov edx, dword [ebp - 0x9c]
cmp byte [edx + eax - 1], 0xa
je case.0x403b6f.0
mov byte [eax + edx], 0xa
inc dword [ebp - 0xa0]
jmp case.0x403b6f.0
cld
mov ecx, 5
mov edi, str.text
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je case.0x403b6f.97
cld
mov ecx, 0xe
mov edi, str.without_match
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je case.0x403b6f.73
sub esp, 0xc
push str.unknown_binary_files_type
jmp 0x404498
cld
mov edi, str.skip
mov esi, ebx
mov ecx, 5
repe cmpsb byte [esi], byte es:[edi]
jne 0x404964
mov dword [0x40e048], 1
jmp case.0x403b6f.0
cld
mov edi, str.skip
mov esi, ebx
mov ecx, 5
repe cmpsb byte [esi], byte es:[edi]
jne 0x4048af
mov dword [0x40e018], 2
jmp case.0x403b6f.0
mov dword [0x40e2f8], 0x7fffffff
jmp case.0x403b6f.0
mov edi, dword [ebp - 0x98]
test edi, edi
js 0x404870
mov ebx, edi
sar ebx, 0x1f
mov eax, dword [ebp - 0x98]
mov edx, dword [ebp - 0x94]
mov esi, ebx
xor esi, edx
xor eax, edi
or esi, eax
jne 0x404870
mov dword [0x40e2f8], edi
jmp case.0x403b6f.0
cld
mov ecx, 8
mov edi, str.recurse
mov esi, ebx
repe cmpsb byte [esi], byte es:[edi]
je case.0x403b6f.82
sub esp, 0xc
push str.unknown_directories_method
jmp 0x404498
call fcn.00406314
mov dword [0x40e188], eax
jmp 0x404655
call fcn.00406314
mov dword [0x40e168], eax
jmp 0x40469e
call fcn.00406314
mov dword [0x40e168], eax
jmp 0x4046eb
sub esp, 8
push 0x40c71b
push ebx
call sub.msvcrt.dll_fopen
mov esi, eax
add esp, 0x10
jmp 0x4045ac
sub esp, 8
push str.always
push eax
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
jne 0x4049ec
mov dword [0x40e138], 1
jmp 0x403a62
call fcn.00406314
mov dword [0x40e178], eax
jmp 0x40473c
sub esp, 0xc
push edi
push dword [ebp - 0xcc]
sub esp, 8
push str.In_GREP_COLORS__s___the___s__capacity_needs_a_value___...____skipped.
jmp 0x404203
sub esp, 0xc
push str.unknown_devices_method
jmp 0x404498
push dword [0x40e644]
push 0x40b675
sub esp, 8
call sub.msvcrt.dll__errno
pop edi
pop edx
push dword [eax]
push 2
call fcn.004072c8
add esp, 0x10
jmp 0x4045b4
sub esp, 0xc
push str.TERM
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
je 0x403a80
sub esp, 0xc
push str.TERM
call sub.msvcrt.dll_getenv
mov esi, eax
cld
mov ecx, 5
mov edi, str.dumb
repe cmpsb byte [esi], byte es:[edi]
seta dl
setb al
add esp, 0x10
cmp dl, al
je 0x403a80
mov dword [0x40e138], 1
jmp case.0x403b6f.0
sub esp, 8
push 0x40c78d
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x40492f
sub esp, 8
push str.force
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x40492f
sub esp, 8
push str.never
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
jne 0x404b87
mov dword [0x40e138], 0
jmp 0x403a62
mov edx, dword [0x40b114]
cmp edx, dword [ebp + 8]
jge 0x404b10
mov dword [ebp - 0xb4], 1
jmp 0x404ac3
mov eax, dword [0x40e168]
test eax, eax
jne 0x404c2c
mov esi, ebx
cld
mov ecx, 2
mov edi, 0x40c677
repe cmpsb byte [esi], byte es:[edi]
seta dl
setb al
cmp dl, al
mov esi, ebx
jne 0x404a9d
xor esi, esi
mov edx, 0x40e0b8
mov eax, esi
call fcn.00402954
and dword [ebp - 0xb4], eax
mov ebx, dword [0x40b114]
inc ebx
cmp ebx, dword [ebp + 8]
mov edx, ebx
mov dword [0x40b114], ebx
jge 0x404b22
mov esi, dword [0x40e178]
mov edi, dword [ebp + 0xc]
test esi, esi
mov ebx, dword [edi + edx*4]
jne 0x404add
mov ecx, dword [0x40e168]
test ecx, ecx
je 0x404a80
sub esp, 0xc
push ebx
call fcn.00406a50
add esp, 0x10
test eax, eax
jne 0x404a80
mov eax, dword [0x40e178]
test eax, eax
je 0x404a73
push esi
push 0
push ebx
push eax
call fcn.00406344
add esp, 0x10
test eax, eax
je 0x404aaf
jmp 0x404a73
mov edx, 0x40e0b8
xor eax, eax
call fcn.00402954
mov dword [ebp - 0xb4], eax
mov edx, dword [0x40e1a8]
sub esp, 0xc
test edx, edx
mov eax, dword [ebp - 0xb4]
je 0x404b3a
mov eax, 2
push eax
call sub.msvcrt.dll_exit
sub esp, 8
push str.GNU_grep_2.5.4
push str._s_n_n
call dword [sym.imp.libintl3.dll_libintl_printf]
pop eax
pop edx
push str.2009
push str.Copyright__C___s_Free_Software_Foundation__Inc._nLicense_GPLv3:_GNU_GPL_version_3_or_later__http:__gnu.org_licenses_gpl.html__nThis_is_free_software:_you_are_free_to_change_and_redistribute_it._nThere_is_NO_WARRANTY__to_the_extent_permitted_by_law._n
call dword [sym.imp.libintl3.dll_libintl_gettext]
mov dword [esp], eax
call dword [sym.imp.libintl3.dll_libintl_printf]
mov dword [esp], 0x40c8b0
call dword [sym.imp.libintl3.dll_libintl_printf]
mov dword [esp], 0
call sub.msvcrt.dll_exit
sub esp, 8
push 0x40c8b2
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x404a46
sub esp, 8
push str.none
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x404a46
sub esp, 8
push str.auto
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x403a58
sub esp, 8
push 0x40c8bf
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x403a58
sub esp, 8
push str.if_tty
push dword [0x40e644]
call sub.msvcrt.dll__stricmp
add esp, 0x10
test eax, eax
je 0x403a58
mov dword [0x40e0f8], 1
jmp 0x403a62
push ecx
push 0
push ebx
push eax
call fcn.00406344
add esp, 0x10
test eax, eax
jne 0x404aaf
jmp 0x404a80