Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 20:04

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Packet UI Modules for Netbeans Platform

Discussion on Packet UI Modules for Netbeans Platform within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Cool Packet UI Modules for Netbeans Platform

Hello Guys,

Just a packet ui module for netbeans platform, it helps show packets more clearly. Other modules later maybe



Enjoy!

Edit: She now runs on Mac

Attached Files
File Type: zip packet logger ui modules.zip (180.7 KB, 62 views)
clintonselke is offline  
Thanks
10 Users
Old 04/08/2012, 06:19   #2
 
sharinggan's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 508
Received Thanks: 114
welcome back...
sharinggan is offline  
Old 04/08/2012, 14:14   #3
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
Great share !
I don't have a username is offline  
Old 04/08/2012, 14:36   #4
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Working on a Radar plugin & Packet Interpreter Plugin at the moment to attach to it.

The great thing about Netbeans modules is that they can talk to each other without knowing about each other. Making them highly reusable.

For anyone interested in learning how to use the thing:



clintonselke is offline  
Thanks
4 Users
Old 04/08/2012, 22:06   #5
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
looks cool, i just downloaded it, but can't get it working.

PacketViewerUI requires some classes from Packet Logger project, thus i have dumped their packages into the same project.

Curently I still have some errors that i can't get past before i can test this. Please offer me some advices.
Attached Images
File Type: jpg clintsprojecterror.jpg (15.1 KB, 40 views)
shitboi is offline  
Old 04/09/2012, 02:47   #6
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Quote:
Originally Posted by shitboi View Post
looks cool, i just downloaded it, but can't get it working.

PacketViewerUI requires some classes from Packet Logger project, thus i have dumped their packages into the same project.

Curently I still have some errors that i can't get past before i can test this. Please offer me some advices.
I can't really see if its right or not from ur thumb nail pic.. when i open it, i can't see the text. The image resolution is too low. Can u dump one on and drop a link.

Step 1) File -> New Project...
Step 2) Netbeans Modules -> Netbeans Platform Application
Step 3) Copy the two folders in the zip into the same folder as your project.
Step 4) In netbeans, expand your project out. Right Click Modules -> Add Existing..., then add each the modules one at a time (the folder things, they will look like blue puzzle pieces)

Now you will have the packet ui window inside your app, but there is a few more steps to get data following in it.

Step 5) Right Click the Modules -> Add New... . Create a new Module called something like NameOfMyProgramCore
Step 6) Expand the Module you have just made, Right Click Libraries -> Add Module Dependance. Start Typing in "Packet Logger API", then add it.
Step 7) Inside your new Core module, create a class called something like PacketLogCookieImpl that implements PacketLogCookie. Use alt-enter to help auto import PacketLogCookie interface and alt-enter again for it to put in the methods u need to implement. You'll also need to implement PacketObject as something like PacketObjectImp for use in PacketLogCookieImp, you may use a class in a class to cut down on the number of files if u wish.

For demo-ing it easily without hooking it up to a conquer client (i have other modules not provided that does this). Right click on ur Core projects packet and go "Add Window", this will create a TopComponent which will represent your hooked conquer client later on but not now.

Inside the code for your TopComponent construct your implementation of your PacketLogCookieImp with the class;

private PacketLogCookieImp packetLogCookie = new PacketLogCookieImp();

just in the class, not in any methods

Then inside the constructor of your TopComponent...

public MyWindowTopComponent() {
// some code here, leave it alone
.
.
.
// Then add this
associateLookup(Lookup.singleton(packetLogCookie)) ;
}

And thats it... assuming you have many windows open for many conquer clients later on. When you selected a different client window, it will automatically make the Packet UI window show the packets for the selected client, without you needing to tell it to switch to another client. (thats what associateLookup does)

There are other ways to do this too, by using InstanceContent and AbstractLookup, so you can make the packet ui window switch between clients as you selected different clients in a list (if u were doing a list of attached clients also, not just windows)

Following these tutorials though will really help


Doing those tuts will explain what im getting at, and how to use the two provided modules in your app. Like part 2 of the tutorial, the history window kinda represents the same idea as the packet ui window. and tut 3 tells ya about InstanceContent and AbstractLookup.

I may release a full project later complete with the modules, to make it easier to try out before using the individual modules.

--------------

Heres my current setup as of now



As you can see there are a few more reusable modules now.

- The PacketInterpreterAPI provides a service interface for all the packet interpreters for all versions of conquer. Like Conquer5886PacketInterpreter provides a service for PacketInterpreterAPI for conquer version 5886 styled packets, and when the packets change a new module will be made for that version of conquer ConquerXXXXPacketInterpreter where XXXX is the new conquer version. All packet interpreter modules will be kept even for old versions so they can be reused for old conquer's or spanish conquer client which may use older packets.

- The HookAPI provides a service interface for hooking packets of conquer clients. The modules that implement this service may be memory based packet proxies or actual packet encryption/decryption socket based proxies. The Core module only knows about HookAPI and not the services provided to/by it. The rest of the program does not need to be concerned if its memory based or packet based.

- MockHookAPI provides a fake conquer clients as a service for HookAPI for testing the user interface without needing to hook to a real conquer client. (You can see MockConquer.exe in the pic on the 1st post, those are for testing)

- Win32HookAPI the current hooking mechanism i'm using, its also a service for HookAPI. Later on I may get it to do pattern searching and get it to inform a range of conquer clients it will work on through some methods, then set up many modules in a similar style to the packet interpreters.

