Register for your free account! | Forgot your password?

Go Back   elitepvpers > Shooter > WarRock
You last visited: Today at 19:35

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

Advertisement



Warrock - Code Snippets

Discussion on Warrock - Code Snippets within the WarRock forum part of the Shooter category.

Closed Thread
 
Old 03/18/2013, 21:03   #826
 
Raz9r's Avatar
 
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
Basic tutorial. Getting to know pointer arithmetics well is like the alpha and omega of gamehacking...
Raz9r is offline  
Old 03/22/2013, 09:20   #827
 
elite*gold: 0
Join Date: Dec 2010
Posts: 5
Received Thanks: 0
#Request MEM_Artillery Source Non ASM and For NoMenu Advance thanks
st3adcaptain is offline  
Old 03/27/2013, 19:07   #828
 
elite*gold: 0
Join Date: Mar 2013
Posts: 1
Received Thanks: 0
schönen guten tag, ich wollte hier mal einiges kleine fragen stellen, ich bin neu hier und wollte mal einfach so run um die standart codes was fragen
also die anz normale quickplant funktion ist ja diese hier ... mal einige fragen wie die source funktionierz,
*(float*)MEM_QUICKPLANT = 200.0F

wenn irgentwas nicht stimmt bitte berichtigen, ich will es nur so für mich wissen

* = öffnet die Adresse QUICKPLANT als Zeiger bzw verweist darauf
(float*) = als float typ öffnen ?!?
QUICKPLANT (0xXXXXX)= Die Adresse von der Variable die die plant zeit speichert
(bzw warum ist wr so blöd und speichert das in einer Variable ?!)
= 200.0F = verändert den Wert auf 200 , aber was hat 200 mit der geschwindigkeit zu tun ? 200 ms ?

so und dann noch die frage zur addresse, bei jedem start ändert sich doch die adresse jeder einzellnen variable ? aber hier scheinen sie alle gleich zu bleiben wieso und warum?
oder denk ich hier komplett in eine flasche richtig ?

und dann gibt es noch solche sourcen
*(float*)(PlayerPointer+ OFS_Z)=1000;

da wird ja die playerpounter adresse (angenommen 0x01) und ofs_z (angenommen 0x03) addiert zu 0x04 ... also wird die höhe bei 0x04 bestimmt nicht 0x03 oder ? also warum nciht gleich 0x04? DD
bitte helft mir ich check da nicht durch DD
ArtaXXerXes is offline  
Old 03/27/2013, 22:55   #829
 
elite*gold: 0
Join Date: Jul 2011
Posts: 3,812
Received Thanks: 1,840
Quote:
Originally Posted by ArtaXXerXes View Post
so und dann noch die frage zur addresse, bei jedem start ändert sich doch die adresse jeder einzellnen variable ? aber hier scheinen sie alle gleich zu bleiben wieso und warum?
Die Adressen der lokalen Variablen veränern sich und die Adressen den globalen bleiben gleich, so war des glaub ich
xRoute66x is offline  
Old 03/27/2013, 23:34   #830
 
Tibolus_'s Avatar
 
elite*gold: 93
Join Date: Jan 2012
Posts: 517
Received Thanks: 585
Quote:
Originally Posted by xroute66x™ :) View Post
Die Adressen der lokalen Variablen veränern sich und die Adressen den globalen bleiben gleich, so war des glaub ich
habs grade getestet also bei bei meinem programm hat sich die addy von ner globalen variable auch geändert muss sie ja auch weil man nciht sicher gehen kann das auf jedem pc auf der gleichen stelle nur was für wr reserviert ist

hier teste es selbst

Code:
int itr=2000;
int main()
{	
	int *ptr;
	ptr=&itr;
	cout<<ptr<<endl;
	system("PAUSE");
}
Tibolus_ is offline  
Old 03/27/2013, 23:51   #831
 
elite*gold: 0
Join Date: Sep 2010
Posts: 10,215
Received Thanks: 5,781
Quote:
Originally Posted by ArtaXXerXes View Post
(bzw warum ist wr so blöd und speichert das in einer Variable ?!)
Sind das Hängos, wer speichert schon Werte in Variablen

Quote:
Originally Posted by xroute66x™ :) View Post
Die Adressen der lokalen Variablen veränern sich und die Adressen den globalen bleiben gleich, so war des glaub ich
Variable (Programmierung) ? Wikipedia
theitfan1337 is offline  
Thanks
1 User
Old 03/28/2013, 00:16   #832



 
+Yazzn's Avatar
 
