TProgramming Forums

Full Version: nonameproxy demo release
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi fellow linux users, id like to show ppl what ive been up to lately.

ive been hacking on a open source proxy as of recent, but instead of pushing for rapid code development ive given a lot of thought into the design of the proxy. What noname proxy is is a platform for building modules ontop of, kinda like what the tibia api does, except because im intercepting packets at the network level, and dont have to worry about concurrency issues. One of the major design goals was to implement hooks, which are executed when particular messages are recieved. At present i have one toy hook (in corehooks.cpp) which modifies the message of the day. Im hoping it will be enough to demonstrate how easy it is to add functionality with my framework. Infact the whole protocol will be implemented through hooks. Anyway, at the moment it doesnt do to much, and theres a slight issue.

Anyway, if you want to try it out heres what you need to do
get the sources from http://code.google.com/p/nonameproxy/
compile launcher, and then run it with the directory and path to the client as arguements.
for example if launcher is in the same directory as tibia then
launcher ./ ./Tibia
will do.
now compile the proxy using make.
run nonameproxy
when you connect with the launched client, wait a few seconds between recving the character list and connecting to the game server. The reason for this is im yet to run the login and game servers in seperate threads, therefore after the login the login server has to shut down and the game server has to start up. After this you can connect through the proxy and all packets will be written to stdout

another neat thing is that you can use an ot ip changer and set the ip to the machine running the proxy and port 1337. this will allow ppl to bot remotely, which i think is cool
anyway this isnt supposed to be useful yet, its just meant to demonstrate a concept. And btw if youre wondering wheres the gui youre out of luck. Eventually there will be a protocol for communicating with the proxy, and therefore a gui could be built which could in theory remotely communicate with the proxy, so it could also be controlled from abroad. Anyway, cheers.
Well I dont run on a linux machine, but i looked through some of ur code and it looks very neat and organized, i like that. Keep it going its looking mighty fine at the moment!

By the way, i noticed you used a lot of function pointers as well as structural pointers? why is that? I never really looked into it or used them? is there any advantage?
function pointers or class pointers?

there are two advantages to using class pointers. The first is that you dont need to call their constructors strait away. This is important if you dont know the initializing values at compile time.

the other is that you can forward declare the classes instead of including their header files. This helps prevent circular dependencies, which are my most hated error type.

in c++ its probably bad practice to use function pointers, instead you should use a pointer to a class with an overridable function and use a pointer to it. The only time you might need function pointers is when you are working with c libraries.
Thanks for the lovely eplination, i also took a look at some google search pages and it says the same thing u did, most books tend to omitt fucntion pointers as "bad practise" i donno why
if your working with c function pointers can be incredibly powerful, ppl just tend to stupid things with them.
There's only a Windows version on the website... =(

Im soo sad...

So many programs and bots for windows, and when I finally thought that I've found a linux-based-project... I only found windows-compatible files :confused:

Please someone help the Linux userssss =P

THx =)
To use it on linux just download the source. He didn't want to compile it for the innumerable platforms, so that is why there is only a windows build.
Ohhhh now I get it... Smile

Thanks a lot, dude :icon10:

But, could you teach me how to compile it on Ubuntu (Gnome) distribution? :confused:

I've got the read-only by SVN... tried "$ sudo make" but didn't work :icon9:

Any ideas??

Thanks for the help Tongue

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

edit: when i tried to compile the laucher... I got this error:

$ g++ launchClient.cpp -o launcher

/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
/tmp/ccQUKzUf.o: In function `ClientLauncher::launch(char const*, unsigned short, bool, bool)':
launchClient.cppSad.text+0xb0): undefined reference to `MemUtil::MemUtil(int)'
launchClient.cppSad.text+0xe8): undefined reference to `MemUtil::writeMem(void const*, unsigned int, unsigned int)'
launchClient.cppSad.text+0x21a): undefined reference to `MemUtil::writeMem(void const*, unsigned int, unsigned int)'
launchClient.cppSad.text+0x24e): undefined reference to `MemUtil::writeMem(void const*, unsigned int, unsigned int)'
launchClient.cppSad.text+0x28d): undefined reference to `MemUtil::writeMem(void const*, unsigned int, unsigned int)'
collect2: ld returned 1 exit status

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

Last edited by Jorginho; Today at 11:50 AM. Reason: Tried to compile.. didn't work, so I'm showing the problem...

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

edit 2: ok running "$ g++ *.cpp `wx-config --libs --cflags` -o launcher" (command that zionz posted on other topic) i could compile the laucher..

then I've runned the launcher with Tiba as path.. and it worked,, tibia was lauched...

BUT......... when I tried to compile the proxy with make... i got this:

