UnnPack a file and be able to see it! [Solved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

UnnPack a file and be able to see it! [Solved]

Post by Rook Zimbabwe »

OK I am playing with the PACK feature in PB. I can get a file to pack... easy... I look in the directory and it is there...

How can I UNpack it so it will exist?

Code: Select all

dir$ = GetCurrentDirectory() ;
 resource$ = dir$ +"TICKET.mdb"
 PACK$ = "TICKET.RES"
; ***********************************
; REMmed out AFTER I made pack file and unpack was UNremmed!
;
;CreatePack(PACK$)
;AddPackFile(resource$ ,1) ; 0 no compression to 9 HIGHEST  Compression
;ClosePack()

; ************************************
; UNremmed after file wsa made and pack routines were REMmed!
;
result = OpenPack(PACK$)
Debug "OPEN PACK FILE = "+Str(result)
For x = 0 To 2 ; I only have 1 file in the PACK but I thought I would count it!
result1 = NextPackFile()
Debug "PACK FILE "+Str(X)+" = "+Str(result1)
Next
ClosePack()

I run this on a program I packed and I see NOTHING!!!
Last edited by Rook Zimbabwe on Mon May 24, 2010 2:33 am, edited 1 time in total.
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Mohawk70
Enthusiast
Enthusiast
Posts: 404
Joined: Thu May 11, 2006 1:04 am
Location: Florida, USA

Re: UnnPack a file and be able to see it!

Post by Mohawk70 »

Rook Zimbabwe wrote:OK I am playing with the PACK feature in PB. I can get a file to pack... easy... I look in the directory and it is there...

How can I UNpack it so it will exist?

Code: Select all

dir$ = GetCurrentDirectory() ;
 resource$ = dir$ +"TICKET.mdb"
 PACK$ = "TICKET.RES"
; ***********************************
; REMmed out AFTER I made pack file and unpack was UNremmed!
;
;CreatePack(PACK$)
;AddPackFile(resource$ ,1) ; 0 no compression to 9 HIGHEST  Compression
;ClosePack()

; ************************************
; UNremmed after file wsa made and pack routines were REMmed!
;
If OpenPack(PACK$)
 npf = NextPackFile()
 pfs = PackFileSize()
 If npf
  If CreateFile(0,PACK$+".bak"); ;write to disk
   WriteData(0,npf,pfs)
   CloseFile(0)
  EndIf
EndIf
ClosePack()

I run this on a program I packed and I see NOTHING!!!
Code Ammended above !
Last edited by Mohawk70 on Mon May 24, 2010 4:04 am, edited 1 time in total.
HP Z800 Workstation
CPU : Dual Xeon 5690 3.46GHz
RAM : 192GB RAM
GPU : NVIDIA QUADRO P5000 16GB
User avatar
Rook Zimbabwe
Addict
Addict
Posts: 4322
Joined: Tue Jan 02, 2007 8:16 pm
Location: Cypress TX
Contact:

Re: UnnPack a file and be able to see it! [Solved]

Post by Rook Zimbabwe »

Thanks Mohawk... it worked after I done did the following:

Code: Select all

If npf
  If CreateFile(0,PACK$+".bak"); ;write to disk
   WriteData(0,npf,pfs) ; was cf,npf,pfs - I figure for MULTIUPLE files cf was correct!
   ; Pity you  cannot get pack file name from pack! But since they are YOUR files you should know
   ; whats going to come out!
   CloseFile(0)
  EndIf
EndIf
:mrgreen:
Binarily speaking... it takes 10 to Tango!!!

Image
http://www.bluemesapc.com/
Mohawk70
Enthusiast
Enthusiast
Posts: 404
Joined: Thu May 11, 2006 1:04 am
Location: Florida, USA

Re: UnnPack a file and be able to see it! [Solved]

Post by Mohawk70 »

cf was a typo - pulled just the relevant code from a program of mine and forgot to change to 0 ! :oops:
Rook Zimbabwe wrote: ; Pity you cannot get pack file name from pack! But since they are YOUR files you should know
; whats going to come out!
[/code]

:mrgreen:

Simple ...

To get filenames, simply create a text file with the list of filenames and make sure it's the first file added to the pack.
When unpacking, first extract the list file, open it and read each line for the filename before extracting the corresponding
file. You could even use a preferences file - filelist.txt - and include each file's name, size, hash, etc; like below

[File]
1=file1.txt
2=file2.txt
3=file3.txt
[Size]
1=256
2=512
3=768
[Hash]
1=ac328954
2=f0eebead
3=1234abcd


archive.pack would contain - in order
filelist.txt
file1.txt
file2.txt
file3.txt
HP Z800 Workstation
CPU : Dual Xeon 5690 3.46GHz
RAM : 192GB RAM
GPU : NVIDIA QUADRO P5000 16GB
jamba
Enthusiast
Enthusiast
Posts: 144
Joined: Fri Jan 15, 2010 2:03 pm
Location: Triad, NC
Contact:

Re: UnnPack a file and be able to see it! [Solved]

Post by jamba »

a little bit off-topic, but with the packer is it true that x86 and x64 versions of created pack files are not compatible? (different compression algorithm?)
-Jon

Fedora user
But I work with Win7
Post Reply