elite*gold: 420
Join Date: Jan 2012
Posts: 1,082
Received Thanks: 1,000
Gültigkeitsbereiche sind pöse Purchen! :-(
+Yazzn is offline  
Thanks
2 Users
Old 03/30/2013, 22:52   #833
 
[N]oSoul's Avatar
 
elite*gold: 0
Join Date: Nov 2012
Posts: 109
Received Thanks: 142
#request Stamina for 32bit users.
[N]oSoul is offline  
Thanks
1 User
Old 03/30/2013, 23:48   #834


 
Cyno™'s Avatar
 
elite*gold: 678
Join Date: Sep 2011
Posts: 877
Received Thanks: 2,492
Open your Debugger and find a Way to Manipulate the Values otherwise.
Take a Look at the References of the Public Stamina addreses
WarRock is so retarded !
Cyno™ is offline  
Thanks
2 Users
Old 03/31/2013, 16:18   #835
 
Raz9r's Avatar
 
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
Quote:
Originally Posted by xroute66x™ :) View Post
Die Adressen der lokalen Variablen veränern sich und die Adressen den globalen bleiben gleich, so war des glaub ich
Nichtstatische lokale Variablen werden auf dem Stack alloziert, wenn sie nicht explizit mit new oder new[] auf dem Heap alloziert werden und damit auf dem Heap landen. In beiden Fällen sind die Adressen nur innerhalb des Gültigkeitsbereiches konstant, wobei Variablen auf dem Stack immer mit einem Offset zu ESP (Extended Stack Pointer) dargestellt werden können.

Globale Variablen und lokale statische Variablen haben eine konstante Adresse.

