Function at 0x401230
Capabilities:
Query environment variable
Terminate process

Disassembly:
push ebp
xor eax, eax
mov ebp, esp
push ebx
mov edx, 1
sub esp, 0x14
cmp byte [0x412480], 0
mov dword [0x412500], edx
jne 0x4012b0
mov eax, dword [0x412440]
test eax, eax
jne 0x4012b6
mov eax, dword [0x412540]
test eax, eax
je 0x401370
mov ecx, 0x40c40c
mov dword [esp + 4], ecx
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll__fopen64
test eax, eax
je 0x401391
mov dword [esp], eax
call fcn.004011f0
mov eax, dword [0x412540]
mov edx, dword [eax]
mov dword [0x412600], edx
mov edx, dword [eax + 4]
mov dword [esp], eax
mov dword [0x412540], edx
call sub.cygwin1.dll_free
mov eax, 1
lea esi, [esi]
add esp, 0x14
pop ebx
pop ebp
ret
cmp byte [0x412018], 0
je 0x401256
mov dword [esp], 0x40c40e
mov eax, 2
mov ebx, 2
mov dword [esp + 4], eax
call fcn.00407920
mov dword [esp], 0x40c410
mov eax, 2
mov dword [esp + 4], eax
call fcn.00407920
mov dword [esp], 0x40c412
mov eax, 2
mov dword [esp + 4], eax
call fcn.00407920
mov dword [esp], 0x40c414
mov eax, 2
mov dword [esp + 4], eax
call fcn.00407920
mov dword [esp], 0x40c416
mov eax, 2
mov dword [esp + 4], eax
call fcn.00407920
mov dword [esp + 4], ebx
mov ebx, 0x40c0c0
mov dword [esp], 0x40c418
call fcn.00407920
mov eax, dword [str._iK20:s2:p_r]
jmp 0x40135d
mov dword [esp], eax
add ebx, 4
call fcn.00405680
mov eax, dword [ebx]
test eax, eax
jne 0x401350
mov eax, dword [0x412540]
test eax, eax
jne 0x401263
nop
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 4]
mov dword [esp], eax
call fcn.004011f0
mov byte [0x412480], 1
mov eax, 1
jmp 0x4012b0
call sub.cygwin1.dll___getreent
mov edx, dword [0x412540]
mov edx, dword [edx]
mov dword [esp + 8], edx
mov edx, 0x40c41a
mov dword [esp + 4], edx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov dword [esp], 1
call sub.cygwin1.dll_exit
lea esi, [esi]
lea edi, [edi]
push ebp
mov eax, 0x10
mov ebp, esp
push esi
push ebx
sub esp, 0x90
and esp, 0xfffffff0
call fcn.0040b088
call fcn.0040b0f0
mov dword [esp], 0
xor eax, eax
mov dword [0x4124a0], eax
xor eax, eax
mov dword [0x412440], eax
xor eax, eax
mov dword [0x412510], eax
xor eax, eax
mov dword [0x4123f0], eax
call sub.cygwin1.dll_isatty
test eax, eax
jne 0x401598
mov byte [0x4123d0], 0
xor eax, eax
xor esi, esi
xor ebx, ebx
mov dword [0x4124f0], eax
mov dword [0x412540], esi
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], ebx
xor edx, edx
mov ecx, 1
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_setvbuf
mov dword [esp], str.BC_ENV_ARGS
call sub.cygwin1.dll_getenv
test eax, eax
mov ebx, eax
je 0x4014d6
mov eax, str.BC_ENV_ARGS
mov esi, 1
mov dword [ebp - 0x88], eax
movzx ecx, byte [ebx]
test cl, cl
je 0x4014c4
jmp 0x401490
cmp cl, 0x20
je 0x4014bc
mov dword [ebp + esi*4 - 0x88], ebx
inc esi
jmp 0x4014a1
inc ebx
movzx ecx, byte [ebx]
cmp cl, 0x20
setne al
xor edx, edx
test cl, cl
setne dl
test edx, eax
jne 0x4014a0
test cl, cl
je 0x4014c4
mov byte [ebx], 0
inc ebx
movzx ecx, byte [ebx]
test cl, cl
jne 0x401490
mov dword [esp], esi
lea eax, [ebp - 0x88]
mov dword [esp + 4], eax
call fcn.004010a0
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call fcn.004010a0
mov dword [esp], 0x40c43f
call sub.cygwin1.dll_getenv
test eax, eax
je 0x401502
mov eax, 1
mov dword [0x4123f0], eax
mov dword [esp], str.BC_LINE_LENGTH
call sub.cygwin1.dll_getenv
test eax, eax
je 0x401564
mov dword [esp], eax
call sub.cygwin1.dll_atoi
cmp eax, 1
jle 0x401564
mov dword [0x4124c0], eax
call fcn.00405d50
call fcn.00405450
cmp byte [0x4123d0], 0
jne 0x401581
call fcn.00407390
call fcn.00406e90
mov byte [0x412480], 0
mov byte [0x412018], 1
call fcn.00401230
test eax, eax
jne 0x4015b8
mov dword [esp], 1
call sub.cygwin1.dll_exit
mov eax, 0x46
mov dword [0x4124c0], eax
call fcn.00405d50
call fcn.00405450
cmp byte [0x4123d0], 0
je 0x401537
mov dword [esp], 2
mov esi, 0x401610
mov dword [esp + 4], esi
call sub.cygwin1.dll_signal
jmp 0x401537
mov dword [esp], 1
call sub.cygwin1.dll_isatty
test eax, eax
je 0x40141d
mov byte [0x4123d0], 1
jmp 0x401424
cmp byte [0x4123d0], 0
jne 0x4015dc
call fcn.00401640
mov ecx, dword [0x4124a0]
test ecx, ecx
jne 0x4015fb
mov dword [esp], 0
call sub.cygwin1.dll_exit
mov ebx, 0x40c45e
mov dword [sym.imp.cygreadline7.dll_rl_readline_name], ebx
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 4]
mov dword [sym.imp.cygreadline7.dll_rl_instream], eax
call sub.cygreadline7.dll_using_history
jmp 0x4015c1
mov dword [esp], 0xa
call sub.cygwin1.dll_putchar
jmp 0x4015d0