Function at 0x402630
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [0x419578]
push esi
xor esi, esi
push edi
mov edi, dword [esp + 0x24]
cmp ebp, esi
mov dword [0x419574], esi
mov ebx, 1
jne 0x4026c6
mov eax, dword [esp + 0x2c]
mov ebp, ebx
mov dword [0x419578], ebp
mov dword [0x419570], ebx
mov dword [0x41956c], ebx
mov dword [0x419564], esi
mov al, byte [eax]
cmp al, 0x2d
jne 0x40268e
mov eax, dword [esp + 0x2c]
mov dword [0x419568], 2
inc eax
mov dword [esp + 0x2c], eax
jmp 0x402746
cmp al, 0x2b
jne 0x4026a6
mov eax, dword [esp + 0x2c]
mov dword [0x419568], esi
inc eax
mov dword [esp + 0x2c], eax
jmp 0x402746
push str.POSIXLY_CORRECT
call dword [sym.imp.MSVCRT.dll_getenv]
mov ebp, dword [0x419578]
add esp, 4
neg eax
sbb eax, eax
inc eax
mov dword [0x419568], eax
jmp 0x4026cb
mov eax, dword [0x419568]
mov ecx, dword [0x419564]
cmp ecx, esi
je 0x4026de
cmp byte [ecx], 0
jne 0x40281b
cmp eax, ebx
jne 0x402740
mov ecx, dword [0x419570]
mov eax, dword [0x41956c]
cmp eax, ecx
je 0x40270a
cmp ecx, ebp
je 0x402714
mov ecx, dword [esp + 0x28]
push ecx
call fcn.00402d70
mov ebp, dword [0x419578]
add esp, 4
jmp 0x402714
cmp ecx, ebp
je 0x402714
mov dword [0x41956c], ebp
cmp ebp, edi
jge 0x402736
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + ebp*4]
cmp byte [ecx], 0x2d
jne 0x40272b
mov dl, byte [ecx + 1]
test dl, dl
jne 0x402736
inc ebp
cmp ebp, edi
mov dword [0x419578], ebp
jl 0x40271c
mov ebx, ebp
mov dword [0x419570], ebx
jmp 0x402746
mov ebx, dword [0x419570]
cmp ebp, edi
je 0x4027be
mov edx, dword [esp + 0x28]
mov edi, 0x4104f0
mov esi, dword [edx + ebp*4]
mov ecx, esi
mov al, byte [ecx]
mov dl, al
cmp al, byte [edi]
jne 0x40277c
test dl, dl
je 0x402778
mov al, byte [ecx + 1]
mov dl, al
cmp al, byte [edi + 1]
jne 0x40277c
add ecx, 2
add edi, 2
test dl, dl
jne 0x402758
xor ecx, ecx
jmp 0x402781
sbb ecx, ecx
sbb ecx, 0xffffffff
test ecx, ecx
jne 0x4027d7
mov eax, dword [0x41956c]
inc ebp
cmp eax, ebx
mov dword [0x419578], ebp
je 0x4027a8
cmp ebx, ebp
je 0x4027ae
mov ecx, dword [esp + 0x28]
push ecx
call fcn.00402d70
add esp, 4
jmp 0x4027ae
mov dword [0x41956c], ebp
mov ebx, dword [esp + 0x24]
mov dword [0x419570], ebx
mov dword [0x419578], ebx
mov eax, dword [0x41956c]
cmp eax, ebx
je 0x4027cc
mov dword [0x419578], eax
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
cmp byte [esi], 0x2d
jne 0x402cfa
mov cl, byte [esi + 1]
test cl, cl
je 0x402cfa
mov edi, dword [esp + 0x30]
test edi, edi
je 0x40280b
cmp cl, 0x2d
jne 0x40280b
mov eax, 1
lea ecx, [esi + eax + 1]
xor esi, esi
mov dword [0x419564], ecx
jmp 0x40281f
xor eax, eax
lea ecx, [esi + eax + 1]
xor esi, esi
mov dword [0x419564], ecx
jmp 0x40281f
mov edi, dword [esp + 0x30]
cmp edi, esi
je 0x402b91
mov edx, dword [esp + 0x28]
mov eax, dword [edx + ebp*4]
cmp byte [eax], 0x2d
jne 0x402b91
cmp byte [eax + 1], 0x2d
je 0x402847
cmp dword [esp + 0x38], esi
je 0x402b91
mov al, byte [ecx]
mov edx, ecx
xor ebx, ebx
mov dword [esp + 0x10], edx
test al, al
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], esi
je 0x402871
cmp al, 0x3d
je 0x40286d
mov al, byte [edx + 1]
inc edx
test al, al
jne 0x402861
mov dword [esp + 0x10], edx
mov eax, dword [esp + 0x30]
mov esi, edi
xor edi, edi
cmp dword [eax], 0
je 0x402ae6
mov ebp, dword [esp + 0x10]
mov eax, dword [esi]
mov edx, ebp
sub edx, ecx
push edx
push ecx
push eax
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x4028cb
mov ecx, dword [esi]
push ecx
call fcn.00402d30
mov ecx, dword [0x419564]
mov edx, ebp
sub edx, ecx
add esp, 4
cmp edx, eax
je 0x4028e2
test ebx, ebx
jne 0x4028c1
mov ebx, esi
mov dword [esp + 0x14], edi
jmp 0x4028d1
mov dword [esp + 0x18], 1
jmp 0x4028d1
mov ecx, dword [0x419564]
mov eax, dword [esi + 0x10]
add esi, 0x10
inc edi
test eax, eax
jne 0x402886
mov eax, dword [esp + 0x1c]
jmp 0x4028ed
mov ebx, esi
mov dword [esp + 0x14], edi
mov eax, 1
mov edx, dword [esp + 0x18]
test edx, edx
je 0x40295d
test eax, eax
jne 0x40295d
mov eax, dword [0x4103c0]
test eax, eax
je 0x402931
mov ecx, dword [0x419578]
mov eax, dword [esp + 0x28]
mov edx, dword [eax + ecx*4]
mov eax, dword [eax]
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push edx
push eax
add ecx, 0x40
push str._s:_option___s_is_ambiguous_n
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov ecx, dword [0x419564]
add esp, 0x10
push ecx
call fcn.00402d30
mov ecx, dword [0x419564]
add esp, 4
add ecx, eax
mov eax, dword [0x419578]
inc eax
pop edi
pop esi
mov dword [0x419578], eax
pop ebp
mov dword [0x419564], ecx
xor eax, eax
pop ebx
add esp, 0x10
ret
test ebx, ebx
je 0x402ae0
mov eax, dword [0x419578]
inc eax
mov dword [0x419578], eax
mov dl, byte [ebp]
test dl, dl
mov edx, dword [ebx + 4]
je 0x402a48
test edx, edx
je 0x4029c8
inc ebp
mov dword [0x419574], ebp
push ecx
call fcn.00402d30
mov edx, dword [0x419564]
add esp, 4
add edx, eax
mov eax, dword [esp + 0x34]
test eax, eax
mov dword [0x419564], edx
je 0x4029ae
mov edx, dword [esp + 0x14]
mov dword [eax], edx
mov eax, dword [ebx + 8]
test eax, eax
je 0x402ad5
mov ecx, dword [ebx + 0xc]
pop edi
pop esi
mov dword [eax], ecx
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov edx, dword [0x4103c0]
test edx, edx
je 0x402a27
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + eax*4 - 4]
mov dl, byte [eax + 1]
cmp dl, 0x2d
mov edx, dword [ebx]
push edx
jne 0x402a02
mov eax, dword [ecx]
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push eax
add ecx, 0x40
push str._s:_option_____s_doesnt_allow_an_argument_n
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
jmp 0x402a21
movsx eax, byte [eax]
mov ecx, dword [ecx]
mov edx, dword [sym.imp.MSVCRT.dll__iob]
push eax
push ecx
add edx, 0x40
push str._s:_option___c_s_doesnt_allow_an_argument_n
push edx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x14
mov ecx, dword [0x419564]
push ecx
call fcn.00402d30
mov ecx, dword [0x419564]
add esp, 4
add ecx, eax
xor eax, eax
pop edi
pop esi
pop ebp
mov dword [0x419564], ecx
pop ebx
add esp, 0x10
ret
cmp edx, 1
jne 0x402989
cmp eax, dword [esp + 0x24]
jge 0x402a70
mov edx, dword [esp + 0x28]
inc eax
mov edx, dword [edx + eax*4 - 4]
mov dword [0x419578], eax
mov dword [0x419574], edx
jmp 0x402989
mov edx, dword [0x4103c0]
test edx, edx
je 0x402aa4
mov ecx, dword [esp + 0x28]
mov edx, dword [sym.imp.MSVCRT.dll__iob]
add edx, 0x40
mov eax, dword [ecx + eax*4 - 4]
mov ecx, dword [ecx]
push eax
push ecx
push str._s:_option___s_requires_an_argument_n
push edx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov ecx, dword [0x419564]
add esp, 0x10
push ecx
call fcn.00402d30
mov ebp, dword [0x419564]
mov ecx, dword [esp + 0x30]
add ebp, eax
add esp, 4
mov dword [0x419564], ebp
mov bl, byte [ecx]
xor eax, eax
cmp bl, 0x3a
setne al
pop edi
dec eax
pop esi
pop ebp
and eax, 0x3a
pop ebx
add esp, 0x10
ret
mov eax, dword [ebx + 0xc]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebp, dword [0x419578]
mov eax, dword [esp + 0x38]
mov esi, dword [esp + 0x28]
test eax, eax
je 0x402b1c
mov edx, dword [esi + ebp*4]
cmp byte [edx + 1], 0x2d
je 0x402b1c
movsx eax, byte [ecx]
mov ecx, dword [esp + 0x2c]
push eax
push ecx
call fcn.00402d50
add esp, 8
test eax, eax
jne 0x402b8b
mov ebp, dword [0x419578]
mov ecx, dword [0x419564]
mov eax, dword [0x4103c0]
test eax, eax
je 0x402b70
mov ebp, dword [esi + ebp*4]
push ecx
cmp byte [ebp + 1], 0x2d
jne 0x402b4b
mov edx, dword [esi]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push edx
add eax, 0x40
push str._s:_unrecognized_option_____s_n
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
jmp 0x402b6a
movsx ecx, byte [ebp]
mov edx, dword [esi]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push ecx
push edx
add eax, 0x40
push str._s:_unrecognized_option___c_s_n
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x14
mov ebp, dword [0x419578]
inc ebp
pop edi
mov dword [0x419578], ebp
pop esi
pop ebp
mov dword [0x419564], 0x419580
xor eax, eax
pop ebx
add esp, 0x10
ret
mov ecx, dword [0x419564]
mov bl, byte [ecx]
mov edi, dword [esp + 0x2c]
movsx esi, bl
inc ecx
push esi
push edi
mov dword [0x419564], ecx
call fcn.00402d50
mov ecx, dword [0x419564]
add esp, 8
cmp byte [ecx], 0
jne 0x402bbc
inc dword [0x419578]
xor ebp, ebp
cmp eax, ebp
je 0x402cc2
cmp bl, 0x3a
je 0x402cc2
cmp byte [eax + 1], 0x3a
jne 0x402cb7
mov dl, byte [eax + 2]
mov al, byte [ecx]
cmp dl, 0x3a
jne 0x402c20
test al, al
je 0x402c09
mov eax, dword [0x419578]
pop edi
inc eax
mov dword [0x419564], ebp
mov dword [0x419578], eax
pop esi
movsx eax, bl
pop ebp
mov dword [0x419574], ecx
pop ebx
add esp, 0x10
ret
pop edi
mov dword [0x419574], ebp
mov dword [0x419564], ebp
pop esi
movsx eax, bl
pop ebp
pop ebx
add esp, 0x10
ret
test al, al
je 0x402c46
mov eax, dword [0x419578]
pop edi
inc eax
mov dword [0x419564], ebp
mov dword [0x419578], eax
pop esi
movsx eax, bl
pop ebp
mov dword [0x419574], ecx
pop ebx
add esp, 0x10
ret
mov eax, dword [0x419578]
mov ecx, dword [esp + 0x24]
cmp eax, ecx
jne 0x402c9d
cmp dword [0x4103c0], ebp
je 0x402c7a
mov ecx, dword [esp + 0x28]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push esi
add eax, 0x40
mov edx, dword [ecx]
push edx
push str._s:_option_requires_an_argument_____c_n
push eax
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
mov dword [0x41957c], esi
mov dl, byte [edi]
cmp dl, 0x3a
pop edi
setne bl
dec ebx
mov dword [0x419564], ebp
and ebx, 0x3a
pop esi
movsx eax, bl
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x28]
inc eax
mov edx, dword [ecx + eax*4 - 4]
mov dword [0x419578], eax
mov dword [0x419574], edx
mov dword [0x419564], ebp
pop edi
pop esi
movsx eax, bl
pop ebp
pop ebx
add esp, 0x10
ret
cmp dword [0x4103c0], ebp
je 0x402cea
mov eax, dword [esp + 0x28]
mov edx, dword [sym.imp.MSVCRT.dll__iob]
push esi
add edx, 0x40
mov ecx, dword [eax]
push ecx
push str._s:_illegal_option_____c_n
push edx
call dword [sym.imp.MSVCRT.dll_fprintf]
add esp, 0x10
mov dword [0x41957c], esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [0x419568]
test eax, eax
jne 0x402d0e
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x10
ret
inc ebp
mov dword [0x419574], esi
pop edi
mov dword [0x419578], ebp
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x10
ret