mIRC Home    About    Download    Register    News    Help

Print Thread
#9428 02/02/03 11:06 PM
Joined: Jan 2003
Posts: 87
T
Tat Offline OP
Babel fish
OP Offline
Babel fish
T
Joined: Jan 2003
Posts: 87
//echo ... $portfree(-3923)
... $true

//echo ... $portfree(bug)
... $true

If the requested port check isn't a number between 1-65535 it should return $false.

#9429 04/02/03 10:35 AM
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
The bug seems to be even more complicated:
All socket commands seem to work with all numbers except 0.
//echo $portfree(-123)
echoes $true

/socklisten blah -123
no errors

//echo $portfree(-123)
echoes $false

/socklist
echoes this:
* Open sockets:
blah 213.51.142.93:65413 tcp listening

---------------------------------------------
//echo $portfree(999999999)
echoes $true

/socklisten bloh
no errors

//echo $portfree(999999999)
echoes $false

[/i]socklist[/i]
echoes this:
* Open sockets:
blah 213.51.142.93:65413 tcp listening
bloh 213.51.142.93:51711 tcp listening

//echo $portfree(51711)
echoes $false

---------------------------------------------
//echo $portfree(0)
echoes $true

/socklisten bluh 0
* /socklisten: invalid parameters


$input(Me like stars, You too?)
#9430 04/02/03 12:27 PM
Joined: Dec 2002
Posts: 774
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Dec 2002
Posts: 774
With my little knowledge C (and C++) variables has ability to flip over when they go out of range.
integer variable can have range 0-65535
when it gets assigned to 65536(out of range) it flips to 1
and when some1 assings it value of -1 it's actually 65534
same with -123 -> 65536-123=65413
999999999 -> mod(99999999,65536) = 51711

well, just ask from someone who is native <language you know best> speaker...


Code:
//if ( khaled isgod ) echo yes | else echo no

Link Copied to Clipboard