Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: Joe on December 14, 2005, 11:44:21 PM

Title: [PHP] UJZP
Post by: Joe on December 14, 2005, 11:44:21 PM
UJZP (Unnamed Joe/Zycron Project) is a PHP binary bot, cocreated by me and Zycron (mostly me). So far, it will connect to BNLS (but not do anything) and the connect to BNCS and send 0x50 (it works, too!), but the reply isn't received correctly. Boo hoo.

Current things finished:
-- Packet buffer
-- Configuration class (all constants)
-- BNLS class, with connect(), disconnect(), and a stub for checkrevision().
-- BNCS class, with connect(), disconnect(), and bncs_SID_AUTH_INFO().
Title: Re: [PHP] UJZP
Post by: MyndFyre on December 16, 2005, 04:01:49 PM
Out of curiousity, doesn't PHP allow you to import C functions?

So why not do it in C and then write a PHP frontend?
Title: Re: [PHP] UJZP
Post by: Joe on December 16, 2005, 04:10:20 PM
Because I don't know C well enough. I'd also like bragging rights, but less so than I'm just bored.

I've successfully sent BNLS 0x10 and received it, and then the same for BNCS 0x50. Woo hoo. Time to parse 0x50 and use BNLS for checkrevision (I didn't want to write those on my own, but I may later).

Basically, its the easy stuff now (except maybe checkrevision). The hard stuff was writing the int16/int32 handlers in PHP, and receiving data (not sure how I managed it, really).

Wish me luck, friends!
Title: Re: [PHP] UJZP
Post by: Sidoh on December 16, 2005, 05:46:53 PM
Quote from: Joe[e2] on December 16, 2005, 04:10:20 PM
Because I don't know C well enough. I'd also like bragging rights, but less so than I'm just bored.

I've successfully sent BNLS 0x10 and received it, and then the same for BNCS 0x50. Woo hoo. Time to parse 0x50 and use BNLS for checkrevision (I didn't want to write those on my own, but I may later).

Basically, its the easy stuff now (except maybe checkrevision). The hard stuff was writing the int16/int32 handlers in PHP, and receiving data (not sure how I managed it, really).

Wish me luck, friends!

To me, a C bot would be more impressive than a PHP bot.  That's just me.

PHP's implicit variable declarations, forgiving syntax and built-in optimization engine make programming something like this in PHP a lot easier than it would be in C.
Title: Re: [PHP] UJZP
Post by: Warrior on December 16, 2005, 07:02:43 PM
Well yea but most of the things associated with bot programming in general is transparent between PHP and C althought integrating them both would be impressive.
Title: Re: [PHP] UJZP
Post by: Sidoh on December 16, 2005, 07:06:46 PM
Quote from: Warriorx86] link=topic=4187.msg45589#msg45589 date=1134777763]
Well yea but most of the things associated with bot programming in general is transparent between PHP and C althought integrating them both would be impressive.

What do you mean they're transparent?  Haha, your word choice confused me! :(
Title: Re: [PHP] UJZP
Post by: iago on December 16, 2005, 07:25:49 PM
If somebody really wanted a C binary bot, it would be EASY++ to modify Cattle Chat.  I already do the same type of packets, and the same password hashing.  CheckRevision and CDKey Decode could be done with tha public library that I forget the name of.  The packets are built the same way, just redefine some constants and gg
Title: Re: [PHP] UJZP
Post by: Warrior on December 16, 2005, 07:52:28 PM
Quote from: Sidoh on December 16, 2005, 07:06:46 PM
Quote from: Warriorx86] link=topic=4187.msg45589#msg45589 date=1134777763]
Well yea but most of the things associated with bot programming in general is transparent between PHP and C althought integrating them both would be impressive.

What do you mean they're transparent?  Haha, your word choice confused me! :(

Well I mean if you implement a bot in PHP it shouldn't be that much of a difference to write one in C or C++ (If you go OO)
Title: Re: [PHP] UJZP
Post by: Joe on December 16, 2005, 11:15:52 PM
If someone wanted a C bot, they should go download Slackchat..

