Сообщений: 1,100
Тем: 157
Зарегистрирован: Feb 2002
19.02.2004, 00:38
(Сообщение последний раз редактировалось: 19.02.2004, 00:39 Jet.)
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
can you explain to us don't understanding anything ofit what it is/do(/mean?)
Сообщений: 214
Тем: 5
Зарегистрирован: Mar 2003
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...
Что есть то есть, того что было не вернуть, не изменить ни дня.
Черный Обелиск "Дом желтого сна (часть 2)"
Сообщений: 1,100
Тем: 157
Зарегистрирован: Feb 2002
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 );
}
Сообщений: 7
Тем: 0
Зарегистрирован: Oct 2005
I understand something in Visual Basic, but I want to see examples of scripst used in a quest.
I'm not afraid of anything
I just need to know that I can breathe
Сообщений: 1,100
Тем: 157
Зарегистрирован: Feb 2002
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 )
)
Сообщений: 207
Тем: 4
Зарегистрирован: Jun 2004
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.
Сообщений: 7
Тем: 0
Зарегистрирован: Oct 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
btw, I've made lots of programs B) , I make them for fun, but I'm not a master in Visual Basic.
I'm not afraid of anything
I just need to know that I can breathe
Сообщений: 17
Тем: 3
Зарегистрирован: Aug 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.