• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Python IP-Changer

Elwyn

Well-Known Member
Joined
Aug 24, 2014
Messages
212
Reaction score
76
I, with Lordfire from OTBr, am developing a IP-Changer in Python to help me learn more about python, memory reading/writing and how to use github to its fullest.

I'm here to show you guys a prototype and ask for your opinion as to what can be done better, what features could be implemented, if I need to be more clearly with my coding style and so on.

The repository is this one: https://github.com/gugahoa/ipchanger-otbr

It's working with every version of Tibia so far, and now has a graphic interface. Check it out and help me make the code better.

I'm studying on making it for Windows too.

Images:
jbrywB5.png

Edit3:
As soon as this IPChanger is complete. I'll start working on a Windows one, with the same idea as this one, an universal IPChanger that works for every versions and even for the ones yet to be released.
 
Last edited:
We are now using python-ptrace, a very good lib for ptrace that now allow us to make this IPChanger universal. This IPChanger will be able to change the ip of every Tibia version without the need of an update by the dev team. (Only in special cases)

Edit:
Sorry, ended up posting and not editing the main post. This post can be deleted.
 
Personally I'd recommend switching to Tkinter, as good as Gtk is, my experience says Tkinter is the way forward for Python UI frameworks.

Regarding using ptrace, you need to be VERY careful what you do there. In my experience on Ubuntu specifically it's quite buggy, and I've seen many a kernel crash due to basic flaws in ptrace. Not least of which is if you suspend a process before it registers its host class using ptrace, whole system will crash (not just the target process). Further to that there doesn't appear to be any safety measures against permanent process locking, which I found relatively frustrating when performing multiple reads / writes in one go (threading issues primarily, but also some crashes and memory corruption due to editing memory which was being read elsewhere).

Either way, I like the concept, ATB with it and be sure to release it with py2exe when you've got something you'd call complete!
 
Thanks for the feedback!
I didn't update this thread since no one was really interested, but now I already have what I would call a complete first version. I ended up using Gtk but I'll be sure to read about Tkinter, and thanks about those warnings about ptrace flaws, I really didn't know about them as I'm still studying about ptrace and process handling in linux. I think the lib I'm using for process tracing is quite complete so I didn't have to worry too much until now but I'll now try harder to find flaws on it as an kernel crash is nothing to be made fun of.

I'm now making it in C++ for learning purpose as C++ is more of a low level language than Python and reading about how I should proceed about doing the same thing on Windows. If you have any more tips I would love to hear it :)
 
Thanks for the feedback!
I didn't update this thread since no one was really interested, but now I already have what I would call a complete first version. I ended up using Gtk but I'll be sure to read about Tkinter, and thanks about those warnings about ptrace flaws, I really didn't know about them as I'm still studying about ptrace and process handling in linux. I think the lib I'm using for process tracing is quite complete so I didn't have to worry too much until now but I'll now try harder to find flaws on it as an kernel crash is nothing to be made fun of.

I'm now making it in C++ for learning purpose as C++ is more of a low level language than Python and reading about how I should proceed about doing the same thing on Windows. If you have any more tips I would love to hear it :)

Good to hear you got on well with the Python one! I didn't look into the ptrace lib too much, might have a look this evening as I had some plans to make a basic bot in Python for Linux, but couldn't get around how bad ptrace was!

The C++ one should be relatively difficult by comparison, one of the beautiful things about Python is the sheer quantity of open source libraries providing cross platform access to OS APIs, with C++ this simply turns to shit... Unless you're gonna use something like boost, which IMO for an IP changer is a humongous amount of work and not worth it, given how much easier it is to have two code bases or even just different build rules for each OS. If you're modular enough, it shouldn't be too difficult though. If you're really getting into it you may wish to check out TPForums, there are a handful of like-minded people there who are interested in all aspects of C++ programming primarily for Tibia and OTs. It's rather quiet these days, but there is a massive archive of information and still a handful of highly skilled developers kicking around :)
 
Good to hear you got on well with the Python one! I didn't look into the ptrace lib too much, might have a look this evening as I had some plans to make a basic bot in Python for Linux, but couldn't get around how bad ptrace was!

The C++ one should be relatively difficult by comparison, one of the beautiful things about Python is the sheer quantity of open source libraries providing cross platform access to OS APIs, with C++ this simply turns to shit... Unless you're gonna use something like boost, which IMO for an IP changer is a humongous amount of work and not worth it, given how much easier it is to have two code bases or even just different build rules for each OS. If you're modular enough, it shouldn't be too difficult though. If you're really getting into it you may wish to check out TPForums, there are a handful of like-minded people there who are interested in all aspects of C++ programming primarily for Tibia and OTs. It's rather quiet these days, but there is a massive archive of information and still a handful of highly skilled developers kicking around :)

I'll check it out. I'm doing the C++ version only for linux and for learning purpose, but it's really like you said, Python does have more open source libs and most of them have a good documentation so I'm having a hard time compared to doing it in Python.

And doing this I'm falling in love all over again with Python, it's a really powerful language! :)
 
I'll check it out. I'm doing the C++ version only for linux and for learning purpose, but it's really like you said, Python does have more open source libs and most of them have a good documentation so I'm having a hard time compared to doing it in Python.

And doing this I'm falling in love all over again with Python, it's a really powerful language! :)

Haha, Python is powerful but somewhat inefficient compared to C++. C++ is definitely the way forward for software development in general.

For ptrace in C++, this might be useful: http://tpforums.org/forum/threads/5...orking-ptrace-example!?highlight=linux+ptrace
 
Thanks :)

For C++ I'm having a hard time reading the data in a address with the format that I want, like reading it and parsing to a string if I want a string and so on ):
 
Thanks :)

For C++ I'm having a hard time reading the data in a address with the format that I want, like reading it and parsing to a string if I want a string and so on ):

Format is always a pain in C++. Presuming you're reading a string I believe it'll be stored as a null terminated wchar array, meaning you'll want to get your byte array and point a wchar at it... Not entirely sure though. If you're really stuck feel free to post your output, a snippet of code that you think is problematic, and I'll see if I can help :)
 
Back
Top