Function at 0x4042c0
Capabilities:
Query environment variable

Disassembly:
push ebp
xor eax, eax
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [0x406018]
mov dword [0x408184], eax
test ebx, ebx
je 0x4042e3
mov eax, dword [0x408180]
test eax, eax
jne 0x404350
jmp 0x4042f2
mov eax, 1
mov ebx, 1
mov dword [0x406018], eax
mov dword [0x4081c8], ebx
xor ebp, ebp
mov esi, dword [esp + 0x58]
mov dword [0x4081b8], ebx
mov dword [0x408188], ebp
mov dword [esp], str.POSIXLY_CORRECT
call sub.msvcrt.dll_getenv
mov dword [0x4081a8], eax
mov ecx, dword [esp + 0x58]
movzx edx, byte [ecx]
cmp dl, 0x2d
je 0x404640
cmp dl, 0x2b
je 0x4046d1
test eax, eax
sete al
movzx eax, al
mov dword [0x408198], eax
mov dword [esp + 0x58], esi
mov ebx, 1
mov dword [0x408180], ebx
mov eax, dword [0x408188]
test eax, eax
je 0x404362
cmp byte [eax], 0
jne 0x404460
mov ebp, dword [0x4081c8]
mov ebx, dword [0x406018]
cmp ebp, ebx
jle 0x40437a
mov dword [0x4081c8], ebx
mov ebp, ebx
mov eax, dword [0x4081b8]
cmp eax, ebx
jle 0x40438b
mov dword [0x4081b8], ebx
mov eax, ebx
cmp dword [0x408198], 1
je 0x404653
cmp ebx, dword [esp + 0x50]
je 0x404620
cld
mov edi, dword [esp + 0x54]
mov eax, 3
mov ecx, eax
mov esi, dword [edi + ebx*4]
mov edi, 0x407cb0
repe cmpsb byte [esi], byte es:[edi]
jne 0x4043f2
cmp dword [0x4081b8], ebp
lea eax, [ebx + 1]
je 0x404751
cmp ebp, eax
je 0x4043e0
mov dword [0x406018], eax
mov eax, dword [esp + 0x54]
call fcn.004041a0
nop
lea esi, [esi]
mov ebp, dword [esp + 0x50]
mov ebx, ebp
mov dword [0x4081c8], ebp
mov dword [0x406018], ebp
cmp ebx, dword [esp + 0x50]
je 0x404620
mov eax, dword [esp + 0x54]
mov edx, dword [eax + ebx*4]
cmp byte [edx], 0x2d
je 0x404432
mov ecx, dword [0x408198]
mov eax, 0xffffffff
test ecx, ecx
je 0x40442a
mov dword [0x408184], edx
lea eax, [ebx + 1]
mov dword [0x406018], eax
mov eax, 1
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
movzx eax, byte [edx + 1]
test al, al
je 0x404408
mov esi, dword [esp + 0x5c]
xor ecx, ecx
test esi, esi
je 0x40444d
cmp al, 0x2d
jne 0x40444d
mov ecx, 1
lea eax, [edx + ecx + 1]
mov dword [0x408188], eax
lea esi, [esi]
lea edi, [edi]
mov ebx, dword [esp + 0x5c]
test ebx, ebx
je 0x4046e3
mov edx, dword [esp + 0x54]
mov ebx, dword [0x406018]
mov eax, dword [edx + ebx*4]
movzx edx, byte [eax + 1]
cmp dl, 0x2d
je 0x404498
mov ecx, dword [esp + 0x64]
test ecx, ecx
je 0x4046e3
cmp byte [eax + 2], 0
je 0x404a21
mov ecx, dword [0x408188]
xor eax, eax
xor edi, edi
mov dword [esp + 0x30], edi
xor ebp, ebp
mov esi, 0xffffffff
mov dword [esp + 0x38], eax
mov edi, ecx
mov dword [esp + 0x34], ebp
mov dword [esp + 0x2c], esi
mov dword [esp + 0x14], ecx
movzx eax, byte [ecx]
jmp 0x4044c8
inc edi
movzx eax, byte [edi]
test al, al
setne dl
cmp al, 0x3d
setne al
movzx eax, al
test edx, eax
jne 0x4044c4
mov esi, dword [esp + 0x5c]
xor ebp, ebp
mov ecx, dword [esi]
test ecx, ecx
je 0x404551
mov edx, dword [esp + 0x14]
mov eax, edi
sub eax, edx
mov dword [esp + 0x28], eax
jmp 0x404500
mov edx, dword [esp + 0x28]
mov ecx, dword [esp + 0x14]
mov dword [esp + 8], edx
mov dword [esp + 4], ecx
mov eax, dword [esi]
mov dword [esp], eax
call sub.msvcrt.dll_strncmp
test eax, eax
jne 0x404547
mov eax, dword [esi]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp dword [esp + 0x28], eax
je 0x404a4f
mov eax, dword [esp + 0x38]
test eax, eax
je 0x404773
mov eax, 1
mov dword [esp + 0x30], eax
add esi, 0x10
inc ebp
mov eax, dword [esi]
test eax, eax
jne 0x404500
mov ebp, dword [esp + 0x30]
test ebp, ebp
setne al
xor edx, edx
cmp dword [esp + 0x34], 0
sete dl
test eax, edx
jne 0x404aed
mov eax, dword [esp + 0x38]
test eax, eax
je 0x404976
lea edx, [ebx + 1]
mov dword [0x406018], edx
cmp byte [edi], 0
je 0x404780
mov ecx, dword [esp + 0x38]
mov eax, dword [ecx + 4]
test eax, eax
jne 0x4047f8
mov ebp, dword [0x406014]
test ebp, ebp
je 0x40478a
mov edi, dword [esp + 0x54]
mov eax, dword [edi + edx*4 - 4]
cmp byte [eax + 1], 0x2d
je 0x404de5
mov ecx, dword [esp + 0x38]
mov esi, str._s:_option___c_s_doesnt_allow_an_argument_n
mov edi, dword [esp + 0x54]
mov eax, dword [ecx]
mov dword [esp + 0x10], eax
mov eax, dword [edi + edx*4 - 4]
movsx eax, byte [eax]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov ebx, dword [0x408188]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x38]
add eax, ebx
mov dword [0x408188], eax
mov eax, dword [edx + 0xc]
mov dword [0x406010], eax
mov eax, 0x3f
jmp 0x40442a
mov eax, dword [0x4081b8]
cmp eax, ebp
je 0x40462e
mov dword [0x406018], eax
add esp, 0x3c
mov eax, 0xffffffff
pop ebx
pop esi
pop edi
pop ebp
ret
mov esi, ecx
mov edi, 2
inc esi
mov dword [0x408198], edi
jmp 0x404341
cmp eax, ebp
je 0x404760
cmp ebp, ebx
je 0x40466e
mov eax, dword [esp + 0x54]
call fcn.004041a0
mov ebx, dword [0x406018]
cmp ebx, dword [esp + 0x50]
jge 0x4046c4
mov edi, dword [esp + 0x54]
mov eax, dword [edi + ebx*4]
cmp byte [eax], 0x2d
je 0x404a40
lea esi, [esi]
lea edi, [edi]
lea eax, [ebx + 1]
cmp eax, dword [esp + 0x50]
mov dword [0x406018], eax
jge 0x4046c2
mov ecx, dword [esp + 0x54]
mov ebx, eax
mov edx, dword [ecx + eax*4]
cmp byte [edx], 0x2d
jne 0x404690
cmp byte [edx + 1], 0
jne 0x4046c4
mov ebx, eax
lea eax, [ebx + 1]
cmp eax, dword [esp + 0x50]
mov dword [0x406018], eax
jl 0x40469e
mov ebx, eax
mov dword [0x4081c8], ebx
mov ebp, ebx
jmp 0x404398
xor esi, esi
mov dword [0x408198], esi
mov esi, dword [esp + 0x58]
inc esi
jmp 0x404341
mov edx, dword [0x408188]
lea eax, [edx + 1]
mov dword [0x408188], eax
mov eax, dword [esp + 0x58]
movzx ebx, byte [edx]
movsx esi, bl
mov edx, esi
call fcn.00404180
mov edi, dword [0x408188]
mov ecx, eax
mov eax, dword [0x406018]
mov dword [esp + 0x14], edi
movzx edx, byte [edi]
cmp dl, 1
adc eax, 0
test ecx, ecx
sete dl
mov dword [0x406018], eax
cmp bl, 0x3a
sete al
or eax, edx
test al, 1
jne 0x404b17
cmp byte [ecx], 0x57
je 0x404829
movzx eax, byte [ecx + 1]
cmp al, 0x3a
je 0x4047c6
mov eax, esi
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [0x406018], eax
mov dword [0x4081b8], eax
jmp 0x4043e0
cmp ebp, ebx
je 0x40466e
mov dword [0x4081b8], ebx
jmp 0x40466e
mov dword [esp + 0x38], esi
mov dword [esp + 0x2c], ebp
jmp 0x404547
mov ecx, dword [esp + 0x38]
cmp dword [ecx + 4], 1
je 0x404802
mov edi, dword [esp + 0x14]
mov dword [esp], edi
call sub.msvcrt.dll_strlen
add eax, edi
mov dword [0x408188], eax
mov eax, dword [esp + 0x60]
test eax, eax
je 0x4047af
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x60]
mov dword [eax], edx
mov ecx, dword [esp + 0x38]
mov edx, dword [ecx + 8]
test edx, edx
je 0x40481d
mov eax, dword [ecx + 0xc]
mov dword [edx], eax
xor eax, eax
jmp 0x40442a
cmp byte [ecx + 2], 0x3a
je 0x404a8e
mov edi, dword [esp + 0x14]
cmp byte [edi], 0
je 0x404a65
mov dword [0x408184], edi
inc dword [0x406018]
xor ebp, ebp
mov eax, esi
mov dword [0x408188], ebp
jmp 0x404749
lea eax, [edi + 1]
mov dword [0x408184], eax
jmp 0x40478a
cmp edx, dword [esp + 0x50]
jge 0x404aa6
mov edi, dword [esp + 0x54]
lea eax, [ebx + 2]
mov dword [0x406018], eax
mov eax, dword [edi + edx*4]
jmp 0x4047fb
mov edi, dword [esp + 0x38]
mov eax, dword [edi + 0xc]
jmp 0x40442a
movzx eax, byte [ecx + 1]
cmp al, 0x3b
jne 0x404743
xor eax, eax
mov edi, dword [esp + 0x14]
xor ebp, ebp
mov dword [esp + 0x24], eax
xor eax, eax
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ebp
cmp byte [edi], 0
je 0x404b65
inc dword [0x406018]
mov dword [0x408184], edi
mov esi, dword [0x408184]
mov dword [0x408188], esi
jmp 0x404875
inc esi
movzx eax, byte [esi]
test al, al
setne dl
cmp al, 0x3d
setne al
movzx eax, al
test edx, eax
jne 0x404874
mov ebx, dword [esp + 0x5c]
xor edi, edi
mov edx, dword [ebx]
test edx, edx
je 0x4048ed
mov eax, dword [0x408188]
mov ebp, esi
sub ebp, eax
mov dword [esp + 0x14], eax
mov dword [esp + 8], ebp
mov edx, dword [esp + 0x14]
mov dword [esp + 4], edx
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_strncmp
test eax, eax
jne 0x4048e3
mov eax, dword [ebx]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp ebp, eax
je 0x404d17
mov eax, dword [esp + 0x24]
test eax, eax
je 0x404bd3
mov eax, 1
mov dword [esp + 0x1c], eax
add ebx, 0x10
inc edi
mov eax, dword [ebx]
test eax, eax
jne 0x4048a2
mov eax, dword [esp + 0x1c]
test eax, eax
setne al
xor edx, edx
cmp dword [esp + 0x20], 0
sete dl
test eax, edx
jne 0x404d88
mov ebp, dword [esp + 0x24]
test ebp, ebp
je 0x404e13
cmp byte [esi], 0
je 0x404b95
mov edi, dword [esp + 0x24]
lea eax, [esi + 1]
mov edi, dword [edi + 4]
test edi, edi
je 0x404e24
mov dword [0x408184], eax
mov ebx, dword [0x408188]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, ebx
mov dword [0x408188], eax
mov eax, dword [esp + 0x60]
test eax, eax
je 0x40495b
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x60]
mov dword [edx], ecx
mov edi, dword [esp + 0x24]
mov edx, dword [edi + 8]
test edx, edx
je 0x404bc7
mov eax, dword [edi + 0xc]
mov dword [edx], eax
xor eax, eax
jmp 0x40442a
mov eax, dword [esp + 0x64]
test eax, eax
je 0x4049a9
mov edx, dword [esp + 0x54]
mov eax, dword [edx + ebx*4]
cmp byte [eax + 1], 0x2d
je 0x4049a9
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x58]
movsx edx, byte [ecx]
call fcn.00404180
test eax, eax
jne 0x4046e3
mov ebx, dword [0x406018]
mov eax, dword [0x406014]
test eax, eax
je 0x4049fc
mov edi, dword [esp + 0x54]
mov edx, dword [edi + ebx*4]
cmp byte [edx + 1], 0x2d
je 0x404c0b
mov eax, dword [0x408188]
mov edi, str._s:_unrecognized_option___c_s_n
mov dword [esp + 0x10], eax
movsx eax, byte [edx]
mov edx, dword [esp + 0x54]
mov dword [esp + 0xc], eax
mov eax, dword [edx]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov ebx, dword [0x406018]
mov esi, 0x407d04
mov dword [0x408188], esi
lea eax, [ebx + 1]
xor ecx, ecx
mov dword [0x406018], eax
mov eax, 0x3f
mov dword [0x406010], ecx
jmp 0x40442a
mov eax, dword [esp + 0x58]
movsx edx, dl
call fcn.00404180
test eax, eax
jne 0x4046e3
mov ebx, dword [0x406018]
jmp 0x404498
cmp byte [eax + 1], 0
je 0x404690
jmp 0x4046c4
mov dword [esp + 0x2c], ebp
mov ebp, 1
mov dword [esp + 0x38], esi
mov dword [esp + 0x34], ebp
jmp 0x404551
mov edx, dword [0x406018]
cmp edx, dword [esp + 0x50]
je 0x404be0
mov edi, dword [esp + 0x54]
lea eax, [edx + 1]
mov dword [0x406018], eax
mov eax, dword [edi + edx*4]
mov dword [0x408184], eax
jmp 0x4047e9
mov ecx, dword [esp + 0x14]
cmp byte [ecx], 0
je 0x404b8e
mov dword [0x408184], ecx
jmp 0x4047e3
mov ebx, dword [0x406014]
test ebx, ebx
jne 0x404c38
mov eax, dword [esp + 0x14]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x58]
add eax, edx
mov dword [0x408188], eax
mov edx, dword [esp + 0x38]
mov eax, dword [edx + 0xc]
mov dword [0x406010], eax
cmp byte [ecx], 0x3a
setne al
movzx eax, al
lea eax, [eax + eax*4 + 0x3a]
jmp 0x40442a
mov esi, dword [0x406014]
test esi, esi
jne 0x404c72
mov edx, dword [esp + 0x14]
mov dword [esp], edx
call sub.msvcrt.dll_strlen
mov edx, dword [esp + 0x14]
add eax, edx
mov dword [0x408188], eax
jmp 0x404a07
mov edx, dword [0x406014]
test edx, edx
je 0x404b55
mov eax, dword [0x4081a8]
test eax, eax
je 0x404cb0
mov dword [esp + 0xc], esi
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov dword [esp + 8], eax
mov eax, str._s:_illegal_option_____c_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [0x406010], esi
mov eax, 0x3f
jmp 0x40442a
mov edx, dword [0x406018]
cmp edx, dword [esp + 0x50]
je 0x404cc8
mov edi, dword [esp + 0x54]
lea eax, [edx + 1]
mov dword [0x406018], eax
mov eax, dword [edi + edx*4]
mov dword [0x408184], eax
jmp 0x404866
xor eax, eax
jmp 0x404a84
mov edi, dword [esp + 0x24]
cmp dword [edi + 4], 1
jne 0x404934
mov edx, dword [0x406018]
cmp edx, dword [esp + 0x50]
jge 0x404d59
mov ecx, dword [esp + 0x54]
lea eax, [edx + 1]
mov dword [0x406018], eax
mov eax, dword [ecx + edx*4]
jmp 0x40492f
mov edx, dword [esp + 0x24]
mov eax, dword [edx + 0xc]
jmp 0x40442a
mov dword [esp + 0x24], ebx
mov dword [esp + 0x18], edi
jmp 0x4048e3
mov eax, dword [0x406014]
test eax, eax
jne 0x404d2d
mov dword [0x406010], esi
mov ecx, dword [esp + 0x58]
movzx eax, byte [ecx]
cmp al, 0x3a
setne al
movzx esi, al
lea esi, [esi + esi*4 + 0x3a]
jmp 0x4047e9
mov eax, dword [0x408188]
mov ebp, str._s:_unrecognized_option_____s_n
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], ebp
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x4049f6
mov ecx, dword [esp + 0x54]
mov eax, dword [ecx + edx*4 - 4]
mov dword [esp + 0xc], eax
mov eax, dword [ecx]
mov ecx, str._s:_option___s_requires_an_argument_n
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov edi, dword [0x408188]
mov dword [esp + 0x14], edi
jmp 0x404ab4
mov edi, dword [esp + 0x54]
mov ecx, str._s:_option___s_is_ambiguous_n
mov eax, dword [edi + ebx*4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 4], ecx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov eax, dword [0x408188]
mov ebx, dword [0x406018]
mov dword [esp + 0x14], eax
jmp 0x404afb
mov dword [esp + 0xc], esi
mov ecx, dword [esp + 0x54]
mov eax, dword [ecx]
mov dword [esp + 8], eax
mov eax, str._s:_invalid_option_____c_n
jmp 0x404b41
mov edi, dword [0x406014]
test edi, edi
je 0x404cf9
mov dword [esp + 0xc], esi
mov edx, dword [esp + 0x54]
mov ebx, str._s:_option_requires_an_argument_____c_n
mov eax, dword [edx]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [0x406010], esi
mov ecx, dword [esp + 0x58]
cmp byte [ecx], 0x3a
setne al
dec al
and al, 0xfb
add al, 0x3f
movsx eax, al
jmp 0x40442a
mov dword [esp + 0x24], ebx
mov ecx, 1
mov dword [esp + 0x18], edi
mov dword [esp + 0x20], ecx
jmp 0x4048ed
mov dword [esp + 0xc], esi
mov edx, dword [esp + 0x54]
mov eax, dword [edx]
mov dword [esp + 8], eax
mov eax, str._s:_option_requires_an_argument_____c_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x404bed
mov ecx, dword [0x406014]
test ecx, ecx
jne 0x404e4d
mov ebx, dword [0x408188]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, ebx
mov dword [0x408188], eax
mov eax, dword [esp + 0x58]
cmp byte [eax], 0x3a
jmp 0x404ade
mov eax, dword [0x406014]
test eax, eax
je 0x404dc0
mov ecx, dword [esp + 0x54]
mov eax, dword [0x406018]
mov eax, dword [ecx + eax*4]
mov dword [esp + 0xc], eax
mov eax, dword [ecx]
mov dword [esp + 8], eax
mov eax, str._s:_option___W__s_is_ambiguous_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov ebx, dword [0x408188]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
inc dword [0x406018]
add eax, ebx
mov dword [0x408188], eax
mov eax, 0x3f
jmp 0x40442a
mov edx, dword [esp + 0x38]
mov eax, dword [edx]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov edi, str._s:_option_____s_doesnt_allow_an_argument_n
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x4045f1
xor eax, eax
mov dword [0x408188], eax
mov eax, 0x57
jmp 0x40442a
mov esi, dword [0x406014]
test esi, esi
jne 0x404e7d
mov ebx, dword [0x408188]
mov dword [esp], ebx
call sub.msvcrt.dll_strlen
add eax, ebx
mov dword [0x408188], eax
mov eax, 0x3f
jmp 0x40442a
mov edi, dword [esp + 0x54]
mov eax, dword [edi + edx*4 - 4]
mov dword [esp + 0xc], eax
mov eax, dword [edi]
mov dword [esp + 8], eax
mov eax, str._s:_option___s_requires_an_argument_n
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x404d67
mov edx, dword [esp + 0x24]
mov ebx, str._s:_option___W__s_doesnt_allow_an_argument_n
mov ecx, dword [esp + 0x54]
mov eax, dword [edx]
mov dword [esp + 0xc], eax
mov eax, dword [ecx]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x404e2e