You last visited: Today at 02:23
Advertisement
[Release] Packet Converter
Discussion on [Release] Packet Converter within the Nostale forum part of the MMORPGs category.
07/20/2015, 23:07
#1
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
[Release] Packet Converter
Hallo Epvp Community, heute release ich ein Packet Converter Tool.
Ihr habt die Möglichkeit das Format beliebig einzustellen.
Eine Black b.z.w Whitelist ist auch vorhanden.
Formate könnt ihr auch speichern und laden.
Example Packet
in 3 333 1820 79 34 2 100 100 0 0 0 -1 1 0 -1 - 0 -1 0 0 0 0 0 0 %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19 %20 %21 %22 %23 %24 %25
Example Format VNUM=%3 X=%5 Y=%6 Direction=%7
Include liegt in der zip Datei
Code:
#include <EzMySql.au3>
Global Const $formatPath = @ScriptDir & "\formats\"
#Region ### START Koda GUI section ### Form=
$hGUI = GUICreate("[BladeTiger12] - Packet Converter", 613, 458, -1, -1)
$idPackets = GUICtrlCreateEdit("", 80, 8, 529, 105)
GUICtrlSetData(-1, "")
$idLblPackets = GUICtrlCreateLabel("Packets:", 8, 8, 46, 17)
$idConvert = GUICtrlCreateButton("Convert", 8, 410, 279, 23)
$idConvertToDb = GUICtrlCreateButton("Convert to Database", 325, 410, 279, 23)
$idHelpDB = GUICtrlCreateButton("Help DB Convert", 325, 435, 95, 20)
$idLblFormat = GUICtrlCreateLabel("Format:", 8, 128, 55, 17)
$idFormat = GUICtrlCreateEdit("", 144, 120, 465, 145)
GUICtrlSetData(-1, StringFormat(""))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$idLblFilter = GUICtrlCreateLabel("Packet Filter:", 8, 296, 66, 17)
$idFilter = GUICtrlCreateEdit("mv", 80, 296, 529, 97)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$idBlacklist = GUICtrlCreateRadio("Blacklist", 80, 272, 81, 17)
GUICtrlSetState(-1, 1)
$idWhitelist = GUICtrlCreateRadio("Whitelist", 176, 272, 73, 17)
$idSaveFormat = GUICtrlCreateButton("Save", 8, 224, 131, 25)
$idFormatList = GUICtrlCreateCombo("", 8, 160, 129, 25, BitOR(0x3,0x40))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
UpdateFormatList()
While True
Switch GUIGetMsg()
Case -3
For $i = 255 To 0 Step -6
WinSetTrans($hGUI, "", $i)
Sleep(1)
Next
Exit
Case $idConvert
Convert(StringSplit(GUICtrlRead($idPackets), @CRLF, 2), GUICtrlRead($idFormat), StringSplit(GUICtrlRead($idFilter), @LF, 2), 1)
Case $idSaveFormat
SaveFormat(GUICtrlRead($idFormat))
Case $idFormatList
SelectFormat(GUICtrlRead($idFormatList))
Case $idHelpDB
MsgBox(64, "DB Convert Help", "Format:" & @CRLF & "Columnname=%1" & @CRLF & "Columname1=%2" & @CRLF & @CRLF & "Like that: " & @CRLF & "Name=%1" & @CRLF & "Level=%2" & @CRLF & "X=%3" & @CRLF & "...")
Case $idConvertToDb
Convert(StringSplit(GUICtrlRead($idPackets), @CRLF, 2), GUICtrlRead($idFormat), StringSplit(GUICtrlRead($idFilter), @LF, 2), 2)
EndSwitch
WEnd
Func SelectFormat($fileName)
If Not FileExists($formatPath & $fileName) Then
MsgBox(16, "File", "File doesn't exist!")
Return
EndIf
GUICtrlSetData($idFormat, FileRead($formatPath & $fileName))
EndFunc
Func UpdateFormatList()
Local $findFile = FileFindFirstFile($formatPath & "*.*")
If $findFile = -1 Then Return
Local $bFirstFile = True
While True
Local $findNextFile = FileFindNextFile($findFile)
If @error Then ExitLoop
GUICtrlSetData($idFormatList, $findNextFile)
WEnd
ControlCommand($hGUI, "", $idFormatList, "SetCurrentSelection", 0)
EndFunc
Func SaveFormat($sFormat)
If $sFormat = "" Then Return
Local $fileName = InputBox("Format-Name", "Write format name.")
If @error or $fileName = "" Then Return
$return = StringRegExp($fileName, "^[A-Za-z0-9_ -\.]+$", 0)
If Not $return Then
MsgBox(16, "Filename", "Select other filename!")
Return
EndIf
If FileExists($formatPath & $fileName) Then
If MsgBox(64 + 4, "Exists already", "File " & $fileName & " exists already! Overwrite?") = 7 Then
Return
EndIf
EndIf
Local $file = FileOpen($formatPath & $fileName, 2)
FileWrite($file, $sFormat)
FileClose($file)
UpdateFormatList()
EndFunc
Func Convert($aConvert, $sFormat, $aFilter, $Type)
If $Type = 1 Then
Local $hFile = FileOpen("packet_result.txt", 2)
For $i = 0 To UBound($aConvert) -1
If $aConvert[$i] = "" Or StringReplace($aConvert[$i], " ", "") = "" Then ContinueLoop
Local $aParams = StringSplit($aConvert[$i], " ", 2)
If Not IsArray($aParams) Or UBound($aParams) = 0 Then ContinueLoop
If $aParams[0] = "" Then ContinueLoop
If CheckFilter($aFilter, $aParams[0]) Then ContinueLoop
Local $curFormat = $sFormat
For $j = 0 To UBound($aParams) -1
$curFormat = StringReplace($curFormat, "%" & $j + 1, $aParams[$j])
Next
FileWrite($hFile, $curFormat & @CRLF)
Next
FileClose($hFile)
ElseIf $Type = 2 Then
Local $dbData = InputBox("Db data", "Write in Format like this: Host#user#password#database#table")
If @error Or $dbData = "" Then Return
Local $aDBData = StringSplit($dbData, "#", 2)
If UBound($aDBData) < 5 Then
MsgBox(16, "Error", "Wrong DB data!")
Return
EndIf
Local $aFormat = StringSplit($sFormat, @CRLF, 2)
MySql_Startup()
If Not MySql_Open($aDBData[0], $aDBData[1], $aDBData[2], $aDBData[3]) Then
MsgBox(16, "MySQL Error", "Error: " & @CRLF & MySql_ErrMsg())
Else
Local $stdSqlQuery = "INSERT INTO " & $aDBData[4] & "(", $sArgValue = ""
For $i = 0 To UBound($aFormat) -1
If $aFormat[$i] = "" Then ContinueLoop
Local $split = StringSplit($aFormat[$i], "=", 2)
If Not IsArray($split) Or UBound($split) <> 2 Then ContinueLoop
$stdSqlQuery &= $split[0] & ", "
$sArgValue &= "'" & $split[1] & "'"
$sArgValue &= ", "
Next
$stdSqlQuery = StringTrimRight($stdSqlQuery, 2) & ") VALUES(" & StringTrimRight($sArgValue, 2) & ")"
For $i = 0 To UBound($aConvert) -1
If $aConvert[$i] = "" Or StringReplace($aConvert[$i], " ", "") = "" Then ContinueLoop
Local $aParams = StringSplit($aConvert[$i], " ", 2)
If Not IsArray($aParams) Or UBound($aParams) = 0 Then ContinueLoop
If $aParams[0] = "" Then ContinueLoop
If CheckFilter($aFilter, $aParams[0]) Then ContinueLoop
Local $curFormat = $stdSqlQuery
For $j = 0 To UBound($aParams) -1
$curFormat = StringReplace($curFormat, "%" & $j + 1, $aParams[$j])
Next
MySql_Exec($curFormat)
Next
EndIf
MySql_Close()
MySql_Shutdown()
EndIf
EndFunc
Func CheckFilter(ByRef $aFilter, $sHeader)
Local $isBlacklistChecked = (GUICtrlRead($idBlacklist) = 1) ? True : False
For $i = 0 To UBound($aFilter) -1
If $isBlacklistChecked Then
If $aFilter[$i] = $sHeader Then Return True
Else
If $aFilter[$i] = $sHeader Then Return False
EndIf
Next
If Not $isBlacklistChecked Then Return True
Return False
EndFunc
Version 5:
- You can convert now to db.
Version 4.1:
- Converting bug fixed (Ty to xSensitivex)
Version 4:
- Little bug fix(Converting)
Version 3:
- Formatlist added
Version 2:
- Black/Whitelist added
Version 1:
- Released
Download im Anhang.
Virustotal:
Attached Files
Format Converter.rar
(4.12 MB, 73 views)
07/20/2015, 23:11
#2
elite*gold: 150
Join Date: Sep 2010
Posts: 2,070
Received Thanks: 822
Billig aber ist nützlich und funktioniert
07/20/2015, 23:40
#3
elite*gold: 0
Join Date: Jul 2013
Posts: 479
Received Thanks: 234
Very nice tool ,
Can you add a checkbox for active or not write format in packet_result.txt ?
07/21/2015, 00:13
#4
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
What do you mean with "for active"?
Do you mean if checkbox is checked dont write in "packet_result.txt"?
07/21/2015, 00:34
#5
elite*gold: 2040
Join Date: Apr 2015
Posts: 479
Received Thanks: 156
Sehr geiles tool so kann man sich nun merken wie die packete aufgebaut sind
07/21/2015, 16:14
#6
elite*gold: 50
Join Date: Jul 2014
Posts: 1,702
Received Thanks: 1,170
Dein Tool macht nach jeden Packet was er Convertiert hat das Format als was er es machen soll also z.b.
<start>
vnum=1231
map=1
x=213123
y=123123
<end>
<start>
vnum=%3
map=1
x=%4
y=%5
<end>
07/21/2015, 16:30
#7
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
Das kann daran liegen dass du vllt. eine leere Zeile hast, oder ein Packet das konvertiert wird,
nicht vollständig ist.
PS: Hab mal kleine If-Abfrage eingebaut, probier es am Besten damit nochmal. (Neu downloaden)
07/21/2015, 17:16
#8
elite*gold: 50
Join Date: Jul 2014
Posts: 1,702
Received Thanks: 1,170
Ne bekomme das noch immer hab mal die mein format,packet_result und die txt datei für die in packet in ein zusammen gepackt.
Attached Files
Format Converter.rar
(1.0 KB, 6 views)
07/21/2015, 18:53
#9
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
So neu hochgeladen, sollte nun gefixt sein.
Danke dafür xSensitivex
.
07/21/2015, 22:50
#10
elite*gold: 50
Join Date: Jul 2014
Posts: 1,702
Received Thanks: 1,170
*** ist nun alles Perfekt
07/24/2015, 21:27
#11
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
Soll ich noch hinzufügen, dass man es auch direkt in die DB konvertieren lassen kann?
(Ihr könnt auch Vorschläge machen, kleinere Tools für Server mache ich gerne
Einfach mal Fragen, schadet ja nicht.)
07/25/2015, 00:50
#12
elite*gold: 50
Join Date: Jul 2014
Posts: 1,702
Received Thanks: 1,170
Ja das mit DB ist gut
07/25/2015, 01:45
#13
elite*gold: 64
Join Date: May 2011
Posts: 1,229
Received Thanks: 855
#Update 5:
Added "Convert to db".
Similar Threads
[Release] DBC Converter Ini - DBC / DBC - INI
10/01/2023 - CO2 Weapon, Armor, Effects & Interface edits - 13 Replies
DBC Converter & WDB Extractor
Small utility i put together to convert DBC files to ini files and vice versa. only usefull to private server developers, but here it is.
i would also like to give credits to CptSky for his CO2_Core.dll very nice work mate.
The DBC classes are from his CO2_Core. (Credit given where credit due).
Instructions
Drag the dbc/ini files onto the exe to have them converted.
[Release] Map Converter
07/29/2013 - Cube World - 13 Replies
CW Map Converter
http://i.epvpimg.com/rprMf.png
- Erstellt ein Backup der SP und MP map beim converten
- Ermöglicht das spielen der MP map im SP*
- Ermöglicht das spielen der SP map im MP
- kein großer aufwand, funktioniert schnell
*nur wenn man die map von SP in MP conventiert hat, und dann unter den selben namen zu SP conventiert.
[RELEASE]XML to SQL Converter
01/16/2013 - Metin2 PServer Guides & Strategies - 16 Replies
Moinsen Leute!
Das Konvertierungs-Center ist nun fertig!
Wers gebrauchen kann: Hab Spaß damit.
Wers unnötig findet: ALT + F4 !
Download im Anhang Anleitung wird nicht benötigt solange dein IQ über 40 liegt...
Bugs bitte sofort per PN bei mir melden und umfangreich beschreiben!
[Release].php SQL zu XML Converter
06/14/2012 - Metin2 PServer Guides & Strategies - 8 Replies
Hey ho,
ich hab mir mal die Mühe gemacht *hust* und habe einen .php Script erstellt, mit welchem man Items & Monster ( item_proto & mob_proto ) aus der Datenbank in das XML Format umwandelt.
Wozu man das braucht?
Wenn ihr "locale_name" habt:
[Release]DDS-Converter
01/20/2011 - Metin2 PServer Guides & Strategies - 22 Replies
Hey ich habe heute mal mein Desktop aufgeräumt :P und da fand ich plötzlich eine komische Datei. Aufeinmal stellte sich raus das es ein DDS-Converter war. Er wandelt DDS Dateien in jpg und png dateien um.
Da das für manche Client´s nützlich ist dachte ich ich stell es mal hier rein.
Virustotal Screen
http://img3.fotos-hochladen.net/uploads/virrustot al0t16k9zq.png
Screen vom Programm
http://img3.fotos-hochladen.net/uploads/programmn gw8demb.png
MfG Fun-Zocker
All times are GMT +2. The time now is 02:25 .