- Also others can make AppleHookAPI for the Apple version of conquer, and the rest of the code stays the same, allowing ya to use this bot for a Mac. I say "others", bcuz i dont own a mac and have no idea how to do remote process communication in a mac os. If later someone can provide just that one module, then its an instant mac conquer bot.

- RadarUI is the radar im currenting workin on.

- jna allows java to use kernel32 functions for the Win32Hooking module

And thats pretty much where im at so far. I will need a bot api module to allow people to make bots for it. I might do some Ruby & Python extension modules also, which will allow for some bots to be scripted.

Thats all i've got planned so far

clintonselke is offline  
Thanks
8 Users
Old 04/09/2012, 07:50   #7
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
@Clinton

for the time you have taken to provide me and the community guidance, you deserve a very BIG THANK YOU.

I have read through your carefully crafted reply, and my first response is OH WOW.

1. i just googled JNA (never knew before), it seems to be way more user friendly than JNI, and i am willing to look into that and learn.
2. Netbeans platform application seems really powerful. i wasn't never aware of them despite using netbeans for such a long time.

Welcome back to epvp



EDIT:

The reason why i can't get it working is because i opened those projects up as normal java application projects not a netbeans platform application project.

I probably will give it a quick try tomorrow. If i can't succeed in getting to work, I'll come back for help after April 20, that is when my exams end.

Thanks again


EDIT2:

Jna is fantastic.
shitboi is offline  
Old 04/09/2012, 19:03   #8
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,882
JNA is should have been released parallel to JNI. It shouldn't have taken Sun as long as they did to realize it.
InfamousNoone is offline  
Old 04/10/2012, 15:27   #9
 
elite*gold: 0
Join Date: Jun 2006
Posts: 457
Received Thanks: 67
@Infamous

I total agree with you, but unfortunately Sun still has not realized it yet, lol. Seems that JNA is not distributed by Sun as it is not included in the Java SDK.

@Clinton

Given a pointer and offset, can you show us how to obtain the value using JNA?

I tried the following
Code:
        //where offset is the exact memory 
        Memory outputBuffer = new Memory(bufferSize);
        boolean success = lib.ReadProcessMemory(process, offset, outputBuffer, bufferSize, null);
It works because i have the exact memory location.
My problem is that i do not know how to programmatically derive this memory location by directly resolving the pointers. the documentation for JNA is not very clear and i can not find useful examples to answer my question.


My work around for this is to get the value V at the pointer address, add offset to V to obtain V2, then obtain value at V2.

Do you have a better way to get this done

@Clinton,

did you attempt to perform a WriteProcessMemory using JNA? I tried to do that, but it looks like User Account Control is giving me problems. GetLastError() returns a result of 5 complaining that i do not have enough access to perform a WriteProcessMemory. After googling a bit, i can't find any results that answers my question in a clear cut way. Thus i wonder if you have a solution to that.

Edit:

Nvm, i found the solution, the trick lies at getting the correct handle on the process. When creating the handle, all access must be granted.
shitboi is offline  
Old 04/12/2012, 12:35   #10
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
What i've done so far is just inject a dll (that "Injected" in the picture is just a c/c++ dll). This dll hooks the decode & encode packet functions and communicates them to them to java using winsock. that way i could use an external program to inject the dll, and test the app in debug mode in netbeans. the win32api hook module is basically just a dll injector that listens for a winsock connection from the injected dll.

Quote:
My work around for this is to get the value V at the pointer address, add offset to V to obtain V2, then obtain value at V2.
Unfortunately i have no work around for that kinda thing. I would just call ReadProcessMemory twice.
clintonselke is offline  
Thanks
2 Users
Old 04/16/2012, 11:45   #11
 
Real~Death's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 1,272
Received Thanks: 246
nice to see you came back
nice release btw
Real~Death is offline  
Old 04/16/2012, 12:28   #12
 
clintonselke's Avatar
 
elite*gold: 0
Join Date: Feb 2007
Posts: 348
Received Thanks: 2,175
Update: She can now run on a mac, checkout page 1 for screenshot.
clintonselke is offline  
Thanks
1 User
Reply

Tags
conquer, netbeans modules


Similar Threads Similar Threads
Netbeans Problem
04/07/2012 - C/C++ - 9 Replies
Hallo, ich habe mir gerad netbeans installier und ja er meinte er kann die Bibliothek cstdlib nicht finden ich weiß auch nicht wo ich es einstellen kann und wo die ganzen Biblios sind+ kann mir da jemand helfen :(
Netbeans Frage
08/10/2011 - Technical Support - 1 Replies
Hey hab ne frage falls jemand von euch mit netbeans arbeitet.. wie könnt ich ne Prozedur schreiben die alle "nicht Primzahlen" von 1- 100 ausspuckt? mich würd ma interessieren wie ihr da vorgeht :D.
Fatal errror: failed to load platform modules
05/02/2011 - Counter-Strike - 9 Replies
ja ich kann kein CS:S mehr spielen/starten denn bei steam is irgendetwas kaputt, naja immer kommt die fehler meldung "Fatal errror: failed to load platform modules" kann mir da jemand weiter helfen? mfg
BotResourcePack (VB.net modules)
05/04/2009 - CO2 Bots & Macros - 58 Replies
I was bored so I decided to try the level-bot for taos in BanditL97 cave. I noticed it lagged the system alot and didnt sit/meditate or auto-disconnect when attacked so thought "I should make a better one!" ...which I did. The bot was almost finished when I decided to change what it did... modularisation was then needed so I spilt functions off into their own self-contained modules. This download is what resulted. These modules can be used with any Bot-making in VB.net so far and I...



All times are GMT +2. The time now is 20:04.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.