Город Джунов
Mob Script Encryption Algorithm - Версия для печати

+- Город Джунов (https://www.gipat.ru/forum)
+-- Форум English-speaking Diaspora (https://www.gipat.ru/forum/forum-22.html)
+--- Форум News and Announcements (https://www.gipat.ru/forum/forum-16.html)
+--- Темы: Mob Script Encryption Algorithm (/thread-1811.html)



Mob Script Encryption Algorithm - Jet - 19.02.2004

Today we have published the MOB script encryption algorithm.

You can get C++ and Delphi source codes from downloads section.
-> Downloads -> Tools -> Mod -> Mob Crypt


Mob Script Encryption Algorithm - Guest - 24.02.2004

can you explain to us don't understanding anything ofit what it is/do(/mean?)


Mob Script Encryption Algorithm - CAHEK7 - 25.02.2004

It is Mob Script Encryption Algorithm. And first you must write a programm and use this Algorithm. If you can do it, you also can read scripts in *.mob files.
Sorry if i something wrong, my english is bad...


Mob Script Encryption Algorithm - Guest - 27.02.2004

so you need to be able to program to make this, whatever it is work? Smile



i hope someone makes one Tongue


Mob Script Encryption Algorithm - Guest - 27.02.2004

maybe I can convince someone to do that for me (if I can you shouldnt socks up to me because I hate that). I have my friends Big Grin


Mob Script Encryption Algorithm - Jet - 29.02.2004

Visual Basic code:
Translated by CAHEK7
Код:
Public Sub ScriptCrypt(ByRef Script() As Byte, ByVal Key As Long)

Dim Tmp As Double
Dim i As Long
Dim TmpLng As Long
Tmp = Key

For i = 0 To UBound(Script)

  Tmp = Tmp * 214013 + 2531011
'-------------------------------------------------
     Do While Tmp > 2199023255552#
       Tmp = Tmp - 2199023255552#
     Loop
     Do While Tmp > 274877906944#
       Tmp = Tmp - 274877906944#
     Loop
     Do While Tmp > 34359738368#
       Tmp = Tmp - 34359738368#
     Loop
     Do While Tmp > 4294967296#
       Tmp = Tmp - 4294967296#
     Loop
' Especially to convert Double to DWORD
' you can change number of cycles
' to change up execution speed
'-------------------------------------------------

  TmpLng = CLng(Int(Tmp / 65536))
  TmpLng = TmpLng Mod 256
 
  Script(i) = Script(i) Xor CByte(TmpLng)

Next

End Sub

C# Code:
Код:
public string ReadCodedString()
{
byte[] coded = new byte[DataSize - 4];     // sizeof(coded string) - sizeof(key)
char[] decoded = new char[coded.Length];
uint uKey;

// Read
uKey   = orStream.ReadUInt32();           // KEY
coded = orStream.ReadBytes(coded.Length); // Coded string

// Decode string
for(int i = 0; i < coded.Length; i++)
{
  uKey = uKey * 214013 + 2531011;
  decoded[i] = Convert.ToChar(coded[i] ^ Convert.ToByte(uKey / 65536 % 256));
}
return new string(decoded, 0, decoded.Length );
}
Rolleyes


Mob Script Encryption Algorithm - MortalMachine - 28.10.2005

I understand something in Visual Basic, but I want to see examples of scripst used in a quest.


Mob Script Encryption Algorithm - Jet - 28.10.2005

MortalMachine,Пятница, 28 Октября 2005, 07:53 Написал:I understand something in Visual Basic, but I want to see examples of scripst used in a quest.
[right][snapback]35976[/snapback][/right]
You can use MRT to check one.
Open an .mob then expand filed ID_OBJECT_FILE.
ID_SS_TEXT <- Here is a script used by .mob
Type of this filed is SCRIPT_ENC mean tats script kept in enconded format.
CAHEK7 post algorithm how to to decode encoded script using VB.

Here is script example for zone7chest.mob.
Код:
GlobalVars (
 NULL : object,
 VSS#i#val : object,
 i : object,
 AChest : object
)

DeclareScript VCheck#3#1 (  this : object )
DeclareScript VTriger#3#2 (  this : object )

Script VCheck#3#1
(
 if
 (
   Not( IsEqual( GSGetVar( 0, "q.gz7g.q9g" ) , 2 )  )
   IsEqual( GetLeverState( AChest ) , 1 )
 )
 then
 (
   KillScript(  )
   VTriger#3#2( this )
 )
)

Script VTriger#3#2
(
 if
 (
 )
 then
 (
   KillScript(  )
   GSSetVarMax( 0, "q.gz7g.q9g.2", 2 )
   GSSetVarMax( 0, "q.gz7g.q9g", 2 )
   GiveQuestItem( 0, "OrcLicense00" )
 )
)

WorldScript
(
 Sleep( 2 )
 AChest = GetObjectByID( "1000252" )
 VCheck#3#1( NULL )
)



Mob Script Encryption Algorithm - KnightL - 31.10.2005

And where did you get this code. If you wrote it by yourself you would write your own program. If you didn`t write it then how did you translated it into basic.


Mob Script Encryption Algorithm - MortalMachine - 01.11.2005

The problem about creating your own program is to have the Visual Basic, I have Microsoft Visual Basic 2005 Express Edition Beta 2, but I can't compile into a .exe program, to do that you need to buy it, and it cost toons of money Sad
btw, I've made lots of programs B) , I make them for fun, but I'm not a master in Visual Basic.


Mob Script Encryption Algorithm - SexyGirl - 21.08.2019

There are 1 very interesting fact - zone20 and zonemainmenu uses script format with another signature. Anybody can read that script with simple text editor. And, if i understood this moment clean... This script is read faster, because it does not need to be decrypted by the game.exe until zone loads.