Function at 0x409500
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov ecx, dword [0x40f034]
mov edx, dword [0x413054]
test ecx, ecx
setle al
and eax, 0xff
or eax, edx
mov dword [0x413054], eax
test eax, eax
jne 0x409724
mov edi, dword [0x413078]
cmp dword [0x40f034], edi
jge 0x409766
mov eax, dword [0x40f034]
mov dword [0x413068], 0
dec eax
mov dword [0x413088], eax
mov dword [0x413078], eax
mov dword [0x413058], eax
mov edi, dword [0x413088]
inc edi
mov dword [0x413078], edi
lea esi, [esi]
mov edx, dword [0x413088]
inc edx
mov dword [0x413088], edx
cmp dword [ebp + 0xc], edx
jle 0x4096ff
mov edi, dword [ebp + 0x10]
mov dword [0x413058], edx
mov ecx, dword [edi + edx*4]
mov dword [0x413068], ecx
cmp byte [ecx], 0x2d
jne 0x4096a0
lea eax, [ecx + 1]
mov dword [0x413068], eax
mov al, byte [ecx + 1]
test al, al
je 0x4096a0
cmp al, 0x2d
je 0x40973d
cmp dword [ebp + 8], 1
jle 0x409a36
mov ecx, dword [ebp + 0x18]
lea eax, [ebp + 0x20]
mov ebx, dword [ebp + 0x1c]
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x28], ebx
mov dword [0x413050], 0
test ecx, ecx
je 0x409687
mov ebx, dword [ecx]
test ebx, ebx
je 0x409687
mov edi, dword [0x413068]
mov esi, ecx
add esi, 0x10
mov dword [ebp - 0x20], ecx
lea eax, [edi + 1]
lea edx, [edi + 2]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x30], 0xffffffff
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x40], edx
mov dl, byte [edi]
test dl, dl
je 0x409641
mov ecx, dword [ebp - 0x24]
cmp byte [ebx], dl
jne 0x409660
mov eax, dword [ebp - 0x40]
jmp 0x409639
mov ecx, eax
cmp byte [ebx], dl
lea eax, [eax + 1]
jne 0x409660
mov dl, byte [eax - 1]
inc ebx
test dl, dl
jne 0x409630
cmp byte [ebx], 0
je 0x4097f3
mov eax, dword [ebp - 0x30]
test eax, eax
jns 0x409be9
mov eax, dword [ebp - 0x34]
mov dword [ebp - 0x30], eax
jmp 0x409669
cmp dl, 0x3d
je 0x4098f2
mov ebx, dword [ebp - 0x34]
mov dword [ebp - 0x20], esi
inc ebx
mov dword [ebp - 0x34], ebx
mov ebx, dword [esi]
add esi, 0x10
test ebx, ebx
jne 0x40961c
mov ecx, dword [ebp - 0x30]
test ecx, ecx
jns 0x409a5c
cmp dword [ebp + 8], 1
je 0x409d43
mov eax, dword [0x413068]
cmp byte [eax], 0
jne 0x409a3d
nop
mov edi, dword [ebp + 0x14]
mov dl, byte [edi]
cmp dl, 0x2d
je 0x409b12
mov ecx, dword [0x413098]
movsx eax, dl
test ecx, ecx
jne 0x409716
test ah, 0x10
jne 0x40971b
mov dword [0x413098], 0x1000
cmp dl, 0x2b
je 0x4096e3
sub esp, 0xc
push str.POSIXLY_CORRECT
call sub.msvcrt.dll_getenv
add esp, 0x10
test eax, eax
je 0x4096f2
mov edx, dword [0x413098]
or edx, 0x10
mov dword [0x413098], edx
test byte [0x413098], 0x10
je 0x409570
mov eax, dword [0x413078]
or esi, 0xffffffff
mov dword [0x40f034], eax
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
test ah, 0x10
je 0x4096f2
or eax, ecx
mov dword [0x413098], eax
jmp 0x4096f2
mov dword [0x40f034], 1
mov dword [0x413054], 0
jmp 0x409540
lea eax, [ecx + 2]
cmp byte [ecx + 2], 0
je 0x409ccf
mov edx, dword [ebp + 8]
test edx, edx
jle 0x409a3d
mov dword [0x413068], eax
mov dword [ebp + 8], 1
jmp 0x4095c6
mov eax, dword [0x413068]
test eax, eax
je 0x4098fd
mov bl, byte [eax]
test bl, bl
je 0x4098fd
inc eax
mov ecx, dword [ebp + 0x14]
movsx esi, bl
mov dword [0x40f03c], esi
mov dword [0x413068], eax
mov dl, byte [ecx]
cmp dl, 0x2b
je 0x4099fa
cmp dl, 0x2d
je 0x4099fa
cmp dl, 0x3a
je 0x409b7b
cmp bl, dl
je 0x409b41
inc ecx
mov dl, byte [ecx]
test dl, dl
jne 0x4097ac
cmp dword [ebp + 8], 2
je 0x4099c3
mov edi, dword [0x40f038]
test edi, edi
jne 0x409a14
mov eax, dword [0x413068]
test eax, eax
je 0x4099e5
cmp byte [eax], 0
je 0x4099e5
mov eax, dword [0x413088]
jmp 0x4099eb
mov eax, dword [ebp - 0x28]
mov dword [0x413068], 0
test eax, eax
je 0x40980c
mov ecx, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x34]
mov dword [ecx], ebx
mov edx, dword [0x413088]
mov edi, dword [0x413050]
inc edx
test edi, edi
mov dword [0x40f034], edx
je 0x4098a8
mov edi, dword [ebp - 0x20]
mov esi, dword [edi + 4]
test esi, esi
jne 0x4098d3
mov eax, dword [ebp + 0x10]
mov ebx, dword [0x40f038]
test ebx, ebx
mov edx, dword [eax]
je 0x40988e
mov ax, word [0x412144]
mov word [ebp - 0xf], ax
mov al, byte [0x412146]
mov byte [ebp - 0xd], al
cmp dword [ebp + 8], 1
je 0x409860
mov byte [ebp - 0xe], 0
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push ecx
add ebx, 0x40
push edx
push str._s:
push ebx
call sub.msvcrt.dll_fprintf
mov edx, dword [ebp - 0x20]
mov eax, dword [edx]
push eax
lea eax, [ebp - 0xf]
push eax
push str.option___s_s_doesnt_accept_an_argument_n
push ebx
call sub.msvcrt.dll_fprintf
add esp, 0x20
mov ecx, dword [ebp - 0x20]
mov esi, 0x3f
mov eax, dword [ecx + 0xc]
mov dword [0x40f03c], eax
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, dword [ebp - 0x20]
cmp dword [ebx + 4], 1
jne 0x4098d3
cmp dword [ebp + 0xc], edx
jle 0x409c44
mov edi, dword [ebp + 0x10]
mov dword [0x413088], edx
mov eax, dword [edi + edx*4]
mov dword [0x413050], eax
lea eax, [edx + 1]
mov dword [0x40f034], eax
mov ecx, dword [ebp - 0x20]
mov edx, dword [ecx + 8]
test edx, edx
je 0x409a09
mov eax, dword [ecx + 0xc]
xor esi, esi
mov dword [edx], eax
lea esp, [ebp - 0xc]
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [0x413050], ecx
jmp 0x409641
cmp edi, dword [0x413058]
jge 0x40955f
mov esi, dword [0x413088]
mov ecx, dword [0x413058]
inc esi
mov dword [ebp - 0x38], esp
sub esi, ecx
lea eax, [esi*4 + 0x1e]
and eax, 0xfffffff0
call fcn.00409390
lea ecx, [esp + 0xf]
and ecx, 0xfffffff0
test esi, esi
mov dword [ebp - 0x3c], ecx
jle 0x409b83
mov ebx, dword [0x413058]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x44], ebx
xor ecx, ecx
lea edx, [eax + ebx*4]
lea esi, [esi]
mov ebx, dword [ebp - 0x3c]
mov eax, dword [edx]
add edx, 4
mov dword [ebx + ecx*4], eax
inc ecx
cmp ecx, esi
jne 0x409950
mov ecx, dword [ebp - 0x44]
dec ecx
mov dword [0x413058], ecx
cmp ecx, edi
jl 0x409996
mov edx, dword [ebp - 0x44]
mov eax, dword [ebp + 0x10]
lea ebx, [eax + edx*4]
lea edx, [ecx + esi]
lea edx, [eax + edx*4]
lea esi, [esi]
mov eax, dword [ebx - 4]
dec ecx
mov dword [edx], eax
sub ebx, 4
sub edx, 4
cmp ecx, edi
jge 0x409980
mov dword [0x413058], ecx
test esi, esi
jle 0x4099b2
mov ecx, dword [ebp + 0x10]
lea edx, [ecx + edi*4]
xor ecx, ecx
mov ebx, dword [ebp - 0x3c]
mov eax, dword [ebx + ecx*4]
inc ecx
mov dword [edx], eax
add edx, 4
cmp ecx, esi
jne 0x4099a2
lea edi, [esi + edi]
mov dword [0x413078], edi
mov esp, dword [ebp - 0x38]
jmp 0x409570
mov edx, dword [0x40f038]
test edx, edx
jne 0x409d11
mov dword [0x413068], 0
mov dword [0x40f03c], 0
mov eax, dword [0x413088]
inc eax
mov esi, 0x3f
mov dword [0x40f034], eax
jmp 0x40970c
mov edi, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x14]
inc ecx
mov dl, byte [edi + 1]
jmp 0x4097a3
mov ebx, dword [ebp - 0x20]
mov esi, dword [ebx + 0xc]
jmp 0x40970c
push esi
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov edx, dword [ebp + 0x10]
add eax, 0x40
mov ebx, dword [edx]
push ebx
push str._s:_invalid_option_____c_n
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
jmp 0x4097d3
mov dword [ebp + 8], 0
mov edi, dword [ebp + 0x14]
push edi
mov esi, dword [ebp + 0x10]
push esi
mov ebx, dword [ebp + 0xc]
push ebx
mov ecx, dword [ebp + 8]
push ecx
call fcn.00409500
add esp, 0x10
mov esi, eax
jmp 0x40970c
mov edx, dword [ebp - 0x28]
mov dword [0x413068], 0
test edx, edx
je 0x409a75
mov edx, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x30]
mov dword [edx], ecx
mov edx, dword [0x413088]
mov eax, dword [0x413050]
inc edx
test eax, eax
mov dword [0x40f034], edx
je 0x409d84
mov eax, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
shl eax, 4
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x30]
add edi, eax
mov eax, dword [edi + 4]
test eax, eax
jne 0x409dbd
mov ebx, dword [ebp + 0x10]
mov eax, dword [0x40f038]
test eax, eax
mov edx, dword [ebx]
je 0x409b00
mov ax, word [0x412144]
mov word [ebp - 0xf], ax
mov al, byte [0x412146]
mov byte [ebp - 0xd], al
cmp dword [ebp + 8], 1
je 0x409ad5
mov byte [ebp - 0xe], 0
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push eax
add ebx, 0x40
push edx
push str._s:
push ebx
call sub.msvcrt.dll_fprintf
mov esi, dword [edi]
lea eax, [ebp - 0xf]
push esi
push eax
push str.option___s_s_doesnt_accept_an_argument_n
push ebx
call sub.msvcrt.dll_fprintf
add esp, 0x20
mov eax, dword [edi + 0xc]
mov esi, 0x3f
mov dword [0x40f03c], eax
jmp 0x40970c
mov eax, dword [0x413088]
mov edx, dword [ebp + 0x10]
inc eax
mov dword [0x413068], 0
mov dword [0x40f034], eax
mov eax, dword [0x413088]
mov esi, 1
mov eax, dword [edx + eax*4]
mov dword [0x413050], eax
jmp 0x40970c
test ecx, ecx
je 0x4097bb
cmp byte [ecx + 1], 0x3a
je 0x409b90
mov dword [0x413050], 0
test eax, eax
je 0x409be1
cmp byte [eax], 0
je 0x409be1
mov eax, dword [0x413088]
mov esi, dword [0x40f03c]
mov dword [0x40f034], eax
jmp 0x40970c
inc ecx
mov dl, byte [ecx]
jmp 0x4097ac
mov eax, dword [0x413058]
mov dword [ebp - 0x44], eax
jmp 0x409960
mov dword [0x413050], eax
cmp byte [eax], 0
jne 0x409bcc
cmp byte [ecx + 2], 0x3a
je 0x409e1d
mov edi, dword [ebp + 0xc]
mov eax, dword [0x413088]
sub edi, eax
mov dword [ebp + 0xc], edi
cmp dword [ebp + 0xc], 1
jle 0x409dd0
inc eax
mov edx, dword [ebp + 0x10]
mov dword [0x413088], eax
mov eax, dword [edx + eax*4]
mov dword [0x413050], eax
mov eax, dword [0x413088]
mov dword [0x413068], 0
inc eax
mov dword [0x40f034], eax
mov eax, dword [0x413088]
inc eax
jmp 0x409b6b
mov eax, dword [0x413088]
mov dword [0x40f03c], 0
inc eax
mov dword [0x413068], 0
mov dword [0x40f034], eax
mov eax, dword [0x40f038]
test eax, eax
je 0x409d39
mov edi, dword [ebp + 0x10]
mov eax, dword [0x413088]
mov eax, dword [edi + eax*4]
push eax
mov esi, dword [edi]
push esi
push str._s:_option___s_is_ambiguous_n
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov esi, 0x3f
add eax, 0x40
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
jmp 0x40970c
mov edx, dword [ebp + 0x14]
mov al, byte [edx]
cmp al, 0x2b
je 0x409cc7
cmp al, 0x2d
je 0x409cc7
cmp al, 0x3a
mov ebx, dword [ebp + 0x10]
setne al
and eax, 0xff
mov edx, dword [ebx]
lea esi, [eax + eax*4 + 0x3a]
mov eax, dword [0x40f038]
test eax, eax
je 0x409cb7
mov ax, word [0x412144]
mov word [ebp - 0xf], ax
mov al, byte [0x412146]
mov byte [ebp - 0xd], al
cmp dword [ebp + 8], 1
je 0x409c89
mov byte [ebp - 0xe], 0
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push eax
add ebx, 0x40
push edx
push str._s:
push ebx
call sub.msvcrt.dll_fprintf
mov edi, dword [ebp - 0x20]
mov eax, dword [edi]
push eax
lea eax, [ebp - 0xf]
push eax
push str.option___s_s_requires_an_argument_n
push ebx
call sub.msvcrt.dll_fprintf
add esp, 0x20
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + 0xc]
mov dword [0x40f03c], eax
jmp 0x40970c
mov ecx, dword [ebp + 0x14]
mov al, byte [ecx + 1]
jmp 0x409c51
mov esi, dword [0x413078]
cmp edx, esi
jle 0x409cfc
mov eax, dword [ebp + 0x10]
lea ebx, [eax + edx*4 - 4]
dec edx
mov eax, dword [ebx]
mov dword [ebx + 4], eax
sub ebx, 4
lea eax, [edx + 1]
cmp esi, eax
jl 0x409ce0
mov dword [0x413058], edx
mov edx, dword [ebp + 0x10]
mov dword [edx + esi*4], ecx
lea eax, [esi + 1]
or esi, 0xffffffff
mov dword [0x413078], eax
mov dword [0x40f034], eax
jmp 0x40970c
dec eax
mov dword [0x413068], eax
push eax
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
push eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
push str._s:_unrecognised_option____s_n
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
jmp 0x4099d1
mov esi, 0x3f
jmp 0x40970c
mov eax, dword [0x413088]
mov dword [0x40f03c], 0
inc eax
mov dword [0x413068], 0
mov dword [0x40f034], eax
mov eax, dword [0x40f038]
test eax, eax
je 0x409d39
mov ebx, dword [ebp + 0x10]
mov eax, dword [0x413088]
mov eax, dword [ebx + eax*4]
push eax
mov eax, dword [ebx]
push eax
push str._s:_unrecognised_option___s_n
jmp 0x409c29
mov ebx, dword [ebp - 0x30]
mov edi, dword [ebp - 0x2c]
shl ebx, 4
mov dword [ebp - 0x30], ebx
mov ecx, dword [ebp - 0x30]
add edi, ecx
cmp dword [edi + 4], 1
jne 0x409dbd
cmp dword [ebp + 0xc], edx
jle 0x409e3c
mov ecx, dword [ebp + 0x10]
mov dword [0x413088], edx
mov eax, dword [ecx + edx*4]
mov dword [0x413050], eax
lea eax, [edx + 1]
mov dword [0x40f034], eax
mov edx, dword [edi + 8]
test edx, edx
je 0x409e34
mov eax, dword [edi + 0xc]
xor esi, esi
mov dword [edx], eax
jmp 0x40970c
mov esi, dword [0x40f038]
test esi, esi
je 0x409dfd
mov ebx, dword [0x40f03c]
mov eax, dword [sym.imp.msvcrt.dll__iob]
push ebx
add eax, 0x40
mov ecx, dword [ebp + 0x10]
mov ecx, dword [ecx]
push ecx
push str._s:_option_requires_an_argument_____c_n
push eax
call sub.msvcrt.dll_fprintf
add esp, 0x10
mov ebx, dword [ebp + 0x14]
mov al, byte [ebx]
cmp al, 0x2b
je 0x409e2c
cmp al, 0x2d
je 0x409e2c
cmp al, 0x3a
setne al
and eax, 0xff
lea esi, [eax + eax*4 + 0x3a]
jmp 0x40970c
mov dword [0x413050], 0
jmp 0x409bcc
mov edi, dword [ebp + 0x14]
mov al, byte [edi + 1]
jmp 0x409e0a
mov esi, dword [edi + 0xc]
jmp 0x40970c
mov ebx, dword [ebp + 0x14]
mov al, byte [ebx]
cmp al, 0x2b
je 0x409eb9
cmp al, 0x2d
je 0x409eb9
cmp al, 0x3a
mov ecx, dword [ebp + 0x10]
setne al
and eax, 0xff
mov edx, dword [ecx]
lea esi, [eax + eax*4 + 0x3a]
mov eax, dword [0x40f038]
test eax, eax
je 0x409eac
mov ax, word [0x412144]
mov word [ebp - 0xf], ax
mov al, byte [0x412146]
mov byte [ebp - 0xd], al
cmp dword [ebp + 8], 1
je 0x409e81
mov byte [ebp - 0xe], 0
mov ebx, dword [sym.imp.msvcrt.dll__iob]
push eax
add ebx, 0x40
push edx
push str._s:
push ebx
call sub.msvcrt.dll_fprintf
mov eax, dword [edi]
push eax
lea eax, [ebp - 0xf]
push eax
push str.option___s_s_requires_an_argument_n
push ebx
call sub.msvcrt.dll_fprintf
add esp, 0x20
mov eax, dword [edi + 0xc]
mov dword [0x40f03c], eax
jmp 0x40970c
mov edx, dword [ebp + 0x14]
mov al, byte [edx + 1]
jmp 0x409e49