Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Kal Online
You last visited: Today at 01:11

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

Advertisement



encode/encrypt kal packets frage

Discussion on encode/encrypt kal packets frage within the Kal Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2007
Posts: 56
Received Thanks: 21
encode/encrypt kal packets frage

Hi
Ich habe etwas angefangen mit Kal Programmierung.
Ich verstehe leider das encrypten noch nicht ganz.
Ich habe die Crypt Tabelle mir aus der engine.exe (standart privat server ohne veränderungen) geholt.
Habe meine Crypt Tabelle auch mit den ersten 51.200 Zeichen von BakaBugs geposteter Tabelle verglichen. (erfolgreich

Erstmal was allgemeines zur Crypt Tabele:
Es gibt 256 Zeichen und die Crypt Tabelle ist 51.200 bytes groß,
daraus folgt also es gibt 200 verschiedene Keys.
(Hatte BakaBug irgendwo mal geschrieben)

Meine erste Idee zum encrypten von (packet) Daten war:
Die Ascii Tabelle hat auch 256 Zeichen und da dachte ich einfach die Crypt Tabelle wäre einfach darauf gelegt. Bedeutet sucht man ein A geht man an die 65 Stelle irgendeines Keys und hat dann die codierte schreibweise für A.
(Wieso ist A==65? weil es die Ascii Tabelle so sagt ;P ord('A')==65 )
Ok wäre zu einfach gewesen und geht auch leider nicht ;(

Die 2te Idee habe ich im Thread "Kal-Programmierung" von rEdoX gesehen:

Dort schrieb er etwas über das entschlüsseln von .dat files:

Quote:
Originally Posted by rEdoX View Post
[..]
Code:
[..]
  s[y] := char(StrToInt(Table[ord(s[y])]));
[..]
[..]
Das bedeutet also:
Ich wandle den gesuchten Char in die Ascii zahl dazu um.
Springe in die Zeile der KeyTabelle wo die Ascii Zahl hinzeigt.
Nehme an der Position aus der Key Tabelle die neue Zahl und wandle diese neue Zahl wieder in eine Ascii Zahl um, dann hätte man den codierten char lesbar gemacht.
Naja funktioniert (bei mir) auch nicht...
Keine Ahnung ob ich da jetzt irgendwo zu dumm für war oder das ein anderer Weg war bzw. ein Weg war für die neueren .dat dateien...

Meine 3te überlegung ist bis jetzt, das es ja eigentlich garnicht Ascii sein kann, weil ascii ja nur 128 Zeichen hat...
Ka was es nun sein könnte (viel. ISO 8859-1 das hätte ja 256 zeichen...)

Ich arbeite mit Delphi und habe mir mal einen umwandler geschrieben um die Ascii zeichen anzuzeigen:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var i:Integer;
begin
  memo1.Text:='';
  for i:=1 to 256 do
  begin
  memo1.Lines.add(chr(i));
  end;
end;
Das seltsame ist: Die Ascii Tabelle (mit ord/chr umwandeln) wiederholt sich erst nach 256 zeichen...
Müsste sich aber doch eigentlich nach 128 Zeichen wiederholen.
Bin jetzt völlig verwirrt



Kurz gefasst:
Ich versteh einfach nicht wie ich meinen gesnifften ingame Chat-Text lesbar machen kann ;(

Falls jemand einen Tipp, Idee, Anregung oder Lösung hat wäre ich sehr dankbar ^^

Und Danke schonmal für das lesen des zu lang gewordenen Posts
--- is offline  
Old 09/17/2007, 22:09   #2
 
elite*gold: 0
Join Date: Mar 2007
Posts: 206
Received Thanks: 25
thats sound intresting but would be nice in english ><
Beitarist is offline  
Old 09/17/2007, 22:29   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 56
Received Thanks: 21
Quote:
Originally Posted by Beitarist View Post
thats sound intresting but would be nice in english ><
ah sorry i'm soo lazy :>
Maybe i will translate it tomorw


news:
Habe gerade durch zufall entdeckt das es anscheinend doch eine überlagerte Tabelle ist wie die erste idee die ich hatte.
Nur irgendwie ist alles um +1 verschoben von der ascii tabelle die ich mit chr erzeugt habe...
ka wieso um +1 o.O
(bedeutet also ord('A') ergibt=65 und an der Stelle 66 ist das A verschlüsselt in dem Key, ord('B')=66 und in der Tabelle an Stelle 67...)


Edit2:
Ok mir fällt gerade auf, dass die Ascii Tabelle ja bei 0 los geht und ich immer mit 1 to 256 gemacht habe...
man muss die ascii tabelle also auf 0 to 255 ändern und schon passt es
(ist mir aufgefallen, weil erste zeichen immer einem #0 entsprechen müsste und es aber imemr chr(256) war, die ascii tabelle fängt dann wieder neu an)

I will translate it tomorow ^^
--- is offline  
Old 09/18/2007, 11:50   #4
 
elite*gold: 5
Join Date: Jan 2006
Posts: 483
Received Thanks: 102
Das ist ja mal richtig lustig. Da kommt einer an, hat 3 Posts und schnorrt nicht nach Sachen sondern macht einen richtig guten Post zu seiner aktuellen Arbeit.

ReSpEcT!!!

Zu deiner 2. Frage
Der wert 65 gibt die 65. Postion in der Tabelle an. Wenn du nun bei 0 an Stelle von 1 zu zählen beginnst sollte es hinhaun.
bboh1 is offline  
Old 09/18/2007, 19:34   #5
 
elite*gold: 0
Join Date: Sep 2007
Posts: 56
Received Thanks: 21
Here is how Encryption work:

Dankeschön
Ja ist mir gestern abend auch aufgefallen das ich die Tabelle etwas falsch erzeugt hatte und deswegen alles um +1 verschoben war ^^"

Here i will translate it:
So the first Post was some information and a question, because i had made a little mistake in a Table and was explain it
I got now the solution of the problem, so i will only translate the important thinks (without the question and the mistake ^^ )

Crypt Table
I will first tell you a little bit about the Crypt Table:
There are 256 letters and the size of the Table is 51.200 Bytes, so there are: 200 Keys! (51200/256=200)
BakaBug was explain this and how to get the Table somewhere...
someone Post it also here in this forum:
(i will post my crypt Table in the end of this post)

How does encrypt work?
I want to encrypt some ingame-chat-texts, which i had sniffed.
So my first idea was:
The Ascii Table also have 256 letters so it would be cool if i can lay the ascii Table on the Crypt Key Table.
And it works

What i mean exactly?
If i search for a special letter for example 'A' i go to the Ascii Table look the Position of 'A' and got the Position 65.
Now i go to (any) Key Table to Position 65 and i got now the cryptet letter of 'A'.
So every Key Table have the 'A' in the same position!

But how does i get a letter as a number in the Ascii Table without a Table?
in Delphi you can use this:
Code:
var number:Integer;
begin
number:=ord('A')  //number is now 65
end;
or look here in wikipedia ;P
ASCII-Tabelle - Wikipedia

But i wrote my own little Program to show me the Ascii Table: (also Delphi)
Code:
procedure TForm1.Button1Click(Sender: TObject);
var i:Integer;
begin
  memo1.Text:='';
  for i:=0 to 255 do
  begin
  memo1.Lines.add(chr(i));
  end;
end;

//so the usefull comands in Delphi are:
//chr(65)=='A'
//ord('A')==65
(there was my mistake i had done Ascii Table from 1 to 256 but Ascii Table beginns with 0!!!!)

i saw rEdoX have done a nearly thing to encode thinks.
(i saw his post at: )
Here is his thing:
Quote:
Originally Posted by rEdoX View Post
[..]
Code:
[..]
  s[y] := char(StrToInt(Table[ord(s[y])]));
[..]
[..]
hm... ok with this information we are able to write our own Program which can encrypt it ^^
Befor i write a source code here about encrypting, you must know:
The first letter of a String is the length of the whole String as a letter.
(sounds difficulty o.O but it isn't, look here is a Delphi example) :
Code:
lengthOfString:=ord(String[1]);
//String[1] is the first letter of the String
//and with "ord" you make this letter to a number
//this number is the length of the whole string!
Also you must know: The last letter is always cryptet #0 so we can search this last letter in our crypt key table on position 0 and we have the key!

I'm working with the Hex letters of the Crypt Table, because i also sniffing the Client packets as Hex!
So if you entered somethink to this program, be sure that it is a String in Hex ^^

You can use it, if you had sniff some text from ingame and can't read it, this program can read it
This is my full source and programmed in Delphi.
Please be fair and square.
So don't steal it and post it somewhere else, please.
It would be nice if you mention my name if you use some of this source ^^
Now here is the Source have fun while reading it
Code:
procedure TForm1.Button1Click(Sender: TObject);
var cryptTable: TStringlist;
path,s,tmp,text,txt2:String;
lengthOfString,i,i2,l,t,t2,t3,j,key,getPos,keyfound:Integer;
begin
  cryptTable := TStringList.Create;
  edit2.Text:='';
  Memo1.text:='';
  path:='C:[bla bla]CryptTableHexList.txt';
 //path:=edit3.text;

 if not fileexists(path) then
 begin
  showmessage('Wrong Way to the Hex Crypt Table!!! Check it and correct it!');
  exit;
 end;

 cryptTable.LoadFromFile(path);

 tmp:=Edit1.text;
 tmp:=stringreplace(tmp, ' ', '', [rfreplaceall,rfignorecase] ); //remove all spaces
 l:=length(tmp);  //get length of the hex String
 l:=l div 2;

 text:=Edit1.text;
  for i:=1 to l do  //convert the hex String to normal String:
  begin
    s:=Copy(text, 1, 2);
    edit2.Text:=edit2.Text+Chr(StrToInt('$' + s)); //convert one hex to string
    delete(text,1,3);
  end;
 //now we have in edit2.text the converted string!



//now the encrypting :)

 //get the last hex letter to find the key from crypt table:
 t:=length(edit1.text);
 tmp:=Copy(edit1.text, t-1, 2);



 //search for this letter in the crypt table to find the key!
 j:=0;
 keyfound:=0;
   for i:=0 to 199 do  //200 keys
   begin
     if tmp=cryptTable[j] then
      begin
       key:=i+1;
       keyfound:=keyfound+1;
 //encrypting: (i do it this way because there are some crypt keys the same, for example 29) it is in the 1 key Table and in 30
          memo1.lines.Add('encryptet with Key: '+inttostr(key));
              txt2:='';
              text:=Edit1.text;
              for i2:=1 to l do // get hex by hex ;D
              begin
               s:=Copy(text, 1, 2);  //the hex key
                 for t2:=0 to 255 do   //search the list for EVERY hex!!! so it could be slow with much text :/
                 begin
                   t3:=t2+j;
                   if s=cryptTable[t3] then
                   begin
                    getPos:=t2;
                    txt2:=txt2+chr(getPos);
                   end;
                 end;
               delete(text,1,3);    //delet this hex and look the next hex
               end;
       memo1.lines.add(txt2);
       j:=j+256;
      end
      else
      begin
       j:=j+256;
      end;
   end;


if keyfound=0 then
begin
Memo1.lines.add('Sorry No Key was Found :/');
Memo1.lines.add('Please check the last Key from your input hex String!');
end;


end;

As attachment is my full Hex Crypt Table.
And my Program to convert cryptet Hex String to normal Text.
(I add it so you don't need delphi to run it).

So that was a BIG post
Greets ^^
Attached Files
File Type: zip encrypter.zip (277.4 KB, 302 views)
File Type: txt CryptTableHexList.txt (200.0 KB, 186 views)
--- is offline  
Thanks
14 Users
Old 09/21/2007, 08:11   #6
 
syntex's Avatar
 
elite*gold: 46
Join Date: Mar 2006
Posts: 2,589
Received Thanks: 1,198
hmm wenn du die packets encrypten willst solltest du dir das Video bei Wikipedia angucken (AES128bit Flash Video)

Das wird dir dabei helfen ...
syntex is offline  
Old 09/21/2007, 09:46   #7
 
elite*gold: 0
Join Date: Apr 2007
Posts: 217
Received Thanks: 22
ich kenn das vid zwar net aba kannste das net per pm senden....sonst fängt jeder mit swapping an....wenn se es denn verstehen was ich bezweifel...
Aschebecha is offline  
Old 09/21/2007, 15:30   #8
 
elite*gold: 0
Join Date: Sep 2007
Posts: 56
Received Thanks: 21
danke syntex, für den tipp.
das AES ist aber für die int server die aktuele encrypt methode oder?
Weil das für standart privat server, wie man es dort encrypten kann hatte ich ja oben erklärt.
Ich hatte gedacht erstmal bisschen für privat server zu programmieren, weil man da kein problem hat mit irgendwelchen crypt methoden veränderungen ^^
Vielleicht hat der ein oder andere privat server mal ne andere crypt tabelle, welche man aber schnell bekommen kann und dafür nix umschreiben muss im programm.
aber es ist natürlich viel cooler etwas für den int server zu programmieren
ich werde mir das video auf jedenfall mal angucken und viel. überlege ich mir doch nochmal ob es nicht doch der int server sein sollte für den ich programmiere
--- is offline  
Old 09/21/2007, 16:09   #9
 
elite*gold: 0
Join Date: Jul 2007
Posts: 328
Received Thanks: 10
Sowas lob ich mir =).

6Posts und die sind sinnvoller als 90% von dem was in der Kal section geschrieben wurd!

Mach weiter so
Kyala is offline  
Old 09/22/2007, 01:06   #10
 
elite*gold: 0
Join Date: Aug 2007
Posts: 475
Received Thanks: 107
find ich auch gut.Sonst sind alles nur leecher oder so die immer nur dann was posten wenn die selber was brauchen,aber dafür nie was zurückgeben.
Ich habe zwar bis jetzt auch nicht gerade viel gepostet,und auch nur ein "Tut" gepostet..aber..jo...find ich klasse ---
SFX-Cookie is offline  
Old 09/22/2007, 09:26   #11
 
elite*gold: 0
Join Date: Feb 2006
Posts: 5
Received Thanks: 3
sieht ja ganz gut aus bis jetzt

wenn interesse besteht einen live-sniffer zu machen, würde ich gerne mitmachen.
hab schon etwas erfahrung mit C++ und libpcap (low level packet api).
speekky is offline  
Old 10/14/2007, 11:02   #12
 
elite*gold: 0
Join Date: Sep 2007
Posts: 69
Received Thanks: 0
damit kann ich jetz conifg.pks wieder verschlüsseln? :P
trullermann is offline  
Old 10/14/2007, 15:47   #13
 
elite*gold: 0
Join Date: Sep 2007
Posts: 56
Received Thanks: 21
mit dem Programm kannst du in erster linie eigentlich nur entschlüsseln, aber:
wenn du den quellcode verstanden hast, kannst du das ganz einfach umschreiben um auch daten wieder zu verschlüsseln.

es gibt glaube ich auch schon fertige tools die daten ver- und entschlüsseln können.
Swordcrypt oder so hieß eines. habe es aber selber nie getestet.
--- is offline  
Old 10/14/2007, 19:55   #14
 
elite*gold: 0
Join Date: Sep 2007
Posts: 69
Received Thanks: 0
ich habs ja gefunden fertige progamme aber nur für P server :P

und ich frage halt weil da ENcrypter steht also gegenteil von DEcrypter ^^
trullermann is offline  
Old 10/16/2007, 13:48   #15
 
elite*gold: 0
Join Date: Sep 2007
Posts: 69
Received Thanks: 0
weiß das keiner?
trullermann is offline  
Reply


Similar Threads Similar Threads
Encrypt/Decrypt
09/01/2010 - EO PServer Hosting - 9 Replies
Who can tell me how can i decrypt a password mage by the register page?:D
Encode Engine
02/04/2010 - Kal Online - 0 Replies
hey guys i have found server what i can hack money at it ... but there's a problem they deleted all Pup Merchent Items maybe i can add bombo keg agin by encoding the Config.pk3 can any one help me at this ?
encode/decode
08/13/2009 - Shaiya - 0 Replies
which program I can use to decode / encode the packet, someone knows?
frage zu packets
03/22/2009 - Guild Wars - 27 Replies
an den original server von guild wars ist es nicht möglich pakete zu senden, die hier von pablo24 gepostet wurden sind.. oder?
hey can any one encrypt
10/20/2007 - Kal Online - 1 Replies
hey can any one encrypt this jobsystem-e



All times are GMT +1. The time now is 01:12.


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