No entiendo completamente lo que decís.
CREO que la manera de cifrar las imagenes es similar (no igual) a esta:
Private Declare Function compress Lib "zlib.dll" (dest As Any, destlen As Any, Src As Any, ByVal srclen As Long) As Long
Private Declare Function uncompress Lib "zlib.dll" (dest As Any, destlen As Any, Src As Any, ByVal srclen As Long) As Long
Public Function Compress_Files(ByRef SourcePath As String, ByRef OutputPath As String, ByVal version As Long, ByRef prgBar As ProgressBar, ByVal NameFile As String, Optional ByRef Extension As String = ".bmp") As Boolean
'*****************************************************************
'Author: Nicolas Matias Gonzalez (NIGO)
'Last Modify Date: 08/19/2007
'Compresses all graphic files to a resource file
'*****************************************************************
Dim SourceFileName As String
Dim OutputFilePath As String
Dim SourceFile As Long
Dim OutputFile As Long
Dim SourceData() As Byte
Dim FileHead As FILEHEADER
Dim InfoHead() As INFOHEADER
Dim loopc As Long
'On Local Error GoTo ErrHandler
OutputFilePath = OutputPath & NameFile
SourceFileName = Dir(SourcePath & "*" & Extension, vbNormal)
' Create list of all files to be compressed
While SourceFileName <> ""
FileHead.lngNumFiles = FileHead.lngNumFiles + 1
ReDim Preserve InfoHead(FileHead.lngNumFiles - 1)
InfoHead(FileHead.lngNumFiles - 1).strFileName = UCase$(SourceFileName)
#If SeguridadAlkon Then
'We want the list ordered considering encryption
Call Secure_Info_Header(InfoHead(FileHead.lngNumFiles - 1))
#End If
'Search new file
SourceFileName = Dir()
Wend
If FileHead.lngNumFiles = 0 Then
MsgBox "No se encontraron archivos de extención " & GRH_SOURCE_FILE_EXT & " en " & SourcePath & ".", , "Error"
Exit Function
End If
If Not prgBar Is Nothing Then
prgBar.max = FileHead.lngNumFiles
prgBar.Value = 0
End If
'Destroy file if it previuosly existed
If Dir(OutputFilePath, vbNormal) <> "" Then
Kill OutputFilePath
End If
'Finish setting the FileHeader data
FileHead.lngFileVersion = version
FileHead.lngFileSize = Len(FileHead) + FileHead.lngNumFiles * Len(InfoHead(0))
'Order the InfoHeads
Call Sort_Info_Headers(InfoHead(), 0, FileHead.lngNumFiles - 1)
'Open a new file
OutputFile = FreeFile()
Open OutputFilePath For Binary Access Read Write As OutputFile
' Move to the end of the headers, where the file data will actually start
Seek OutputFile, FileHead.lngFileSize + 1
' Process every file!
For loopc = 0 To FileHead.lngNumFiles - 1
#If SeguridadAlkon Then
Call Secure_Info_Header(InfoHead(loopc))
#End If
SourceFile = FreeFile()
Open SourcePath & InfoHead(loopc).strFileName For Binary Access Read Lock Write As SourceFile
'Find out how large the file is and resize the data array appropriately
InfoHead(loopc).lngFileSizeUncompressed = LOF(SourceFile)
ReDim SourceData(LOF(SourceFile) - 1)
'Get the data from the file
Get SourceFile, , SourceData
'Compress it
Call Compress_Data(SourceData)
'Store it in the resource file
Put OutputFile, , SourceData
With InfoHead(loopc)
'Set up the info headers
.lngFileSize = UBound(SourceData) + 1
.lngFileStart = FileHead.lngFileSize + 1
'Update the file header
FileHead.lngFileSize = FileHead.lngFileSize + .lngFileSize
End With
#If SeguridadAlkon Then
Call Secure_Info_Header(InfoHead(loopc))
#End If
Erase SourceData
Close SourceFile
'Update progress bar
If Not prgBar Is Nothing Then prgBar.Value = prgBar.Value + 1
DoEvents
Next loopc
#If SeguridadAlkon Then
Call Secure_File_Header(FileHead)
#End If
'Store the headers in the file
Seek OutputFile, 1
Put OutputFile, , FileHead
Put OutputFile, , InfoHead
'Close the file
Close OutputFile
Erase InfoHead
Erase SourceData
Compress_Files = True
Exit Function
ErrHandler:
Erase SourceData
Erase InfoHead
Close OutputFile
Call MsgBox("No se pudo crear el archivo binario. Razón: " & Err.Number & " : " & Err.Description, vbOKOnly, "Error")
End Function
Private Sub Compress_Data(ByRef data() As Byte)
'*****************************************************************
'Author: Juan Martín Dotuyo Dodero
'Last Modify Date: 10/13/2004
'Compresses binary data avoiding data loses
'*****************************************************************
Dim Dimensions As Long
Dim DimBuffer As Long
Dim BufTemp() As Byte
Dim loopc As Long
Dimensions = UBound(data) + 1
' The worst case scenario, compressed info is 1.06 times the original - see zlib's doc for more info.
DimBuffer = Dimensions * 1.06
ReDim BufTemp(DimBuffer)
Call compress(BufTemp(0), DimBuffer, data(0), Dimensions)
Erase data
ReDim data(DimBuffer - 1)
ReDim Preserve BufTemp(DimBuffer - 1)
Call EncriptacionMaTeO(BufTemp)
data = BufTemp
Erase BufTemp
#If SeguridadAlkon Then
Call Secure_Compressed_Data(data)
#End If
End Sub
El juego debe hacer la carga del grafico, que son imagenes separadas.
este es un movimiento de los cientos que tiene el juego para cada objeto:
Lo que yo intento hacer es 'extraer' digamos, de ese archivo comprimido, las imagenes que se utilizan adentro del juego.