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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top