Function at 0x401150
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
mov esi, dword [0x4073fc]
mov ebx, ecx
mov dword [ebp - 8], ebx
mov dword [0x407400], 0
push edi
mov edi, edx
mov dword [ebp - 4], edi
test esi, esi
jne 0x4011c5
push str.POSIXLY_CORRECT
mov dword [0x4073fc], 1
mov dword [0x407470], 1
mov dword [0x407468], 1
mov dword [0x407464], esi
call dword [sym.imp.api_ms_win_crt_environment_l1_1_0.dll_getenv]
mov esi, dword [0x4073fc]
mov ecx, eax
xor eax, eax
mov dword [0x407460], ecx
add esp, 4
test ecx, ecx
sete al
mov dword [0x40746c], eax
jmp 0x4011ca
mov eax, dword [0x40746c]
mov edx, dword [0x407464]
mov dword [ebp - 0xc], eax
test edx, edx
je 0x4011e0
cmp byte [edx], 0
jne 0x4012e5
mov ecx, dword [0x407468]
cmp eax, 1
jne 0x40123a
mov eax, dword [0x407470]
cmp ecx, eax
je 0x401207
cmp eax, esi
je 0x401213
mov ecx, edi
call fcn.00401060
mov ecx, dword [0x407468]
jmp 0x401213
cmp eax, esi
je 0x401213
mov ecx, esi
mov dword [0x407468], ecx
cmp esi, ebx
jge 0x401230
mov eax, dword [edi + esi*4]
cmp byte [eax], 0x2d
jne 0x401225
cmp byte [eax + 1], 0
jne 0x40122a
inc esi
cmp esi, ebx
jl 0x401217
mov dword [0x4073fc], esi
mov edi, esi
mov dword [0x407470], edi
jmp 0x401240
mov edi, dword [0x407470]
cmp esi, ebx
je 0x4012b5
mov eax, dword [ebp - 4]
mov edx, dword [eax + esi*4]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x10], edx
mov edx, 0x4051f8
mov bl, byte [eax]
cmp bl, byte [edx]
jne 0x401275
test bl, bl
je 0x401271
mov bl, byte [eax + 1]
cmp bl, byte [edx + 1]
jne 0x401275
add eax, 2
add edx, 2
test bl, bl
jne 0x401255
xor eax, eax
jmp 0x40127a
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4012c9
inc esi
mov dword [0x4073fc], esi
cmp ecx, edi
je 0x40129d
cmp edi, esi
je 0x4012a5
mov ecx, dword [ebp - 4]
call fcn.00401060
mov ecx, dword [0x407468]
jmp 0x4012a5
mov ecx, esi
mov dword [0x407468], ecx
mov eax, dword [ebp - 8]
mov edi, eax
mov dword [0x407470], edi
mov dword [0x4073fc], eax
cmp ecx, edi
je 0x4012bf
mov dword [0x4073fc], ecx
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x10]
cmp byte [eax], 0x2d
jne 0x4013ff
cmp byte [eax + 1], 0
lea edx, [eax + 1]
je 0x4013ff
mov edi, dword [ebp - 4]
mov bl, byte [edx]
mov eax, str.ade:g:G:hi:lLno:p:rs:tcuvw:z
inc edx
mov cl, 0x61
mov dword [0x407464], edx
cmp cl, bl
je 0x401303
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x4012f5
xor eax, eax
mov cl, byte [edx]
test cl, cl
jne 0x401310
inc esi
mov dword [0x4073fc], esi
test eax, eax
je 0x4013bc
cmp bl, 0x3a
je 0x4013bc
cmp byte [eax + 1], 0x3a
jne 0x4013b2
cmp byte [eax + 2], 0x3a
jne 0x401353
test cl, cl
jne 0x401357
mov dword [0x407400], 0
mov dword [0x407464], 0
movsx eax, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test cl, cl
je 0x40135f
mov dword [0x407400], edx
jmp 0x4013a1
cmp esi, dword [ebp - 8]
jne 0x401399
movsx eax, bl
push eax
push dword [edi]
push str._s:_option_requires_an_argument_____c_n
push 2
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
push eax
call fcn.00401040
mov bl, 0x3f
mov dword [0x407464], 0
add esp, 0x10
movsx eax, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + esi*4]
mov dword [0x407400], eax
inc esi
mov dword [0x407464], 0
mov dword [0x4073fc], esi
movsx eax, bl
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [0x407460], 0
mov edi, dword [edi]
movsx esi, bl
push 2
je 0x4013d9
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov ecx, str._s:_illegal_option_____c_n
jmp 0x4013e4
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov ecx, str._s:_invalid_option_____c_n
add esp, 4
push esi
push edi
push ecx
push eax
call fcn.00401040
add esp, 0x10
mov eax, 0x3f
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp - 0xc], 0
je 0x4012bf
inc esi
mov dword [0x407400], eax
pop edi
mov dword [0x4073fc], esi
mov eax, 1
pop esi
pop ebx
mov esp, ebp
pop ebp
ret