Extract (partial) .zip content to memory rather disk ?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

Hello,

Using TC as zip tool to browse it, is there a way to extract/open (one file only) from the encrypted .zip content into memory instead in c:\Users\%USERNAME%\AppData\Local\Temp\_tc\ folder ?

Actually, I'd like to use an encrypted zip file (with password) to mimic tool like veracrypt or boxcryptor, or whatever... but, face problems :cry: :
- those tools (often) need admin rights (and sometimes, I didn't have them)
- and the extracted file(s) is(are) saved locally unencrypted on user's disk (I don't want for sure)

Any idea to do this ?
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Hacker »

Mjolnir,
Create a temporary ramdisk perhaps?
Would probably need admin rights, too, however.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

Yes, true, also thought about that, but admin rights are needed (I remember having done this couple of years ago) :(
... and, did not want to use other external tool off TC (+plugins)
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Dalai »

What do you intend to do with these extracted files? Probably use them in other programs. Opening files in another programs requires the files to be located in some kind of file-system. The only like a file-system thing in memory is a RAM disk. Even memory mapped files need to be somewhere...

The question is: What are you trying to achieve? If I understand your posts right, you open encrypted/protected archives on computers that you don't have full control over. I guess that's not a wise thing to do... Everything could be logged without anyone knowing about it.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

Dalai wrote: 2022-01-03, 15:49 UTC What do you intend to do with these extracted files? Probably use them in other programs. Opening files in another programs requires the files to be located in some kind of file-system. The only like a file-system thing in memory is a RAM disk. Even memory mapped files need to be somewhere...
Yes, that's it, you're right... ("Even memory mapped files need to be somewhere...")
Dalai wrote: 2022-01-03, 15:49 UTC The question is: What are you trying to achieve? If I understand your posts right, you open encrypted/protected archives on computers that you don't have full control over.
Exactly. I want to keep those files "private"... and letting TC extract .zip in user's temporary folder (& then delete it on close linked program) makes it unsecure (a "undelete" is quite easy to restor it)

Edit 2: well I'm trying to get a "more secure" extract/edit/close file from an encrypted .zip file, without having it written on user's disk & without using tools requiring admin right, within TC... ("just" images or .txt/.doc files, not full exe+dependencies files... )

Dalai wrote: 2022-01-03, 15:49 UTC I guess that's not a wise thing to do... Everything could be logged without anyone knowing about it.
Sorry did not get your point.
At worst, if the target exe program that open the (let's say) in ram file, it will only log the path + file name

Edit: or, maybe temporary WIP file written somewhere on disk... argh... didn't think about this...

---


Edit 3: as even the "F3" (quick view) from TC requires to extract the file to user's disk which I don't like/want

Edit 4: hey... makes me thinking of: could it be a "secure" "F3" (like a Crlt+Alt+Shift+F3+...) that open (one) file in memory, without extract file on disk ? (may I request such thing to the author or is it idiot ?)
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Gral »

I was not absolutely sure so did search for it...
viewtopic.php?p=279112#p279112
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

Gral wrote: 2022-01-03, 16:46 UTC I was not absolutely sure so did search for it...
viewtopic.php?p=279112#p279112
Good point, thank you ! Let me see/read that

Edit: the author's reponse is quite interresting:
ghisler(Author) wrote: 2014-02-11, 09:01 UTC Actually when TC unpacks files from an encrypted archive to TEMP, it overwrites it with all zeroes before deleting it. However, this isn't done when the ZIP itself is NOT encrypted, but located on an encrypted drive. In this case, you should put TEMP on an encrypted drive too.
Fact that extracted file (from an encrypted ZIP) is overwritten with all zeroes before delete is clever!
... and reading this make me think that engine used by TC to extract files from ZIP cannnot handle my "secure F3" idea :cry:
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Extract (partial) .zip content to memory rather disk ?

Post by *petermad »

2Mjolnir

Do you have permission to use a USB stick on those computers? if so, you can just start TC from a .bat file where you first change the location of the %TEMP% environment varibale to that USB stick before starting TC.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

2petermad

Unfortunately not have access... in same security way that I don't have access to "admin" rights :cry:
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Extract (partial) .zip content to memory rather disk ?

Post by *petermad »

2Mjolnir

Well, thats unfortunate. You could still redircet the %TEMP% variable to a folder with an obscure name, and then delete that folder afterwards. Then it will be pretty difficult for someone later to find and unerase your temporary data.

A .bat or .cmd file with a content like this:

Code: Select all

@ECHO OFF
SETLOCAL
MKDIR c:\abslkekfdfk
SET TEMP=c:\abslkekfdfk
ECHO.
ECHO Total Commander will be started.
ECHO.
ECHO Temporary directiory will be removed when Total Commander is closed.
ECHO.
ECHO Do NOT close this window manually!
c:\totalcmd\totalcmd64.exe
RMDIR /S /Q c:\abslkekfdfk
ENDLOCAL
Change the paths to fit your situation. I have testet it with a standard Windows user account.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Mjolnir
Member
Member
Posts: 131
Joined: 2005-10-08, 21:03 UTC

Re: Extract (partial) .zip content to memory rather disk ?

Post by *Mjolnir »

Following @petermad idea, here 2 TC buttons to dynamically change the TEMP folder & set it back (no admin rights seems needed!), combined with fact that extracted file (from an encrypted ZIP) is overwritten with all zeroes before delete :)


Set %TEMP% value to "c:\Temp" (one can change it to any what-you-want folder)

Code: Select all

TOTALCMD#BAR#DATA
SETX TEMP c:\Temp

shell32.dll,66
SETX TEMP c:\Temp (set)

1
-1
Reset back %TEMP% value to %TMP% value

Code: Select all

TOTALCMD#BAR#DATA
SETX TEMP %TMP%

shell32.dll,45
SETX TEMP %TMP% (restore)

1
-1


(optional button) to show %TEMP% content

Code: Select all

TOTALCMD#BAR#DATA
cmd /c echo Current TEMP is %TEMP% & PAUSE

shell32.dll,38
echo Current TEMP is %TEMP% (show)


-1
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
Post Reply