Hey there
Today I want to share a program with you that I wrote some weeks ago, to make one of my projects more easier.It can be used by programmer who write hacks/bots for metin2.
I know, it isn´t that hard to program something like that, so don't leave comments here like that
Description
The NetworkStreamReader is, as its name says, an application that reads the network-traffic, sent by server->client and client->server. The packets are unencrypted so that you can easily study its content. I've implemented 2 "modes" to sniff for networktraffic. First one is the live-monitor mode which allows you to see the packets printed at runtime on the console. The second mode stores the packets into a .txt file, located in the binarys directory. 2nd mode automatically save both streams, recv and send. For more information please read the "Info about .ini"-part of this post.
Output
If packet is sent by client you get the following output:
PHP Code:
[TYPE: OUTGOING]
Called by 0x57aedb
HEADER: 0x8
SIZE: 16 bytes
8 1 0 47 ed b3 e 0 c0 5e 4 0 65 bf 1a a
This for example is the so called "move-packet" on gf server.
"Called by" is the address from where the send-function is called from.
This gives you the chance to easily locate(jump to address) the function that handles the movement in memory, and call it by its address or do anything else in your hack/bot.
Setup
1.) Create Folder in the directory of your metin2client.exe/bin and name it initInfo
2.) Move the Settings.ini, included in the download, into this directory
3.) Setup the Settings.ini correctly:
CLIENT_ID = 0 for GF or
CLIENT_ID = 1 for SG or
CLIENT_ID = 2 for WOM2
To print the packets to console, set
PRINT_TO_CONSOLE = 1
otherwise you have to save the packets in .txt.
4.) Inject NetworkStreamHook.dll into the mainprocess of metin2
Info for GF: Inject when the loading window of metin2 appears. Otherwise it will may fail because of gameguard.
Info about .ini
CLIENT_ID
Tells the application which client to use. Take the client_id from Step 3 in Setup above.
Example for gameforge: CLIENT_ID = 0
PRINT_TO_CONSOLE
If set to 1(PRINT_TO_CONSOLE = 1) the packets will be displayed in console window.
Info: You are not able to safe as .txt in this mode. Therefore it could cause a client crash(because it's very slow).
SKIP_HEADER_SEND_x/SKIP_HEADER_RECV_x
To make the packet output more clearly, I have also implemented an algorithm that skips the packets(by header) you may don't need.
Your are able to skip 16 packets for each, out and ingoing packets.
To define more than one packet to be skipped, just change x at the end from SKIP_HEADER_SEND_x to 0-15.
Usage:
To skip for example packet with header 54(decimal) define it as following:
SKIP_HEADER_SEND_0 = 54
to skip one more packet.. add SKIP_HEADER_SEND_1 = 16 to .ini file, and so on..
SKIP_SEQ_SEND_PAKET_x
If you skip a packet with the defined variable I explained above, the output nevertheless may shows up the sequencepacket being in GAME_MODE
To skip the SendSequence packet that is sent after the packet just declare SKIP_SEQ_SEND_PAKET_x (with x == 0-15 too).
Example: You want to skip the packet that is sent while moving in client

Header normally 07, in gf 08)
SKIP_HEADER_SEND_0 = 7 SKIP_SEQ_SEND_PAKET_0 = 1
Information: This should only be used if there is really sent a sequence-packet after the packet you want to skip.
If SKIP_SEQ_SEND_PAKET_x is not set and SKIP_HEADER_SEND_x is, the sendsequence packet is automatically not skipped.
Have fun with it.