Qazek Posted June 10, 2014 Author Share Posted June 10, 2014 Hello!I am looking for something what could secure my graphics from stealing I mean compression/encryption with password etc.I am using EO 3.0 with DirectX8. Link to comment Share on other sites More sharing options...
My Brave Shine Posted June 10, 2014 Share Posted June 10, 2014 is almost impossible. For this there terms of use. And being DX8 I think it makes it more difficult. Link to comment Share on other sites More sharing options...
Qazek Posted June 10, 2014 Author Share Posted June 10, 2014 I found this on my cd ;_;```Option Explicit'the following are for compression/decompressionPrivate Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)Private Declare Function compress Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As LongPrivate Declare Function compress2 Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long, ByVal level As Long) As LongPrivate Declare Function uncompress Lib "zlib.dll" (dest As Any, destLen As Any, src As Any, ByVal srcLen As Long) As Long'the following are for compression/decompressionDim lngCompressedSize As LongDim lngDecompressedSize As LongPublic Enum CZErrors 'for compression/decompression   Z_OK = 0   Z_STREAM_END = 1   Z_NEED_DICT = 2   Z_ERRNO = -1   Z_STREAM_ERROR = -2   Z_DATA_ERROR = -3   Z_MEM_ERROR = -4   Z_BUF_ERROR = -5   Z_VERSION_ERROR = -6End EnumPublic Enum CompressionLevels 'for compression/decompression   Z_NO_COMPRESSION = 0   Z_BEST_SPEED = 1   'note that levels 2-8 exist, too   Z_BEST_COMPRESSION = 9   Z_DEFAULT_COMPRESSION = -1End EnumPublic Property Get ValueCompressedSize() As Long   'size of an object after compression   ValueCompressedSize = lngCompressedSizeEnd PropertyPrivate Property Let ValueCompressedSize(ByVal New_ValueCompressedSize As Long)   lngCompressedSize = New_ValueCompressedSizeEnd PropertyPublic Property Get ValueDecompressedSize() As Long   'size of an object after decompression   ValueDecompressedSize = lngDecompressedSizeEnd PropertyPrivate Property Let ValueDecompressedSize(ByVal New_ValueDecompressedSize As Long)   lngDecompressedSize = New_ValueDecompressedSizeEnd PropertyPublic Function CompressByteArray(TheData() As Byte, CompressionLevel As Integer) As Long'compress a byte arrayDim lngResult As LongDim lngBufferSize As LongDim arrByteArray() As Byte   lngDecompressedSize = UBound(TheData) + 1   'Allocate memory for byte array   lngBufferSize = UBound(TheData) + 1   lngBufferSize = lngBufferSize + (lngBufferSize * 0.01) + 12   ReDim arrByteArray(lngBufferSize)   'Compress byte array (data)   lngResult = compress2(arrByteArray(0), lngBufferSize, TheData(0), UBound(TheData) + 1, CompressionLevel)   'Truncate to compressed size   ReDim Preserve TheData(lngBufferSize - 1)   CopyMemory TheData(0), arrByteArray(0), lngBufferSize   'Set property   lngCompressedSize = UBound(TheData) + 1   'return error code (if any)   CompressByteArray = lngResultEnd FunctionPublic Function CompressString(Text As String, CompressionLevel As Integer) As Long'compress a stringDim lngOrgSize As LongDim lngReturnValue As LongDim lngCmpSize As LongDim strTBuff As String   ValueDecompressedSize = Len(Text)   'Allocate string space for the buffers   lngOrgSize = Len(Text)   strTBuff = String(lngOrgSize + (lngOrgSize * 0.01) + 12, 0)   lngCmpSize = Len(strTBuff)   'Compress string (temporary string buffer) data   lngReturnValue = compress2(ByVal strTBuff, lngCmpSize, ByVal Text, Len(Text), CompressionLevel)   'Crop the string and set it to the actual string.   Text = Left$(strTBuff, lngCmpSize)   'Set compressed size of string.   ValueCompressedSize = lngCmpSize   'Cleanup   strTBuff = ""   'return error code (if any)   CompressString = lngReturnValueEnd FunctionPublic Function DecompressByteArray(TheData() As Byte, OriginalSize As Long) As Long'decompress a byte arrayDim lngResult As LongDim lngBufferSize As LongDim arrByteArray() As Byte   lngDecompressedSize = OriginalSize   lngCompressedSize = UBound(TheData) + 1   'Allocate memory for byte array   lngBufferSize = OriginalSize   lngBufferSize = lngBufferSize + (lngBufferSize * 0.01) + 12   ReDim arrByteArray(lngBufferSize)   'Decompress data   lngResult = uncompress(arrByteArray(0), lngBufferSize, TheData(0), UBound(TheData) + 1)   'Truncate buffer to compressed size   ReDim Preserve TheData(lngBufferSize - 1)   CopyMemory TheData(0), arrByteArray(0), lngBufferSize   'return error code (if any)   DecompressByteArray = lngResultEnd FunctionPublic Function DecompressString(Text As String, OriginalSize As Long) As Long'decompress a stringDim lngResult As LongDim lngCmpSize As LongDim strTBuff As String   'Allocate string space   strTBuff = String(ValueDecompressedSize + (ValueDecompressedSize * 0.01) + 12, 0)   lngCmpSize = Len(strTBuff)   ValueDecompressedSize = OriginalSize   'Decompress   lngResult = uncompress(ByVal strTBuff, lngCmpSize, ByVal Text, Len(Text))   'Make string the size of the uncompressed string   Text = Left$(strTBuff, lngCmpSize)   ValueCompressedSize = lngCmpSize   'return error code (if any)   DecompressString = lngResultEnd FunctionPublic Function CompressFile(FilePathIn As String, FilePathOut As String, CompressionLevel As Integer) As Long'compress a fileDim intNextFreeFile As IntegerDim TheBytes() As ByteDim lngResult As LongDim lngFileLen As Long   ' Along the way, we are gonna make it look professional and infom the user   ' Of the programs actions   lngFileLen = FileLen(FilePathIn)   'allocate byte array   ReDim TheBytes(lngFileLen - 1)   'read byte array from file   Close #10   intNextFreeFile = FreeFile '10 'FreeFile   Open FilePathIn For Binary Access Read As #intNextFreeFile       Get #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   'compress byte array   lngResult = CompressByteArray(TheBytes(), CompressionLevel)   'kill any file in place   On Error Resume Next   Kill FilePathOut   On Error GoTo 0   'Write it out   intNextFreeFile = FreeFile   Open FilePathOut For Binary Access Write As #intNextFreeFile       Put #intNextFreeFile, , lngFileLen 'must store the length of the original file       Put #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   Erase TheBytes   CompressFile = lngResultEnd FunctionPublic Function DecompressFile(FilePathIn As String, FilePathOut As String) As Long'decompress a fileDim intNextFreeFile As IntegerDim TheBytes() As ByteDim lngResult As LongDim lngFileLen As Long   'allocate byte array   ReDim TheBytes(FileLen(FilePathIn) - 1)   'read byte array from file   intNextFreeFile = FreeFile   Open FilePathIn For Binary Access Read As #intNextFreeFile       Get #intNextFreeFile, , lngFileLen 'the original (uncompressed) file's length       Get #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   'decompress   lngResult = DecompressByteArray(TheBytes(), lngFileLen)   'kill any file already there   On Error Resume Next   Kill FilePathOut   On Error GoTo 0   'Write it out   intNextFreeFile = FreeFile   Open FilePathOut For Binary Access Write As #intNextFreeFile       Put #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   Erase TheBytes   DecompressFile = lngResultEnd Function```And it works perfectly, but if anyone knows that algoritm, then he could easily decompress files. Link to comment Share on other sites More sharing options...
Ezemel Posted June 10, 2014 Share Posted June 10, 2014 Just copyright your graphics, if you're the owner, not rmvx/xp modifications of sprites, etc. Link to comment Share on other sites More sharing options...
Magdreamer Posted June 11, 2014 Share Posted June 11, 2014 I don't think that saying copyright your graphics solves anything. Everything done is copyrighted.If you want artists to work for you, you're going to have some sort of prevention method from easily stealing the art.Just as your composers would like you to protect their music and your programmers wouldn't like you handing out the source code with every client.Not everyone wants to have an open source game, and if you have to work on a game, you'd at least want the option. Link to comment Share on other sites More sharing options...
abhi2011 Posted June 11, 2014 Share Posted June 11, 2014 Create an encrypter. It's the best method Link to comment Share on other sites More sharing options...
xXaden Posted June 11, 2014 Share Posted June 11, 2014 i have a custom encryption engine for dx8 in fact the only one that does not lose transparentcy from .pngs. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted June 11, 2014 Share Posted June 11, 2014 Hmm, I'm not sure I understand how his would work… Couldn't you just press Prnt Scrn (print screen) button and get the images? So is there actually a way to protect them? Link to comment Share on other sites More sharing options...
Magdreamer Posted June 11, 2014 Share Posted June 11, 2014 The problem is the ease of accessing full sprite sheets that can be easily put into an open source engine.It's the same thing as someone having access to your programmer's coding and easily taking original systems like your guild system straight into their engine. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted June 11, 2014 Share Posted June 11, 2014 Yeah, I understand that, but as I said, I don't think you can protect against print screen, and that's and easy steal, I understand why this question is being asked, but I'm not sure you can fix it. Though, I think I remember seeing in some program once that when you used print screen, it just gave you a black or gray image over the area. I guess you could try that, maybe code something into the source for if Prnt Scrn is pressed and try to encode your images, but I'm pretty sure that's all you can do. Link to comment Share on other sites More sharing options...
Quackers Posted June 11, 2014 Share Posted June 11, 2014 Could Sue.. if you have Full Rights to the graphics Link to comment Share on other sites More sharing options...
xXaden Posted June 11, 2014 Share Posted June 11, 2014 umm yes you can control the print screen.. that is simply the clipboard. and if you clear the clipboard in a timer or loop while the programs open it will not work. and to be honest suing cost money, so unless you have money to put out first, you will have an uphill battle. you could also put the graphics inside a Resource file in vb6 and call it from there if you really wanted to protect it. Link to comment Share on other sites More sharing options...
PD Posted June 11, 2014 Share Posted June 11, 2014 > umm yes you can control the print screen.. that is simply the clipboard. and if you clear the clipboard in a timer or loop while the programs open it will not work. and to be honest suing cost money, so unless you have money to put out first, you will have an uphill battle. you could also put the graphics inside a Resource file in vb6 and call it from there if you really wanted to protect it.Instead of a loop just check for when the **PrtScr** key is pressed and then clear the clipboard. Resource files are a bad idea. First of all, resource files are compiled within the **.EXE** and if a resource file is massive you're just going to bloat the **.EXE**. Second of all, the resources within the resource file can be extracted.I would just grab an encryption algorithm, load a graphic file into a byte array, encrypt the byte array and then dump the byte array in a binary file. So load **test.PNG** into byte array, encrypt byte array and then dump byte array into **test.DAT**. After you've done that for all graphic files you can then delete all the graphic files and you'll be left with **.DAT** files.Then at runtime or whatever just load the **.DAT** files, decrypt them and then you could use the **CreateTextureFromFileInMemoryEx** function to allow DirectX 8 to use them. I imagine that it would be possible to extract the decrypted files from memory but that is going to be hard and this method will thwart most people. Link to comment Share on other sites More sharing options...
Helladen Posted June 11, 2014 Share Posted June 11, 2014 > Yeah, I understand that, but as I said, I don't think you can protect against print screen, and that's and easy steal, I understand why this question is being asked, but I'm not sure you can fix it. Though, I think I remember seeing in some program once that when you used print screen, it just gave you a black or gray image over the area. I guess you could try that, maybe code something into the source for if Prnt Scrn is pressed and try to encode your images, but I'm pretty sure that's all you can do.It's a lot easier to sue someone who steals graphics and music that are encrypted. Link to comment Share on other sites More sharing options...
JohnPony Posted June 12, 2014 Share Posted June 12, 2014 You guys are no better than companies like EA that put users through hell in order to protect their assets. I mean, blocking print screen! Are you kidding me???I despise you.inb4warning Link to comment Share on other sites More sharing options...
abhi2011 Posted June 12, 2014 Share Posted June 12, 2014 > First of all, resource files are compiled within the **.EXE**Actually they aren't. VB6 .res files can stand independent of the .exe> i have a custom encryption engine for dx8 in fact the only one that does not lose transparentcy from .pngs.What do you mean not lose transparency? I've created and encrypter for Both Nin and another game and they don't lose transparency. Link to comment Share on other sites More sharing options...
Mohenjo Daro Posted June 12, 2014 Share Posted June 12, 2014 > You guys are no better than companies like EA that put users through hell in order to protect their assets. I mean, blocking print screen! Are you kidding me???> > Â > > I despise you.> > Â > > inb4warningHey, we're just giving him suggestions, I couldn't care less if someone uses graphics, means they were good ones, I'd rather be asked but seeing how much stuff I "buy", I'm not one to hold an opinion, I'm just telling him how he can set this up, and making Prnt Scrn clear the clip board is just cruel. If you can make it so that the client is blocked out when it is pressed then that would be best. Link to comment Share on other sites More sharing options...
JohnPony Posted June 12, 2014 Share Posted June 12, 2014 > Hey, we're just giving him suggestions, I couldn't care less if someone uses graphics, means they were good ones, I'd rather be asked but seeing how much stuff I "buy", I'm not one to hold an opinion, I'm just telling him how he can set this up, and making Prnt Scrn clear the clip board is just cruel. If you can make it so that the client is blocked out when it is pressed then that would be best.Why go to such great lengths to protect the graphics? I mean, isn't it a sign of success to have others use your work, even if they do not have the rightful permission to do so? I don't believe having your graphics stolen would in any way, shape, or form damage the success of your title; I mean, could someone who cannot create graphical work of their own really compete with what your original product has to offer?Any attempt to secure digital work is futile. Software has already sustained enough damage from DRM employed by large corporations, and it truly saddens me that the indie community seems to be set on employing the same destructive tactics wherever possible. This is the stuff that makes people hate companies like Electronic Arts. Unfortunately, unlike large corporations, independent developers do not have the vast resources to hide the scars caused by these sort of things. OP, do not waste your time on this. Accept that people may want to use your work, and shun those who do use your work without your permission; however, don't make others suffer. Don't allow the majority to suffer due to the actions of a few bad apples. Link to comment Share on other sites More sharing options...
Qazek Posted June 12, 2014 Author Share Posted June 12, 2014 Blocking print screen is not good xDBut look at the code, here is Compressing file:```Public Function CompressFile(FilePathIn As String, FilePathOut As String, CompressionLevel As Integer) As Long'compress a fileDim intNextFreeFile As IntegerDim TheBytes() As ByteDim lngResult As LongDim lngFileLen As Long   ' Along the way, we are gonna make it look professional and infom the user   ' Of the programs actions   lngFileLen = FileLen(FilePathIn)   'allocate byte array   ReDim TheBytes(lngFileLen - 1)   'read byte array from file   Close #10   intNextFreeFile = FreeFile '10 'FreeFile   Open FilePathIn For Binary Access Read As #intNextFreeFile       Get #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   'compress byte array   lngResult = CompressByteArray(TheBytes(), CompressionLevel)   'kill any file in place   On Error Resume Next   Kill FilePathOut   On Error GoTo 0   'Write it out   intNextFreeFile = FreeFile   Open FilePathOut For Binary Access Write As #intNextFreeFile       Put #intNextFreeFile, , lngFileLen 'must store the length of the original file       Put #intNextFreeFile, , TheBytes()   Close #intNextFreeFile   Erase TheBytes   CompressFile = lngResultEnd Function```And it works with EO and DX8 (tested), but only what I want is to change anything in this function to make my files more difficult to decompress using DecompressFile function. I never worked on a files like that so it's new experience for me ^^ Link to comment Share on other sites More sharing options...
Magdreamer Posted June 12, 2014 Share Posted June 12, 2014 Just because it's possible to steal art, doesn't mean you make it easy.Most of the people who would steal your art, couldn't make a game even if they wanted to.You make it hard as an assurance to your artists that their work will not be released into the public domain the moment you release the game.Imagine you're a programmer and the moment you release the first alpha of your brand new game, some guy takes your source code and makes another game project stemming from your code. Link to comment Share on other sites More sharing options...
abhi2011 Posted June 12, 2014 Share Posted June 12, 2014 Compression isn't encryption. It isn't protection. If you want to protect your graphics create an encrypter or have one made for you. Link to comment Share on other sites More sharing options...
Qazek Posted June 12, 2014 Author Share Posted June 12, 2014 Ok, got it :D Thanks for help :) Link to comment Share on other sites More sharing options...
JohnPony Posted June 12, 2014 Share Posted June 12, 2014 > Just because it's possible to steal art, doesn't mean you make it easy.> > Most of the people who would steal your art, couldn't make a game even if they wanted to.> > You make it hard as an assurance to your artists that their work will not be released into the public domain the moment you release the game.> > Imagine you're a programmer and the moment you release the first alpha of your brand new game, some guy takes your source code and makes another game project stemming from your code.And by making it difficult, which has clearly been proven to be futile by the attempts of many large AAA developers, you usually hinder the user's experience. I believe that you defeated your own argument in your second sentence; as I've stated before, any person that must resort to stealing art either wants something to use as a placeholder or is all-round incompetent and not a threat to your production.The same goes with programming; the most we can ever do is obfuscate the code if it's an interpreted language; if it's a compiled language, we can only hope that the person doesn't take the time to study the machine code in order to make a replication.Any artist that needs assurance that their work will not be released into the public domain needs to learn about licensing, and any artist that needs assurance that their work will not be leaked or used illegally needs a mental institution. Link to comment Share on other sites More sharing options...
PVJsquad Posted June 15, 2014 Share Posted June 15, 2014 try to use zlib.dll Link to comment Share on other sites More sharing options...
abhi2011 Posted June 18, 2014 Share Posted June 18, 2014 > try to use zlib.dllCompression won't protect the images. If anyone knows which compression algo you used they could just as easily decompress your textures. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now