Encrypting textures

From VbGORE Visual Basic Online RPG Engine

This feature is for encrypt VbGore graphics.

Step One

Open ToolFileProcessor.exe In this tutorial I will use RC4 Algorithim so select the Algorithim RC4, put the key and the altered extension. The Unaltered Extension and Sub-Folder will be the default ("PNG" and "Grh\").

Encryptgraphics1.PNG

Click on "Compress / Encrypt"

Step Two

Open GameClient.vbp

In TileEngine>Sub Engine_Init_Texture, declare

<vb> Dim TempFile as String </vb>

Replace this: <vb>

  'Get the path
   FilePath = GrhPath & TextureNum & ".png"
   
   'Check if the texture exists
   If Engine_FileExist(FilePath, vbNormal) = False Then
       MsgBox "Error! Could not find the following texture file:" & vbNewLine & FilePath, vbOKOnly
       IsUnloading = 1
       Exit Sub
   End If

</vb>

To this: <vb>

       'Get the path
   TempFile = GrhPath & TextureNum & ".enc" '<<<<PUT THE ALTERED EXTENSION
   FilePath = GrhPath & TextureNum & ".png"
  
  
   'Check if the texture exists
   If Engine_FileExist(TempFile, vbNormal) = False Then
       MsgBox "Error! Could not find the following texture file:" & vbNewLine & TempFile, vbOKOnly
       IsUnloading = 1
       Exit Sub
   End If
  
   'Decrypt the file
   Encryption_RC4_DecryptFile TempFile, FilePath, "key" '<<<<PUT THE ENCRYPT KEY

</vb>

After End Sub Add <vb> Kill FilePath </vb>


Example Image:

Encryptgraphics2.PNG


Now go to TileEngine>Sub Engine_Init_ParticleEngine then Replace the whole thing with this:

<vb> Sub Engine_Init_ParticleEngine(Optional ByVal SkipToTextures As Boolean = False) '***************************************************************** 'Loads all particles into memory - unlike normal textures, these stay in memory. This isn't 'done for any reason in particular, they just use so little memory since they are so small 'More info: http://www.vbgore.com/GameClient.TileEngine.Engine_Init_ParticleEngine '***************************************************************** Dim i As Byte Dim TempPart As String Dim FilePart As String

   If Not SkipToTextures Then
   
       'Set the particles texture
       NumEffects = Var_Get(DataPath & "Game.ini", "INIT", "NumEffects")
       ReDim Effect(1 To NumEffects)
   
   End If
   
   For i = 1 To UBound(ParticleTexture())
       TempPart = GrhPath & "p" & i & ".enc"
       FilePart = GrhPath & "p" & i & ".png"
       Encryption_RC4_DecryptFile TempPart, FilePart, "key" '<<<<<<PUT YOUR KEY HERE
   
       If ParticleTexture(i) Is Nothing Then Set ParticleTexture(i) = Nothing
       Set ParticleTexture(i) = D3DX.CreateTextureFromFileEx(D3DDevice, FilePart, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_FILTER_POINT, D3DX_FILTER_POINT, &HFF000000, ByVal 0, ByVal 0)
   Next i

End Sub </vb>

Decrypt Particles Created by DjMaddius

Special Thanks to onez0r

Personal tools