mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
Is it possible to extract a .ZIP file in pure mIRC script?

That is, Without using: COM, DLL, or any external program.... ? Is it hard?

Last edited by Biggles; 17/05/05 05:40 PM.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You need some form of extraction program (winzip/winrar for example). Those allow command-line extraction, so you can easily do it from within mIRC as long as one of those is installed.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
It's possible, but it'd be far too slow to be of any practical use.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
whats wrong with using an external program to do it? like ummm pkzip ?

Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
Ok hmm... Is there any other form of file/folder encryption that is much simpler than .zip then? This would be handling around 5mb file. And there would be folders and subfolders not just a single file here.

Really the objective for me, Is not to achieve a small compression, but merely to have the files and folders packaged into one single file, like a .zip, which I could extract with pure mIRC script.

Every time I type 'simple file compression' in google I get zip.

Edit: There is another criteria... The file packaging format must be reasonably popular, So that a user can package their files with a common windows or linux tool, and not with a mIRC script. So this rules out something like the 'vpak' script by variant. So we have compression with a 3rd party program, Decompression with pure mIRC script... But it's really about folder packaging not compression, I don't care if the end resulting file is a bit bigger than the original folder.

Joined: May 2005
Posts: 79
M
Babel fish
Offline
Babel fish
M
Joined: May 2005
Posts: 79
If he wanted to use an external program he would of done, why bother to go to the effort of creating a post which clearly states "mIRC script" sheesh mad

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
The point being that mIRC doesn't do compression. You need another program. Of course, you can always use any zip/rar program and make it create a self-extracting EXE. Then mIRC can simply run it.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
You can script it in pure mIRC script, I know mIRC doesnt have zip functions. You can create a .ZIP file with the mIRC binary functions if you understand the gzip format. This is what I was getting at.

Anyway I'm past this now,... I've moved on I realise ZIP isn't suitable, I'm looking for a simple folder/file packaging solution which fulfills the criteria layed out in my previous post. Thanks all for you help.

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
The zip file format [direct download link] isn't too complicated so parsing it shouldn't be a problem.
If you're saying it will be slow because zip files can get very large that's true for most applications.


New username: hixxy
Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
Quote:
The zip file format [direct download link] isn't too complicated so parsing it shouldn't be a problem.
If you're saying it will be slow because zip files can get very large that's true for most applications.


This sounds like it would make a good mirc scripting challenge on a website doesn't it, Too bad no websites do those anymore,

Joined: Jun 2003
Posts: 5,024
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Jun 2003
Posts: 5,024
Some do.

Lack of participation == lack of wanting to start one. smirk

Regards,


Mentality/Chris
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
If he wanted to use an external program he would of done, why bother to go to the effort of creating a post which clearly states "mIRC script" sheesh mad


At the time he had yet to make clear his full need, he could have simply had not known that pkzip can be run from command lines completely, no interface to deal with. Thus this direction of question can easily be an acceptable one. If someone had written a request that uses hashtables to store access levels, and you saw you can just assign ulevels to do the job, would it be wrong to say, even tho he said he wanted hashtables?

Even now with what he has said i cant really see a problem with using pkzip to do the job, just uses the zip file like a filesafe pass out each needed file, and pass in when finsihed with.

Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Parsing the format isn't the problem. The problem is actually doing something with what you're parsing. Zip files can contain encryption and various extensions, all of which would be far beyond what mIRC scripting could process in a remotely useful timescale. Even ignoring those extras, the basic decompression methods that aren't included as built-in mIRC identifiers (ie. those which don't use the standard DEFLATE algorithm) will be too slow to be useable.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
You're assuming that everyone has PKZip, which they don't. And AFAIK Winzip, which many more people would have (although by no means all), still doesn't include a decent command-line interface as standard.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Decent or not, it has one and if the command is scripted into his script, a user doesn't have to figure it out.

Still, like I mentioned, the person doing the compression can also use command line on winrar/winzip to compress file(s) into a self-extracting exe and then the receiver can simply /run it. And, if there's an issue with not wanting to send exe files because some people block them, you can have the sender rename the file to some other extension and the receiver can rename it to exe and then run it.

Example:

User 1: /run rar as files.ext outputfile.exe

*Note that I am not positive on the "s" switch for creating SFX.

User 1 then sends the file to User 2

User 2: /run outputfile.exe

Done.


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
Well, I'm really not interested in any old way to unzip files otherwise I could use necromans DLL and not bother with 3rd party programs that may or may not be installed on the users machine...

I should of been clearer about this in my initial post..

I'm really interested in the 'art' of pure mIRC script and doing this just for the heck of it... There are many ways to achieve the objective of unpacking a file, I'm not looking for the best or most efficient method. I'm interested in doing it this specific way, with pure mIRC code, even though it has no advantages.

I'm going to be reading documents and trying to get my head around all of this binary stuff, Its a bit beyond me and seems daunting, but I might learn something..

Thanks all for your feedback.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Heh. Well, that *does* change things for how we might respond. laugh

If you're doing this to challenge your scripting abilities, have fun. I'll leave pouring over compression routines to others. I have no interest in learning to do that which is easily done using other methods. I'd rather learn to do something that can't easily be done any other way. Still, that's just me... I don't have a lot of patience. laugh


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
Heh. Well, that *does* change things for how we might respond. laugh


Yes its a lot different with knowing hes after doing it for a challenge, I wouldnt have told him to use pkzip for a start, I cant amagine doing it in mirc script, I worked on a GIF compression/decompression code once becuase it was early days, before Jpeg really took hold, I didnt learn much about coding that time, but lernt that the people that think these compression schemes up must think on a whole differnt plane from the rest of us, i rember getting into it and thinking, omg whats this hashtable (not like mirc hashtables) with linked added results compounding to make the bitstream ment to mean ?!?!?!?!?!?! It made sence at the end, but i was like, who could have thought that up in there head?

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
With this script you can create and unpack cabinet (.CAB) files, using a couple of executables that exist on every modern Windows system. I hope the script includes sufficient documentation. If it doesn't, please post your questions here and I will answer them later.

Joined: Aug 2004
Posts: 24
B
Biggles Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Aug 2004
Posts: 24
This script uses COM and windows scripting host.

I want this to work for people who might be using mIRC under WINE, I do sometimes. Well thats just an example, Even if COM and WSH worked under wine I still want the extraction... Which is the main part, to be done in pure mirc script. wink

That is a good script though and would be useful to many people, But still an external element is doing the extraction there.

Page 1 of 2 1 2

Link Copied to Clipboard