JProxy & API - Coming Soon

08/25/2009 05:04 InfamousNoone#1
[Only registered and activated users can see links. Click Here To Register...]

This is simply a sample of a future release, nothing more.

Saint said to post a video of a simple bot using JProxy API so I said sure.
Here's a small video, you'll understand whats below once you've watched it. It's about 10 minutes long.

There's sound, but you don't really need it. Feel free to mute sound on the video.

JProxy API - Auto Follower
[Only registered and activated users can see links. Click Here To Register...]
Code:
using System;
using System.Threading;
using JProxyNativeInterface;

namespace ExamplePlugin
{
    public class PluginClass
    {
        private static PluginForm Form;
        private static JNativeGameClient Client;
        private static ushort LastFollowedX;
        private static ushort LastFollowedY;

        public static void ServerToClient(IntPtr nativeInstance, byte[] Packet)
        {
            if (Form.Following)
            {
                Client = new JNativeGameClient(nativeInstance);
                if (BitConverter.ToUInt16(Packet, 2) == 0x271A)
                { // 0x271A, 0x89 (Jump packet)
                    foreach (JNativeBasicEntity Entity in Client.Screen.Objects)
                    {
                        if (Entity.Name == Form.FollowName)
                        {
                            if (Entity.X != LastFollowedX &&
                                Entity.Y != LastFollowedY)
                            {
                                LastFollowedX = Entity.X;
                                LastFollowedY = Entity.Y;
                                Client.Jump(LastFollowedX, LastFollowedY);
                                Client.SyncClientScreen();
                            }
                            break;
                        }
                    }
                }
            }
        }
        public static void Main()
        {
            Form = new PluginForm();
            new Thread(delegate()
                {
                    System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
                    Form.ShowDialog();
                }
            ).Start();
        }
    }
}

JProxy API - Path Finding
[Only registered and activated users can see links. Click Here To Register...]
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using JProxyNativeInterface;

namespace ExamplePlugin
{
    public class PluginClass
    {
        public static void ClientCommand(IntPtr nativeInstance, string From, string To, string Message)
        {
            string[] cmd = Message.Split(' ');
            if (cmd[0].ToLower() == "/findpath")
            {
                JNativeGameClient Client = new JNativeGameClient(nativeInstance);
                new Thread(
                    delegate()
                    {
                        IntPtr hThread = Client.AddDependentThread(Thread.CurrentThread);

                        Client.SendClientMessage("JProxy is searching for a path please wait.", JNativeDialogType.Center);
                        JNativePoint[] path = JStandardLibrary.GetPath(Client.Map, Client.X, Client.Y, 947, 548);
                        Client.SendClientMessage("JProxy has found you a path.", JNativeDialogType.Center);
                        for (int i = 10; i < path.Length; i += 10)
                        {
                            Client.Jump(path[i].X, path[i].Y);
                            if (i % 20 == 0)
                                Client.SyncClientScreen();
                            System.Threading.Thread.Sleep(1000);
                        }
                        Client.Jump(path[path.Length - 1].X, path[path.Length - 1].Y);
                        Client.SyncClientScreen();

                        Client.RemoveDependentThread(hThread);
                    }
                ).Start();
            }
        }
    }
}
JProxy Autolooter
[Only registered and activated users can see links. Click Here To Register...]
Code:
SOURCE NOT INCLUDED
I'm sure based on this, you can tell JProxyAPI will bring a new age to bot creating based on how simple but effective this bot is.
08/25/2009 05:20 © Haydz#2
Mind blowingly easy.
08/25/2009 05:26 dejan_rules#3
Very good job hybrid it looks really good. :P
08/25/2009 05:28 _tao4229_#4
He didn't really mention you can use any .NET language.
Including VB.NET.
08/25/2009 06:19 lolings1101#5
very good!!im excited about this!
08/25/2009 08:21 high9#6
I see, so you are copying me? Not really I guess, yours is kinda messy on the .net side.

Code:
using CO.Packet;
namespace ACoBotPluginCSharp
{
    public class Class1
    {
        static Class1 self;
        [PluginStartup]
        public static void Main()
        {
            self = new Class1();
            PacketHooks.Sends.Add(self.OnSend);
        }
        public bool OnSend(byte[] p)
        {
            int size = BitConverter.ToInt16(p, 0);
            int id = BitConverter.ToInt16(p, 2);

            MessageBox.Show(String.Format("{0:X} - {1:X}", size, id),"Packet");

            return false;
        }
    }
}
And yes it is working :D. Really I am trying to find dotfuscator 4.3 or higher before I release. I guess I should work on more features while I continue searching.
08/25/2009 13:11 _tao4229_#7
Not much of that is 'messy' or complicated, it's just the fact that the API has a lot of shit in it already. What people who basically just 'script' bots probably wouldn't understand is the 'IntPtr nativeInstance,' the only reason that's even included is because the proxy will support multiple clients through one process, so you're going to need to have a way to determine which client is triggering said event.
Other than that the variable names are just really fucking long.
08/25/2009 13:46 InfamousNoone#8
Quote:
Originally Posted by high9 View Post
I see, so you are copying me? Not really I guess, yours is kinda messy on the .net side.

