Author Topic: Simple Port Scanner  (Read 3820 times)

0 Members and 1 Guest are viewing this topic.

Offline KingRat

  • Newbie
  • Posts: 16
    • View Profile
Simple Port Scanner
« on: October 25, 2018, 01:35:08 pm »
I wrote this little code while I was reading the QB64 Wiki, just to figure out the _OPENCLIENT basics.

Code: QB64: [Select]
  1. 'Simple scanner
  2. 'This could be a little faster :/
  3. FOR port = 0 TO 65535
  4.     port$ = STR$(port)
  5.     _TITLE ("Scanning port " + port$ + " of 35535")
  6.     p = _OPENCLIENT("TCP/IP:" + port$ + ":localhost")
  7.     IF p THEN
  8.         PRINT port$ + " - listening!"
  9.     END IF
  10.     CLOSE p
  11. NEXT port
  12.  
  13.  
« Last Edit: October 25, 2018, 01:39:43 pm by KingRat »

Offline KingRat

  • Newbie
  • Posts: 16
    • View Profile
Re: Simple Port Scanner
« Reply #1 on: October 25, 2018, 01:39:26 pm »
Some considerations.

Im really excited about QB64, but I have to admit that this simple code became very slow, and TaskManager shows about 33 megs of RAM while execution.

Some tips for QB64 optimization?

Thanks!
« Last Edit: October 25, 2018, 01:44:53 pm by KingRat »