Globale statische Variablen werden vom Linker in jeder "Translation Unit" in der sie vorkommen neu instanziert und erhalten damit für jede *.c/*.cc/*.cpp/*.cxx Datei, in der sie vorkommen, eine neue Adresse.
Raz9r is offline  
Thanks
4 Users
Old 04/01/2013, 17:13   #836
 
Sleutel's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 748
Received Thanks: 569
Talking WarRock Packet decoder and parser!

Here is my effort for this thread.

I have written a Java WarRock private server packet handler and now I'm going to release it here. This are functions to decode incoming packets from the log-in server.

Everything is explained inside the code, I want to encourage you guys to start learning to understand servers instead of requesting help with old and bugged server files. It isn't hard once you understand it. However, don't ask me help if you don't know a program language or how to use sockets because I amuse you do.

If you want to make your own server and you don't have any knowledge, well start by learning a program language, focus then on socket programming an networking. (I started by a simple chat program in Visual Basic 6).

Now let us get back on topic, here are the classes and functions I used.
I used 2 functions to decode and handle the packet, the packet parsing is done by a different class.

void processPackets():
Code:
    public boolean processPackets() {
        try {
            // Check if the player is disconnected.
            if (disconnected) { return false; }
            // Checking if the inputstream is valid.
            if (inStream == null) { return false; }
            // Reading input stream and checking if its available.
            if (inStream.available() == 0) { return false; }
            // Reading packet buffers from the network stream.
            int byteLen = inStream.read(this.packetBuffer);
            if (byteLen > 1) {
                // Seting-up a new temporary buffer for parsing the packet string later.
                byte[] packetData = new byte[byteLen];
                // Start of the packet decoding with the xOr keys of the client.
                // the xOr keys can change, this is made for the login server (Nexon).
                // Client -> Server (0xC3)
                for (int i = 0; i < byteLen; i++) {
                    packetData[i] = (byte)(packetBuffer[i] ^ 0xC3);
                }
                // Convert the bytes array into a string with UTF8 encoding for processing it.
                // TODO: Split the packets for stacked packets due the delay of it.
                String packet = new String(packetData, "UTF8");
                System.out.println("[BYTES RECV] >>" + packet); // Debug print.
                // Parse the packet with the decoder.
                PacketDecoder decoder = new PacketDecoder(packet);
                // Handle the packet and check if it was a valid one.
                return handlePacket(decoder);
            }else{
                // Packet bytes are way to short, disconnecting!
                disconnect();
                return false;
            }
        }catch (Exception e) {
            // An exception occured, print print an error message and disconnect.
            System.out.println("Failed to process the packet(s).");
            disconnect();
            return false;
        }
    }
boolean handlePacket():
Code:
    private boolean handlePacket(PacketDecoder d) {
        try {
            // Validate the packet decoder class, if its null just return false, 
            // we let the loop know there was no packet handeld.
            if (d == null) { return false; }
            // Check the packet Id we are going to process.
            switch (d.getId()) {
                case 4352: { // Login request packet
                    //TODO: Write this function by yourself and handle it :)
                    break;
                }
                default: {
                    // We received a unknown packet.
                    System.out.println("Received a unknown packet id:" + d.getId());
                    System.out.println("Packet: " + d.getOriginalPacket());
                    break;
                }
            }
            return true;
        }catch (Exception e) {
            // An exception occured while processing a packet, nothing bad happend so just display a message.
            System.out.println("An exception occured while processing a packet!");
            return false;
        }
    }
PacketDecoder.java:
Code:
public class PacketDecoder {
    private long timeStamp;
    private int packetId;
    private String[] packetBlocks;
    private String packetString;
    
    public PacketDecoder(String packet) {
        // We need to remember the original packet.
        packetString = packet;
        // Split the packet into blocks with their seperator (the space character).
        String[] packetArgs = packet.split(" ");
        // The first block(0) is the timestamp of the packet, we convert it into a long variable.
        timeStamp = Long.parseLong(packetArgs[0]);
        // The second block(1) is the packetid, it is a heximal value but for now we are going to use an int.
        packetId = Integer.parseInt(packetArgs[1]);
        // The rest of the blocks are the packet data.
        // We are going to store the blocks in order, we move the blocks from 2 to the first place in the new block array.
        // We continue this step until we reach the end of the splitted packet arguments.
        packetBlocks = new String[packet.length() - 2];
        for (int i = 2; i < packet.length(); i ++) {
            packetBlocks[i-2] = packetArgs[i];
        }
        // The packet has been parsed into the class :)
    }
    
    // Return the timestamp.
    public long getTimestamp() {
        return this.timeStamp;
    }
    
    // Return the ID.
    public int getId() {
        return this.packetId;
    }
    
    // Return all datablocks as an array.
    public String[] getAllBlocks() {
        return this.packetBlocks;
    }
    
    // Return the original packet.
    public String getOriginalPacket() {
        return this.packetString;
    }
}
Have fun with this code! I hope to see less people asking for help.
Sleutel is offline  
Old 04/02/2013, 00:46   #837
 
elite*gold: 24
Join Date: Jan 2013
Posts: 96
Received Thanks: 58
Sleutel, please... Post real code and not this ****. You commented everything: fine. But thats not the only aspect of good programming...

Lets set some rules for handling WarRock Packets (as Server)
- Use events (as example: receive warrock packet)
- Distinguish Incomming and Outgoing packets (Incomming for getting blocks, Outgoing for adding more)
- Use Packet Reader and PacketWriter (you can also send multiple packets at same time)
- Packet Reader should have an internal "overlapping" buffer, because some packets are too big (multiple TCP packets). so you have to wait until next \n (means that a warrock packet ends)
- Replace 0x20 characters with 0x1D (0x20 is a space, common character used in room names as example). But 0x20 is a delimiter for blocks.

Here is a whole example (i've been using these classes for a long time):


Btw
Quote:
Originally Posted by __underScore View Post
ESP (Extended Stack Pointer)
Wusste gar nicht dass das E für Extended steht, hast echt ahnung (find bei google nix)
Kannst ja mal so ne Register übersicht machen, das wäre echt nice und würde mir helfen
Ich find dazu wie gesagt nicht wirklich was bei Google... :/
Nullpointer1337 is offline  
Thanks
1 User
Old 04/02/2013, 00:57   #838
 
Sleutel's Avatar
 
elite*gold: 0
Join Date: Jul 2010
Posts: 748
Received Thanks: 569
Thanks for posting nullpointer

Edit: Well, this is just an easy way to explain everything. You can also do it the hard way like you
Sleutel is offline  
Old 04/02/2013, 20:08   #839
 
Spe@ker's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 169
Received Thanks: 130
Search: GlassWalls
Spe@ker is offline  
Old 04/02/2013, 21:11   #840
 
Raz9r's Avatar
 
elite*gold: 297
Join Date: Dec 2010
Posts: 1,129
Received Thanks: 1,687
Quote:
Originally Posted by Nullpointer1337 View Post
Kannst ja mal so ne Register übersicht machen, das wäre echt nice und würde mir helfen
Ich find dazu wie gesagt nicht wirklich was bei Google... :/
Zwei Minuten googlen bringen das hier zutage:
Code:
EAX - Accumulator Register
EBX - Base Register
ECX - Counter Register
EDX - Data Register
ESI - Source Index
EDI - Destination Index
EBP - Base Pointer
ESP - Stack Pointer
Und außerdem: ;-)
Raz9r is offline  
Thanks
1 User
Closed Thread


Similar Threads Similar Threads
WarRock EU - Code Snippets
07/12/2012 - WarRock - 7490 Replies
Hi Leute, in diesem Thread könnt ihr: -> Nach Sourcecodes fragen(Beispiel unten) -> Eure Sourcecodes posten(Wenn sie nicht von euch sind mit Credits!) -> Fragen ob eure Source evtl. einen Fehler hat -> Fragen was welcher Fehler bedeuted -> Sourcecodes entnehmen(Bitte beim Release dann Credits angeben!)



All times are GMT +1. The time now is 19:36.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.