Author Topic: Creating BNX clone for IRC  (Read 22669 times)

0 Members and 1 Guest are viewing this topic.

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #15 on: November 10, 2012, 10:23:49 pm »
So, I'm ready to make some binaries, though I'm not sure whether I should statically link the libraries or not on Windows. Opinions?

A static ircbnx binary for 64 bit Windows is ~7MB ... kind of clunky. Still, that incorporates PCRE, libevent2 and libstdc++. Though, I like the idea of simply using ircbnx without needing to find runtimes ... and I'm sure any users (if any) would appreciate that too.

Also, I hear Visual Studio's license does not allow open source development ... that you must protect the source code when you distribute the executable. Any truth to this?

Either way, I've been able to produce mingw32/64 compiled binaries. I might try using clang + libcxx instead of mingw and GNU libstdc++ for fun.

Comments?
An adorable giant isopod!

Offline Newby

  • x86
  • Hero Member
  • *****
  • Posts: 10877
  • Thrash!
    • View Profile
Re: Creating BNX clone for IRC
« Reply #16 on: November 29, 2012, 03:04:45 pm »
The lack of dependency fetching is a nice draw to the software, statically linking is cool.  And I'm not sure about the VS license and open source confliction...  (I figure I'd respond since you seem actively into this and nobody else is remarking on it.. I've been reading it without responding for the most part.  It's a really cool project, I just wish I had free time to appreciate it. :()
- Newby
http://www.x86labs.org