And yes it is working :D. Really I am trying to find dotfuscator 4.3 or higher before I release. I guess I should work on more features while I continue searching.
Yours is hook based where as ours is proxy-based. If either of ours ever goes public I'll probably simply end up releasing a library on top of your library to allow your API to be used in JProxy-API to keep consistency between the two. By the fact of you saying you need the .net officiator, I'm going to assume your core-library is in .net itself where as mine, really isn't. My JProxy-API is simply exposed to .net and then wrapped, here's an example:

Code:
    public unsafe class JNativeFloor
    {
        [DllImport("JProxyHelper.dll")]
        private static extern int JFloorGetCount(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorLock(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorUnlock(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorGetItem(IntPtr Floor, int Index, JNativeGroundItem* lpBasic);

        public int Count { get { return JFloorGetCount(inst); } }
        public JNativeGroundItem this[int index]
        {
            get
            {
                JNativeGroundItem item = new JNativeGroundItem();
                Lock();
                {
                    if (index < 0)
                        throw new IndexOutOfRangeException("index < 0");
                    if (index >= Count)
                        throw new IndexOutOfRangeException("index >= Count");
                    JFloorGetItem(inst, index, &item);
                }
                Unlock();
                return item;
            }
        }
        public void Lock() { JFloorLock(inst); }
        public void Unlock() { JFloorUnlock(inst); }
        public JNativeGroundItem[] Items
        {
            get
            {
                Lock();
                JNativeGroundItem[] Items = new JNativeGroundItem[Count];
                for (int i = 0; i < Count; i++)
                {
                    fixed (JNativeGroundItem* pItem = &Items[i])
                        JFloorGetItem(inst, i, pItem);
                }
                Unlock();
                return Items;
            }
        }
        
        IntPtr inst;
        internal JNativeFloor(IntPtr instance)
        {
            inst = instance;
        }
    }
And so far,
Code:
    public class JNativeGameClient
    {
        public JNativeGameClient(IntPtr instance);
        public JNativeGameClient(string name);

        public int DynaMapID { get; }
        public JNativeFloor Floor { get; }
        public JNativeInventory Inventory { get; }
        public int MapID { get; }
        public string Name { get; }
        public IntPtr NativeInstance { get; }
        public JNativeScreen Screen { get; }
        public long StatusFlag { get; }
        public int X { get; }
        public int Y { get; }

        public void CastMagic(uint TargetUID, ushort SpellID, ushort Level);
        public void DropItem(uint ItemUID);
        public void Jump(int X, int Y);
        public void Melee(uint TargetUID, JNativeAttackType AttackType);
        public void PickupItem(uint ItemUID);
        public void SendClient(byte[] Packet);
        public void SendServer(byte[] Packet);
        public void SyncClientScreen();
        public void UseItem(uint ItemUID);
        public void Walk(JNativeDirection Direction, bool Run);
    }
08/25/2009 18:36 backo#9
Looks nice, even though I have never played CO2 myself, your proxy looks like fun, and easy to use. Though, i would not use BitConverter as its annoying to keep track of the current packet index yourself, I would suggest using BinaryReader with the combination of MemoryStream.

Code:
MemoryStream packetStream = new MemoryStream(Packet);
BinaryReader packetReader = new BinaryReader(packetStream);
ushort packetOpcode = packetReader.ReadUInt16();
Good luck! May download the game when you release your proxy.
08/25/2009 19:13 apolo87#10
Quote:
Originally Posted by high9 View Post
I see, so you are copying me? Not really I guess, yours is kinda messy on the .net side.

Code:
using CO.Packet;
namespace ACoBotPluginCSharp
{
    public class Class1
    {
        static Class1 self;
        [PluginStartup]
        public static void Main()
        {
            self = new Class1();
            PacketHooks.Sends.Add(self.OnSend);
        }
        public bool OnSend(byte[] p)
        {
            int size = BitConverter.ToInt16(p, 0);
            int id = BitConverter.ToInt16(p, 2);

            MessageBox.Show(String.Format("{0:X} - {1:X}", size, id),"Packet");

            return false;
        }
    }
}
And yes it is working :D. Really I am trying to find dotfuscator 4.3 or higher before I release. I guess I should work on more features while I continue searching.
lol high6 why better return of ur web u are banned and create new acountt pathetic!! no critize this work is great thx infamous!
08/25/2009 19:53 InfamousNoone#11
High6 is a respected person and his criticism is appreciated.
08/25/2009 20:04 high9#12
Quote:
Originally Posted by InfamousNoone View Post
Yours is hook based where as ours is proxy-based. If either of ours ever goes public I'll probably simply end up releasing a library on top of your library to allow your API to be used in JProxy-API to keep consistency between the two. By the fact of you saying you need the .net officiator, I'm going to assume your core-library is in .net itself where as mine, really isn't. My JProxy-API is simply exposed to .net and then wrapped, here's an example:

Code:
    public unsafe class JNativeFloor
    {
        [DllImport("JProxyHelper.dll")]
        private static extern int JFloorGetCount(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorLock(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorUnlock(IntPtr Floor);
        [DllImport("JProxyHelper.dll")]
        private static extern void JFloorGetItem(IntPtr Floor, int Index, JNativeGroundItem* lpBasic);

        public int Count { get { return JFloorGetCount(inst); } }
        public JNativeGroundItem this[int index]
        {
            get
            {
                JNativeGroundItem item = new JNativeGroundItem();
                Lock();
                {
                    if (index < 0)
                        throw new IndexOutOfRangeException("index < 0");
                    if (index >= Count)
                        throw new IndexOutOfRangeException("index >= Count");
                    JFloorGetItem(inst, index, &item);
                }
                Unlock();
                return item;
            }
        }
        public void Lock() { JFloorLock(inst); }
        public void Unlock() { JFloorUnlock(inst); }
        public JNativeGroundItem[] Items
        {
            get
            {
                Lock();
                JNativeGroundItem[] Items = new JNativeGroundItem[Count];
                for (int i = 0; i < Count; i++)
                {
                    fixed (JNativeGroundItem* pItem = &Items[i])
                        JFloorGetItem(inst, i, pItem);
                }
                Unlock();
                return Items;
            }
        }
        
        IntPtr inst;
        internal JNativeFloor(IntPtr instance)
        {
            inst = instance;
        }
    }
And so far,
Code:
    public class JNativeGameClient
    {
        public JNativeGameClient(IntPtr instance);
        public JNativeGameClient(string name);

        public int DynaMapID { get; }
        public JNativeFloor Floor { get; }
        public JNativeInventory Inventory { get; }
        public int MapID { get; }
        public string Name { get; }
        public IntPtr NativeInstance { get; }
        public JNativeScreen Screen { get; }
        public long StatusFlag { get; }
        public int X { get; }
        public int Y { get; }

        public void CastMagic(uint TargetUID, ushort SpellID, ushort Level);
        public void DropItem(uint ItemUID);
        public void Jump(int X, int Y);
        public void Melee(uint TargetUID, JNativeAttackType AttackType);
        public void PickupItem(uint ItemUID);
        public void SendClient(byte[] Packet);
        public void SendServer(byte[] Packet);
        public void SyncClientScreen();
        public void UseItem(uint ItemUID);
        public void Walk(JNativeDirection Direction, bool Run);
    }
Well it really isn't .net. I made it so instead of creating something messy where the hook calls back something unmanaged that calls back to managed. It calls straight to the managed. And in doing so it decided to make the whole hook class that I made into pseudo CLI C++.

I mean, what the fuck is the point of gcroot (it's the class you use to have .net in an unmanaged class). If it just converts the class to managed anyways.


Also by proxy based do you mean yours is a standalone exe proxy and you are creating a plugin system for it right now?
08/25/2009 20:18 mido2008#13
very interesting.can't wait till release
08/25/2009 20:32 Kiyono#14
This looks really interesting and about the video, I had to mute everything and put sound to max to hear it other than that I hope that it'll actually get released.
08/25/2009 21:47 InfamousNoone#15
Quote:
Well it really isn't .net. I made it so instead of creating something messy where the hook calls back something unmanaged that calls back to managed. It calls straight to the managed. And in doing so it decided to make the whole hook class that I made into pseudo CLI C++. Microsoft=... Well, Need I say more?

I mean, what the fuck is the point of gcroot (it's the class you use to have .net in an unmanaged class). If it just converts the class to managed anyways.


Also by proxy based do you mean yours is a standalone exe proxy and you are creating a plugin system for it right now?
It's not standalone, it does require a client instance to be running. However I will probably develop a private library for standalone API, I really don't want TQ changing bot checks and lot and having to break it myself, or patronize Ultimation to break it for me. I assume your hook isn't standalone for the fact of... well, it's a hook, lol, so I assume it could be used in co-relation to JProxy quite easily. I might actually keep this thread open for development purposes of just keeping up to date features of the JProxy.

I added DMap interfacing (JNativeMap) now, and have implemented path finding to the JStandardLibrary class, and am going to post a small sample of using it.

Edit: I read your quote wrong, let me fix this;
Quote:
Also by proxy based do you mean yours is a standalone exe proxy and you are creating a plugin system for it right now?
Yeah, the .exe itself for proxy is standalone. It depends purely on a C++ dll which is JProxyHelper.dll which means obfuscation, let alone reversing/decompiling the .NET/C# host application (JProxy.exe) really does nothing other than explain method calls to JProxyHelper.dll.

We plan on selling the JProxy with existing bots in it such as those seen in 5bot, and the plugin-system is simply a +1 for anyone who's a programmer.

How come CodeXplosion is down?