Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

How can I protect bmp files ?


jancobblepot
 Share

Recommended Posts

Hello!

We are about to release a game that we are developing since a couple of weeks ago. The problem is that we need a way to protect our GFX files (.bmp).

One of the ways  that I knew was to encrypt the GFX pics with password with "bpm utils.exe", but I have no idea how to make it recognize in the source. I dont know another way to encode the images so that users can not steal them.

If anyone can help me or give me any idea, I will thank you.

PD : My english is terrible, I know.
Link to comment
Share on other sites

You can't.
Just stop being selfish and let people steal your stuff >.>

lol, I'm kidding there. But it's actually true.
There isn't really a way to encrypt your file without doing heavy work with the source to decrypt them.

Although, if you ever see someone use your graphic here, you can report them and the admin can do the rest.

And beside, if I want to steal your graphic and you encrypt it, I can still steal it when the client decrypt the graphic to use with DirectX. Don't worry, just release your game. Not many people will steal the graphic. Even if they did, they're not gonna use it for it to make games like the one in Eclipse, I mean, they would just get caught.

This is just my opinion. If someone else know how to implement a graphic encryption, go for it.

Sincerely,
Rithy
Link to comment
Share on other sites

  • 2 weeks later...
[http://support.microsoft.com/default.aspx/kb/821762](http://support.microsoft.com/default.aspx/kb/821762)

Basically….. you make a program to encrypt them
then when reading from them you grab the file as a string from a .dat or similar
decrypt the string
then you should be able to re-save as a picture type ( don't remember if that exists in vb6)
and change ALL  (yes all) of the gfx refrences

or you could stream it
Link to comment
Share on other sites

  • 3 weeks later...
You can incorporate all of your graphics and sounds directly into the EXE and encrypt them by using Molebox Ultra. PLUS, there is no visible decryption. It's super Duper.

Better start saving your allowance, because the only way you can get it (that i can say of <_<) is by buying it =D and it's not cheap ^_^

I use it, and I believe it actually makes little speed difference, if not better. That and you can also compress them so you're whole game folder is smaller.
Link to comment
Share on other sites

Ok, heres some Graphic/File Encryption code :)

```
Public FileData() As Byte
Public FileData2() As Byte
Public ToByte As Long

Private Sub EnCrypt(FileName As String)
  F = FreeFile
  Open FileName For Binary As F

  ReDim FileData(LOF(F) - 1)
  ReDim FileData2(LOF(F) - 1)
  Get F, 1, FileData
  FileData2 = FileData

  ToByte = IIf(UBound(FileData) < 2050, UBound(FileData) / 3, 1024)

  For i = 0 To ToByte
    FileData(i) = FileData2(UBound(FileData) - i)
  Next
  For i = 0 To ToByte
    FileData(UBound(FileData) - i) = FileData2(i)
  Next

  Put F, 1, FileData
  Close F
End Sub

Private Sub DeCrypt(FileName As String)
  F = FreeFile
  Open FileName For Binary As F

  ReDim FileData(LOF(F) - 1)
  ReDim FileData2(LOF(F) - 1)
  Get F, 1, FileData
  FileData2 = FileData

  ToByte = IIf(UBound(FileData) < 2050, UBound(FileData) / 3, 1024)

  For i = 0 To ToByte
    FileData(i) = FileData2(UBound(FileData) - i)
  Next
  For i = 0 To ToByte
    FileData(UBound(FileData) - i) = FileData2(i)
  Next

  Put F, 1, FileData
  Close F
End Sub

```
Heres an example of use:

In Sub Init Surface's There is :

```
    ' Init sprite ddsd type and load the bitmap
    DDSD_Sprite.lFlags = DDSD_CAPS
    DDSD_Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY
    Set DD_SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\Sprites.bmp", DDSD_Sprite)
    SetMaskColorFromPixel DD_SpriteSurf, 0, 0

```
Make it like

```
    ' Init sprite ddsd type and load the bitmap
    DDSD_Sprite.lFlags = DDSD_CAPS
    DDSD_Sprite.ddsCaps.lCaps = DDSCAPS_SYSTEMMEMORY
    Call Decrypt(App.path & "\GFX\Sprites.bmp")
    Set DD_SpriteSurf = DD.CreateSurfaceFromFile(App.Path & "\GFX\Sprites.bmp", DDSD_Sprite)
    Call Encrypt(App.path & "\GFX\Sprites.bmp")
    SetMaskColorFromPixel DD_SpriteSurf, 0, 0

```
And do that for all the other ones
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...