mpq-tools

Reaction score
341
Erm, I don't know.
Whatever my server is using, but I do know it's linux.

I'm using a hosting service, not my own computer.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
It'll probably be Ubuntu or Debain if your using a hosting service.
 

Samuraid

Advisor
Reaction score
81
I'd actually expect it to be RHEL or CentOS, most likely.

Anyway, as for the original question:
Yes, I've used mpq-tools, but by default, it doesn't allow extraction of files by name (only by number).

I'm pretty sure they added extraction-by-name support to the library recently, otherwise you'll need to port that functionality in from stormlib.

Also, you'll need to write your own front-end application, as libmpq is only a library. That site has an example front-end application, called mpq-extract, but from what I recall, it doesn't do a whole lot by default.
 
Reaction score
341
This is the contents of mpq-extract;
JASS:
.\" Copyright (c) 2003-2008 Maik Broemme <mbroemme@plusserver.de>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.TH mpq-tools 1 2008-02-10 "The MoPaQ archive library"
.SH NAME
mpq-extract \- utility to extract files of the given mopaq (mpq) archive.
.SH SYNOPSIS
.B mpq-extract
[options] [archive] [file...]
.SH DESCRIPTION
.PP
\fImpq-extract\fP is a simple utility to extract files of a given mpq archive.
.SH OPTIONS
.l
\fImpq-extract\fP accepts the following options:
.TP 8
.B  \-h|\-\-help
Print the usage message on the standard output.
.TP 8
.B  \-v|\-\-version
.ti 15
Print the currently installed version on the standard output.
.TP 8
.B  \-e|\-\-extract
.ti 15
Extract all files from the given mpq archive.
.TP 8
.B  \-l|\-\-list
.ti 15
List all files from the given mpq archive.
.SH SEE ALSO
\fBmpq-info\fR(1), \fBlibmpq-config\fR(1)
.SH AUTHOR
Check documentation.
.TP
libmpq is (c) 2003-2008
.B Maik Broemme <mbroemme@plusserver.de>
.PP
The above e-mail address can be used to send bug reports, feedbacks or library enhancements.


It says you should be able to extract by filename, but all my attempts failed.
Even if it can't, could you provide an example in php with exec()?

The website said to install it, and I did this;

PHP:
	$directory =  dirname(__FILE__).'/';
	$exec = exec($directory.'configure && make && make install');
	if (!$exec){die('error'.$exec);}
	echo $exec;

And it printed "checking for C compiler default output file name...". That's it. So is it installed?
 

Samuraid

Advisor
Reaction score
81
configure, make, and make install should all be run from the server's shell. If it is a VPS or dedicated machine, it should work if you are logged in as root. If you are on a shared hosting machine, it will not work. You will need to reconfigure using a prefix in your home directory.

Something like this:
Code:
./configure --prefix=/path/to/your/homedir/mpqtools
make
make install
 
Reaction score
341
Alright I got on with a chat technician for my hosting provider and he said I could not compile programs, but I can execute them. I have another program that supposedly handles mpq's (ralle said he uses it), but it has no documentation it's just a single file.

sfmpq_linux. Ever used it? I'm waiting on a PM from ralle for more info.

EDIT I just got ssh access.
 

Samuraid

Advisor
Reaction score
81
Run it, and read the usage statement:
Code:
LMPQDLL demo program v1.2 Copyright (c) 1999 Andrey V. Lelikov
This programs uses ShadowFlare MPQ API Library v1.07

                Usage:  sfmpq_linux <command> <archive_name> <file_names>
  Add or replace file:  sfmpq_linux a <archive_name> <file_name> <packed_name>
     Add uncompressed:  sfmpq_linux A <archive_name> <file_name> <packed_name>
          Delete file:  sfmpq_linux d <archive_name> <file_name>
         Extract file:  sfmpq_linux e <archive_name> <packed_name> [target_directory]
Extract with pathname:  sfmpq_linux x <archive_name> <packed_name> [target_directory]
        List archive :  sfmpq_linux l <archive_name> [listfile1] [listfile2] [...]

So, for example, extracting a file from an mpq to a directory would look like this:
Code:
sfmpq_linux e MyWarcraftMap.w3x war3map.w3i /home/myaccount/output_directory
 
Reaction score
341
Everytime I try to call it, I get a segfault error.

Segmentation fault (core dumped)

This is what mine looks like;

JASS:
  Add or replace file:  mpq a &lt;archive_name&gt; &lt;file_name&gt; &lt;packed_name&gt;
     Add uncompressed:  mpq A &lt;archive_name&gt; &lt;file_name&gt; &lt;packed_name&gt;
          Delete file:  mpq d &lt;archive_name&gt; &lt;file_name&gt;
         Extract file:  mpq e &lt;archive_name&gt; &lt;packed_name&gt; [target_directory]
Extract with pathname:  mpq x &lt;archive_name&gt; &lt;packed_name&gt; [target_directory]
        List archive :  mpq l &lt;archive_name&gt; [listfile1] [listfile2] [...]

        LMPQDLL demo program v1.2 Copyright (c) 1999 Andrey V. Lelikov


Maybe it's a fault with the one I am using. Would you mind sending me the one you have?
 

Samuraid

Advisor
Reaction score
81
Everytime I try to call it, I get a segfault error.



This is what mine looks like;

JASS:
  Add or replace file:  mpq a &lt;archive_name&gt; &lt;file_name&gt; &lt;packed_name&gt;
     Add uncompressed:  mpq A &lt;archive_name&gt; &lt;file_name&gt; &lt;packed_name&gt;
          Delete file:  mpq d &lt;archive_name&gt; &lt;file_name&gt;
         Extract file:  mpq e &lt;archive_name&gt; &lt;packed_name&gt; [target_directory]
Extract with pathname:  mpq x &lt;archive_name&gt; &lt;packed_name&gt; [target_directory]
        List archive :  mpq l &lt;archive_name&gt; [listfile1] [listfile2] [...]

        LMPQDLL demo program v1.2 Copyright (c) 1999 Andrey V. Lelikov


Maybe it's a fault with the one I am using. Would you mind sending me the one you have?
I don't have sfmpq_linux. I ran sfmpq_linux from one of Ralle's servers to get that message I posted.
The file he gave you should theoretically show the same results.
 
Reaction score
341
erm. You don't have any idea whats causing the problem?

EDIT: He didn't give me the file. I found it online but he said he used the same one.

I suppose I'll ask him for it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top