--------
$ sudo make
[sudo] password for jorginho:
g++ -pg -Wall -g -O0 -rdynamic -c -o main.o main.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o connection.o connection.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o connectionmanager.o connectionmanager.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o corehooks.o corehooks.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o gamestate.o gamestate.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o loginstate.o loginstate.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o messagefactory.o messagefactory.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o messagelist.o messagelist.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o networkmessage.o networkmessage.cpp
g++ -pg -Wall -g -O0 -rdynamic -c -o rsa.o rsa.cpp
No arquivo incluído de rsa.cpp:23:
rsa.h:24:17: erro: gmp.h: Arquivo ou diretório inexistente
In file included from rsa.cpp:23:
rsa.h:39: erro: ‘mpz_t’ does not name a type
rsa.h:42: erro: ‘mpz_t’ does not name a type
rsa.cpp: In constructor ‘RSA::RSA()’:
rsa.cpp:32: erro: ‘m_e’ was not declared in this scope
rsa.cpp:32: erro: ‘mpz_init2’ was not declared in this scope
rsa.cpp:33: erro: ‘m_pubmod’ was not declared in this scope
rsa.cpp:35: erro: ‘m_d’ was not declared in this scope
rsa.cpp:36: erro: ‘m_prvmod’ was not declared in this scope
rsa.cpp: In destructor ‘virtual RSA::~RSA()’:
rsa.cpp:42: erro: ‘m_e’ was not declared in this scope
rsa.cpp:42: erro: ‘mpz_clear’ was not declared in this scope
rsa.cpp:43: erro: ‘m_pubmod’ was not declared in this scope
rsa.cpp:45: erro: ‘m_d’ was not declared in this scope
rsa.cpp:46: erro: ‘m_prvmod’ was not declared in this scope
rsa.cpp: In member function ‘bool RSA::setPublicKey(const char*, const char*)’:
rsa.cpp:52: erro: ‘m_e’ was not declared in this scope
rsa.cpp:52: erro: ‘mpz_set_str’ was not declared in this scope
rsa.cpp:53: erro: ‘m_pubmod’ was not declared in this scope
rsa.cpp: In member function ‘bool RSA::setPrivateKey(const char*, const char*)’:
rsa.cpp:65: erro: ‘m_d’ was not declared in this scope
rsa.cpp:65: erro: ‘mpz_set_str’ was not declared in this scope
rsa.cpp:66: erro: ‘m_prvmod’ was not declared in this scope
rsa.cpp: In member function ‘bool RSA::encrypt(uint8_t*, uint32_t)’:
rsa.cpp:78: erro: ‘mpz_t’ was not declared in this scope
rsa.cpp:78: erro: expected `;' before ‘plain’
rsa.cpp:79: erro: ‘plain’ was not declared in this scope
rsa.cpp:79: erro: ‘mpz_init2’ was not declared in this scope
rsa.cpp:80: erro: ‘crypt’ was not declared in this scope
rsa.cpp:82: erro: ‘mpz_import’ was not declared in this scope
rsa.cpp:83: erro: ‘m_e’ was not declared in this scope
rsa.cpp:83: erro: ‘m_pubmod’ was not declared in this scope
rsa.cpp:83: erro: ‘mpz_powm’ was not declared in this scope
rsa.cpp:88: erro: ‘mpz_sizeinbase’ was not declared in this scope
rsa.cpp:90: erro: ‘mpz_export’ was not declared in this scope
rsa.cpp:93: erro: ‘mpz_clear’ was not declared in this scope
rsa.cpp: In member function ‘bool RSA::decrypt(uint8_t*, uint32_t)’:
rsa.cpp:104: erro: ‘mpz_t’ was not declared in this scope
rsa.cpp:104: erro: expected `;' before ‘crypt’
rsa.cpp:105: erro: ‘plain’ was not declared in this scope
rsa.cpp:105: erro: ‘mpz_init2’ was not declared in this scope
rsa.cpp:106: erro: ‘crypt’ was not declared in this scope
rsa.cpp:108: erro: ‘mpz_import’ was not declared in this scope
rsa.cpp:110: erro: ‘m_d’ was not declared in this scope
rsa.cpp:110: erro: ‘m_prvmod’ was not declared in this scope
rsa.cpp:110: erro: ‘mpz_powm’ was not declared in this scope
rsa.cpp:112: erro: ‘mpz_sizeinbase’ was not declared in this scope
rsa.cpp:114: erro: ‘mpz_export’ was not declared in this scope
rsa.cpp:117: erro: ‘mpz_clear’ was not declared in this scope
make: ** [rsa.o] Erro 1
--------

Any Ideas?? THx =)
Reference URL's