..but they don't, so we'll stay on topic! =p

Project renamed to Lumber Bot. Having a cut and paste war right now, brb.
Title: Re: [PHP] UJZP
Post by: Sidoh on December 16, 2005, 11:38:54 PM
Quote from: Warriorx86] link=topic=4187.msg45603#msg45603 date=1134780748]
Well I mean if you implement a bot in PHP it shouldn't be that much of a difference to write one in C or C++ (If you go OO)

I personally think it'd be easier in PHP, but that's much me. :)
Title: Re: [PHP] UJZP
Post by: Warrior on December 17, 2005, 01:12:42 AM
Yes for some reason even though the syntax is almost the same I feel more powerful in PHP. Perhaps it's because of all the PHP documentation and how it's one standard and one implementation over all platforms.
Title: Re: [PHP] UJZP
Post by: Joe on December 17, 2005, 01:13:33 AM
Sneak preview, because I love you!

Quote[INFO] Welcome to Lumber Bot v0.1!
[INFO] Copyright (C) 2005 Joe LaFrance
[INFO] Development Edition
[BNLS] Connecting to bnls.valhallalegends.com:9367..
[BNCS] Connected!
[BNLS] Getting verbyte..
[BNLS] Verbyte: 0xcd

[BNCS] Connecting to hdx.no-ip.org:6112..
[BNCS] Connected!
[BNCS] Requesting authorization..
[DEBUG]
[BNCS] Received authorization challenge.

Notice: Uninitialized string offset: 7 in /home/joe/public_html/UJZP/util.php on line 75
Debug: MPQ Number ==

Notice: Uninitialized string offset: 7 in /home/joe/public_html/UJZP/util.php on line 75
[BNLS] Performing CheckRevision..
[BNLS] Hashing CD-Key..
Title: Re: [PHP] UJZP
Post by: Sidoh on December 17, 2005, 01:26:22 AM
Why do you have Notice's t urned on?
Title: Re: [PHP] UJZP
Post by: Warrior on December 17, 2005, 01:55:02 AM
I wrote an SRP implementation in PHP but I lost it :[
Title: Re: [PHP] UJZP
Post by: Joe on December 17, 2005, 02:10:16 AM
Quote from: Sidoh on December 17, 2005, 01:26:22 AM
Why do you have Notice's t urned on?
Because I don't feel like turning them off. They tell me somethings wrong, and 100% of the time, that means I did something wrong, and I need to fix something. =)

Quote from: Warriorx86] link=topic=4187.msg45685#msg45685 date=1134802502]
I wrote an SRP implementation in PHP but I lost it :[
Crash and burn.


Passed 0x51 authorization challenge. Time to sit and spin my way to a complete bot.
Title: Re: [PHP] UJZP
Post by: Sidoh on December 17, 2005, 02:14:25 AM
Quote from: Joe[e2] on December 17, 2005, 02:10:16 AM
Quote from: Sidoh on December 17, 2005, 01:26:22 AM
Why do you have Notice's t urned on?
Because I don't feel like turning them off. They tell me somethings wrong, and 100% of the time, that means I did something wrong, and I need to fix something. =)

Quote from: Warriorx86] link=topic=4187.msg45685#msg45685 date=1134802502]
I wrote an SRP implementation in PHP but I lost it :[
Crash and burn.


Passed 0x51 authorization challenge. Time to sit and spin my way to a complete bot.

No, don't be dumb and "Ok," respectively.
Title: Re: [PHP] UJZP
Post by: Joe on December 17, 2005, 02:50:43 AM
No at what? Notices are very helpful. You breach darkside (I hear it isn't hard!), grab my code, and disable them in your own copy. =(.
Title: Re: [PHP] UJZP
Post by: Sidoh on December 17, 2005, 02:53:23 AM
Quote from: Joe[e2] on December 17, 2005, 02:50:43 AM
No at what? Notices are very helpful. You breach darkside (I hear it isn't hard!), grab my code, and disable them in your own copy. =(.

Not really.  They're more annoyances than anything.  They're often thrown when perfectly valid code doesn't like the way php.ini is configured.