Topic: D2GS Proxy - DieTesseract
Hi Guys,
After a few days of developent I finish the project D2GS Proxy, I call it DieTesseract - You Know... the long history we can't build the D2GS of Tesseract2048 and make it work.-
This guide will have two parts:
1 - Simple Guide = For people just want to make it work - Download the File, Start, Configure IP, and ready to go.-
2 - Full Guide = For people who want to build the D2GS proxy by his own, to adapt the specific enviroment.-
Of course the Full guide, talk about everything it's inside and how works... so, probably you want to understand how works de D2GS Proxy.
---
INTRODUCTION
===========
The D2GS have a problem with a Hex code, if you send it, you crash the process, and all the games shut down.-
Tesseract make modifications in theory to avoid this crash and create individual enviroment for every game (D2GS.exe process) - But nobody can make it work, so it's like nothing.-
The basic Idea was create a Proxy, to filter the packet and avoid hit the D2GS.exe process with that bad code.-
In this case I create a virtual machine, with a Linux SO, with a graphical enviroment, Wine installed, modify with a file build it by HarpyWar.-
This allow to use D2GS.exe without problem - This virtual Linux have a IPTable rule who DROP the packet if have that bad Hex Code.-
---
IMPORTANT PERFORMANCE NOTES
=======================
Take in mind a virtualization need aditional resources, for example you will need to have free 512 MB for RAM and this solution can't be put it inside a VPS (in theory).-
A VPS it's a virtual machine, have a virtual machine inside a virtual machine have a HUGE impact in performance it's almost imposible to do nothing.-
If you have a dedicated PC/Server (normal) with Windows (XP or more newer), you will not have any problem.-
The last solution it's always try, may be your VPS can handle or have special CPU instructions with good performance.-
CONFIGURATION SCENARIOS
===================
This is only for guide purposes.-
- PVPGN (Linux) + D2GS (Emulated Wine) = Normal Config - no NAT port required.-
- PVPGN (Windows) with Virtual Machine (NAT) inside = Normal Config - Just be sure the NAT ports are open in VM.-
- HOST >> Virtual Machine (Windows) ++ Virtual Machine (D2GS) in NAT = Normal Config - be sure in the PVPGN Windows machine you put the IP of the HOST because you are in NAT so you go "outside" using the HOST don't forget to Enable ports in VM.-
So when the packet travel searching port 4000 or 8888, the NAT rule say "You need to go to this virtual machine" and hit D2GS.-
- HOST >> Virtual Machine (Windows) ++ Virtual Machine (D2GS) with own IP = Normal Config - put the IP of the D2GS in the PVPGN, no NAT port required.-
---
1 - SIMPLE GUIDE
============
- You need to Download - VirtualBox for Windows: https://www.virtualbox.org/wiki/Downloads or you can use VMWare Player/Workstation (it's pay).-
- Download the Virtual Machine and extract:
- VirtualBox: https://www.dropbox.com/s/yz0arxi85uzka … y.rar?dl=1 (2.0 GB) / PASSWORD: GecKoTDF-PVPGN
- VMWare: https://www.dropbox.com/s/ydgwhiycb8lvf … E.rar?dl=1 (3.7 GB)/ PASSWORD: GecKoTDF-PVPGN
This guide it's for VirtualBox, in the case of VMWare it's almost the same, with a few interface differences.
- Install it, it's freeware no activation need - Open the software and press "Control + A" this will allow you to select the virtual machine to add.-
- Start the Virtual Machine, the NAT rules are add it by default.-
- Open the terminal icon "LXTerminal" and put "wine notepad" this will open a notepad like Windows, go to the "D2GS.reg" it's located in the main user folder "/home/pvpgn/d2gs" and edit, don't forget to save.-
- Open the terminal icon "LXTerminal" and put "wine regedit" this will open the Regedit like Windows, go and import the file "D2GS.reg" you modify before.-
- Open the terminal icon "LXTerminal" - And press "Up arrow key" a few times that will show the code "./Start_D2GS.sh" (without quotes) or just write in the terminal manually.-
- Press Enter, and see in the task manager Window the D2GS.exe process, if it running, you are ready to go - If not, check your D2GS.reg file have all OK.
NOTE: This will avoid the HACK and avoid to use the overhead chat using !text - This is to avoid use RedVex hacks, if any user use the overhead chat, the text don't appear and after a few seconds will be kicked.-
If you still want to use the overhead chat, just go to the tiny black icon, press secondary boton over "Start_D2GS.sh" and press over "LeafPad" and put a # in front of the "Chat Block" IPTable rule, this will disable this function, save it and finally start again in the terminal using "./Start_D2GS.sh"
ADDITIONAL INFORMATION
==================
Default User: pvpgn Password: iptablesgod
Root User: root Password: dietesseract
- Warden it's desactivated in the d2server.ini config.
- The D2GS it's 1.14b but you have the folder with the file to 1.13c just replace.-
- The D2GS folder have all the Diablo II expansion stock files, ready to use.-
2 - Full Guide
=========
Here I am going to explain how build your own D2GS proxy in GNU/Linux Debian based distributions like Ubuntu.
- First, create a virtual machine setup with any virtualization system you like, if you are going to use NAT don't forget to open the ports in the Virtual Machine, for example in VirtualBox this is the way:
Press over the Virtual Machine and press "Control + S" to open the configuration - Go to "LAN" press in "Advance" and open "Ports" and add like this the 4000 port, and the 8888 port (TELNET) if you change the 8888 port put, what you change there in the same way.-
The UDP ports are not strictly necessary but try in this way to discart problems, then if works, you can remove the UDP ports.-
- Then you need to download the sock.c modify and the source code of Wine:
Sock. c >> https://gist.github.com/HarpyWar/cd3676fa4916ea163c50
Wine Source code >> https://sourceforge.net/projects/wine/f … 0.1.tar.xz
- Extract the files and replace the sock.c in wine/server - Then you will need to install a few things before to compile:
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get install libx11-dev:i386
sudo apt-get install libfreetype6-dev:i386
- Go to the Wine folder and compile, one by one line:
./configure (Ignore compilations errors, it's normal in virtualizations)
make (This will take a lot of time)
make install (It's quick)
- Copy your D2GS files and all that stuff, for example in VirtualBox to create a shared folder you add in the program, and then in a terminal in root mode write:
mount -t vboxsf FolderNAME /home/USER/share
Where FolderNAME it's the name of the shared folder, and USER you put the name of the username you create in the virtual machine.-
- Now here it's the important part read well - In root mode you have this two lines, the first avoid the hack, this stop the FF01 String and DROP that packet, only search port 4000 - The second line it's to desactivate the Overhead chat, that will block any atemp to use for example !hello If that happend the packet will be rejected and the user kicked.-
#Block HACK
iptables -A INPUT -p tcp --dport 4000 -m string --hex-string '|FF01|' --algo bm -j DROP
This is not working OK - We recommend desactivate by the moment.
#Block overhead chat
iptables -A INPUT -p tcp --dport 4000 -m string --hex-string '|1400|' --algo bm -j REJECT
You can change the "bm" algorithm for example, depend on you:
bm = Good Performance MAYBE escape some packet.
kmp = More CPU impact but perfect packet string search.
A few nice commands to take in mind, this will LIST all the IPTables rules you have
iptables -L
This will "Flush" remove all the IPTables rules you have
iptables -F
I recommend use this Guide if you never make a PVPGN Network.-
https://pvpgn.pro/d2gs_installation.html
In personal experience it's not necessary to touch the Address_Translation file, just only the w3route server ip translation in the case you want to enable Warcraft 3 and all that stuff.-
Then just follow the guide above - My scenario it's a Host with two virtual machines inside running in parallel, Windows PVPGN, and the DieTesseract using NAT.-