Quote
[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

I'd bet that you're currently bloated like a water ballon on a hot summer's day.

That analogy doesn't even make sense.  Why would a water balloon be especially bloated on a hot summer's day? For your sake, I hope there wasn't too much logic testing on your LSAT. 

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #17 on: November 29, 2012, 06:18:35 pm »
The lack of dependency fetching is a nice draw to the software, statically linking is cool.  And I'm not sure about the VS license and open source confliction...  (I figure I'd respond since you seem actively into this and nobody else is remarking on it.. I've been reading it without responding for the most part.  It's a really cool project, I just wish I had free time to appreciate it. :()
The bot is practically finished. Every major feature of BNX (except designate) is implemented (with some extra IRC-specific functionality).

For the past 2 weeks, one instance (nickname is enslay) has been sitting on three networks: binaryninjas (#dojo), betawarz (#dk187,#beta), freenode (#ircbnx).

No problems yet.

Though, I'd like to add server-side ban list management (since IRC severely restricts the number of ban entries) to wrap up the first version.

In future versions, I think I need to embed a scripting engine into it to make it competitive with other bots. It also needs more secure access (e.g. over DCC) since server ops can potentially sniff messages you send through the server (though, the server really ought to be trusted ...).

I'll keep you (the forum) posted.
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #18 on: December 31, 2012, 02:17:14 am »
I released 1.0. It's mostly just tidying up what was there and writing documentation. No server-side ban list management yet. It's much trickier than I anticipated.

I compiled 32 bit and 64 bit (why?) versions with MingW. Everything is statically linked, so hopefully it works correctly out of the box. I'm especially curious if it runs on Windows XP. The "latest" download is the source code, so you'll have to navigate to the "ircbnx" folder to get the executable.

Once I remember how to use rpmbuilder, I'll package it in RPM too ...

In all honesty, I wanted the bot to background like a proper daemon but I'm not sure how to deal with this in Windows (I don't really want it to be a service). So, it'll just show an empty Command Prompt like the old one ...

Feedback and suggestions are appreciated ... if you care.


An adorable giant isopod!

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Creating BNX clone for IRC
« Reply #19 on: January 08, 2013, 03:11:07 pm »
Run it windowless with an icon in the system tray (or whatever they are calling it nowadays)?

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #20 on: January 12, 2013, 02:40:03 pm »
Run it windowless with an icon in the system tray (or whatever they are calling it nowadays)?

Thanks for the suggestion. As I am largely unfamiliar with Windows API, can you refer (if you know) to an MSDN reference?
An adorable giant isopod!

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #23 on: January 26, 2013, 12:41:56 pm »
In addition to the basic BNX features, I've recently added (among a lot of internal code cleanups and added standards compliance)
  • Channel flood protection
  • rejoin command
  • who command

I plan to add a seen command too. Any features you'd like to see in IRCBNX?

Why who and seen you ask? Firstly, everyone on most IRC networks I've frequented are automatically invisible (mode +i), so you can't actually make any practical use of IRC's WHO command unless you're in the channel you're querying! Secondly, IRC's WHOWAS is apparently sometimes disabled (e.g. on freenode). I originally thought, "Gee, IRC has WHOWAS, why bother with seen?"

IRC folk apparently have trouble understanding how who is useful. Aside of good debugging information, who allows you to list the users in a channel you may not be able to join to ask for help (for a variety of reasons: banned, channel limit, invite-only, keyed, etc...). And well, a historical Battle.net reason for who was that you could determine if a server was split. I remember those days when you could see users in a channel that no one else in the channel could see and bots' who command was useful for checking if the bot was on a partially split server. The same applies to IRC I think ... IRC has serious splitting problems like early Battle.net (I almost wonder if Battle.net 1.0 was a heavily modified IRCd!).

I'm not so certain I'll embed a scripting engine now (many people seem to find it a PLUS that it doesn't embed a scripting engine!). At this point, I'm looking for simplicity ... I look at eggdrop, for example, and it feels like you have to be an expert to set it up. But it's IRC bot ... who the fuck wants to read documentation to set up something like that? No, Battle.net bots were superior in that respect ... very simple, functional, and entertaining. These IRC guys are crazy!

I'll have to pick Invert's brain about his modified BNX's botnet support (if he remembers) ... is a botnet really useful enough to be troubled to implement it?

I'm also conflicted on SSL support. I think Unreal is the only IRCd that supports SSL and with the export/customs laws, I'm not really sure it's worth the trouble. It'd be pretty easy to setup with OpenSSL though. Comments?
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #24 on: May 26, 2013, 01:26:58 pm »
I've added a seen and lastseen command just yesterday. Normally, IRC supports WHOWAS, but it apparently can be disabled by the server (e.g. freenode). seen merely tells you if the bot has seen someone, when and in which channel the user was last seen. The seen list is updated on join and privmsg (to a channel). A timer writes the updated seen list to file once every 5 minutes. lastseen tells you who has been seen in a channel in the past day.

I'll try to address the daemonization problem today. It would be nice to be able to daemonize the bot on both Windows (without being a service) and on UNIX-like systems.

I'll try to release 1.2 in early June.
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #25 on: September 08, 2013, 02:35:02 pm »
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762159(v=vs.85).aspx
I've been too busy to work on this lately. I did implement Daemonize() for Unix though, just not Windows. I'll try to tackle this today.

Any suggestions for a tray icon?

EDIT:
I'd like to use the CHAT icon from the old days. I'm just concerned about copyrights ... unless you can find this icon in a collection of Blizzard-released website fan kits?
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #26 on: September 08, 2013, 02:40:37 pm »
A distant plan for this project is a learning-based NLP response system. It's been my life long dream to create a bot that can talk with some amount of intelligence ... of course, this wouldn't really be BNX-like anymore (BNX-like IRCBNX is in the 1.0 branch).

It doesn't help that I work purely in computer vision. NLP is a subject I have to teach myself on my own time.
An adorable giant isopod!

Offline rabbit

  • x86
  • Hero Member
  • *****
  • Posts: 8092
  • I speak for the entire clan (except Joe)
    • View Profile
Re: Creating BNX clone for IRC
« Reply #27 on: September 09, 2013, 09:46:02 am »
A rudimentary system is to use a Markov chain and just leave the bot idling in popular channels for a while to build the dictionary.

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #28 on: December 22, 2013, 12:51:07 am »
One step closer to ShellNotify junk. It now runs with WinMain() instead of main() among other feature and code changes.

Latest version is on SVN, but I'll package a 1.2.0 soon.
An adorable giant isopod!

Offline nslay

  • Hero Member
  • *****
  • Posts: 786
  • Giraffe meat, mmm
    • View Profile
Re: Creating BNX clone for IRC
« Reply #29 on: December 26, 2013, 01:00:30 pm »
OK, tray icon is added. It just needs a picture now! Any suggestions?

Also, I'm not a Win32 programmer. Can someone critique these?

BnxWin32Driver.h
BnxWin32Driver.cpp
ircbnx.rc
Resource.h

Thanks.
An adorable giant isopod!