Hello,
I have found a function for joining (appending) files to binary files and other to extract it back ... multiple files can be added and then extracted by its "tag"

VB Code:
  1. Public Function AddEmbeddedFile(strSourceFile As String, strAddName As String, strDestinationFile As String) As Boolean
  2.    ' On Error GoTo handleError
  3.     Dim fileListStart As Long
  4.     Dim fileList As String
  5.     Dim lngFileSize As Long
  6.     Dim lngFilePos As Long
  7.     Dim lngCurPos As Long
  8.     Dim strCurFile As String
  9.     Dim iFreeFile As Integer
  10.     Dim oFreeFile As Integer
  11.     Dim fileData As String
  12.     If FileLen(strSourceFile) = 0 Then Exit Function
  13.     oFreeFile = FreeFile()
  14.     Open strDestinationFile For Binary As oFreeFile
  15.     Get oFreeFile, LOF(oFreeFile) - 3, fileListStart
  16.  
  17.     If fileListStart = 0 Then
  18.         fileListStart = LOF(oFreeFile) + 1
  19.         fileList = vbNullString
  20.     Else
  21.         fileList = String(LOF(oFreeFile) - fileListStart - 3, vbNullChar)
  22.         Get oFreeFile, fileListStart, fileList
  23.     End If
  24.     lngFilePos = fileListStart
  25.     lngFileSize = FileLen(strSourceFile)
  26.     iFreeFile = FreeFile()
  27.     Open strSourceFile For Binary As iFreeFile
  28.  
  29.  
  30.     If LOF(iFreeFile) > 1000000 Then
  31.         lngCurPos = -1000000
  32.         Do
  33.             lngCurPos = lngCurPos + 1000000
  34.             If lngCurPos + 999999 > LOF(iFreeFile) Then
  35.                 fileData = String(LOF(iFreeFile) - lngCurPos, vbNullChar)
  36.             Else
  37.                 fileData = String(1000000, vbNullChar)
  38.             End If
  39.             Get iFreeFile, lngCurPos, fileData
  40.             Put oFreeFile, fileListStart, fileData
  41.             fileListStart = fileListStart + Len(fileData) + 1
  42.         Loop Until lngCurPos + 999999 > LOF(iFreeFile)
  43.     Else
  44.         fileData = String$(LOF(iFreeFile), vbNullChar)
  45.         Get iFreeFile, 1, fileData
  46.         Put oFreeFile, fileListStart, fileData
  47.         fileListStart = fileListStart + Len(fileData) + 1
  48.     End If
  49.     Close iFreeFile
  50.     strAddName = strAddName & vbNullChar
  51.     Put oFreeFile, fileListStart, fileList
  52.     Put oFreeFile, fileListStart + Len(fileList), lngFilePos
  53.     Put oFreeFile, fileListStart + Len(fileList) + 4, lngFileSize
  54.     Put oFreeFile, fileListStart + Len(fileList) + 8, strAddName
  55.     Put oFreeFile, fileListStart + Len(fileList) + 12 + Len(strAddName), fileListStart
  56.     Close oFreeFile
  57.     AddEmbeddedFile = True
  58.     Exit Function
  59. handleError:
  60.     Close
  61.     AddEmbeddedFile = False
  62.     Exit Function
  63. End Function

and the other:

VB Code:
  1. Public Function ExtractEmbeddedFile(strFileName As String, strDestinationFile As String, Optional strSourceFile As String) As Boolean
  2.     On Error GoTo handleError
  3.     Dim fileListStart As Long
  4.     Dim lngFileSize As Long
  5.     Dim lngFilePos As Long
  6.     Dim lngCurPos As Long
  7.     Dim strCurFile As String
  8.     Dim iFreeFile As Integer
  9.     Dim oFreeFile As Integer
  10.     Dim fileData As String
  11.     iFreeFile = FreeFile()
  12.     If LenB(strSourceFile) = 0 Then strSourceFile = App.Path & "\" & App.EXEName & FILE_EXT
  13.     Open strSourceFile For Binary As iFreeFile
  14.     Get iFreeFile, LOF(iFreeFile) - 3, fileListStart
  15.  
  16.     If fileListStart = 0 Then
  17.         Close iFreeFile
  18.         Exit Function
  19.     End If
  20.  
  21.  
  22.     Do
  23.         Get iFreeFile, fileListStart, lngFilePos
  24.         fileListStart = fileListStart + 4
  25.         Get iFreeFile, fileListStart, lngFileSize
  26.         fileListStart = fileListStart + 4
  27.         strCurFile = String$(255, vbNullChar)
  28.         Get iFreeFile, fileListStart, strCurFile
  29.         If Mid$(strCurFile, 1, 1) = vbNullChar Then strCurFile = Mid$(strCurFile, 2)
  30.         strCurFile = Mid$(strCurFile, 1, InStr(1, strCurFile, vbNullChar) - 1)
  31.         fileListStart = fileListStart + Len(strCurFile) + 5
  32.  
  33.         If lngFilePos = 0 Or lngFileSize = 0 Or LenB(strCurFile) = 0 Then
  34.             Close iFreeFile
  35.             Exit Function
  36.         ElseIf strCurFile = strFileName Then
  37.             oFreeFile = FreeFile()
  38.             Open strDestinationFile For Binary As oFreeFile
  39.  
  40.             If lngFileSize > 1000000 Then
  41.                 lngCurPos = -1000000
  42.                 Do
  43.                     lngCurPos = lngCurPos + 1000000
  44.                     If lngCurPos + 1000000 > lngFileSize Then
  45.                         fileData = String$(lngFileSize - lngCurPos, vbNullChar)
  46.                     Else
  47.                         fileData = String$(1000000, vbNullChar)
  48.                     End If
  49.                     Get iFreeFile, lngCurPos + lngFilePos, fileData
  50.                     Put oFreeFile, lngCurPos + 1, fileData
  51.                 Loop Until lngCurPos + 999999 >= lngFileSize
  52.             Else
  53.                 fileData = String$(lngFileSize, vbNullChar)
  54.                 Get iFreeFile, lngFilePos, fileData
  55.                 Put oFreeFile, 1, fileData
  56.             End If
  57.             Close oFreeFile
  58.             Close iFreeFile
  59.             ExtractEmbeddedFile = True
  60.             Exit Function
  61.         End If
  62.     Loop Until fileListStart >= (LOF(iFreeFile) - 7)
  63.     Close iFreeFile
  64.     Exit Function
  65. handleError:
  66.     Close
  67.     ExtractEmbeddedFile = False
  68.     Exit Function
  69. End Function

the problem is that these two functions look quite inefficient to me and I am wondering if any of you have the code that has similar functionality...

thanks