More Awesome Than You!
Welcome, Guest. Please login or register.
2024 November 21, 16:39:47

Login with username, password and session length
Search:     Advanced search
540287 Posts in 18067 Topics by 6545 Members
Latest Member: cincinancy
* Home Help Search Login Register
+  More Awesome Than You!
|-+  The Bowels of Trogdor
| |-+  The Small Intestines of Trogdor
| | |-+  dz utils: core tools for packages
0 Members and 3 Chinese Bots are viewing this topic. « previous next »
Pages: [1] THANKS THIS IS GREAT Print
Author Topic: dz utils: core tools for packages  (Read 19669 times)
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
dz utils: core tools for packages
« on: 2007 January 02, 11:00:44 »
THANKS THIS IS GREAT

Here's a tool set for command line modders:

Today's addition: a simple hex editor...

ls: list contents of a package
extract: dump all or portions of a package to .dat files
create: create a new (blank) package file
append: add a .dat file's data to a package
xed: a simple hex editor

* dz_utils01-04.zip (17.28 KB - downloaded 667 times.)
* dz_utils-src01-04.zip (10.28 KB - downloaded 694 times.)
« Last Edit: 2007 January 04, 08:06:44 by dizzy » Logged

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: dz utils: core tools for packages
« Reply #1 on: 2007 January 03, 02:30:30 »
THANKS THIS IS GREAT

Interesting. What would be nice if we had something that was able to read a package, load its entire contents into memory, presumbly for something in the future that would then be able to display, edit, and generally doctor its contents, and then write it back out. The business of reading packages seem to be largely the same as it was in the old disasims code which I adapted into hackdiffing (which right now is able to load a single item, and perform an agnostic md5sum on it for comparison), but we still don't have anything that is able to take a package, load it into memories, and then spit it back out intact (and hopefully recompressed). Even SimPE at present seems to have bugs in recompressing certain things.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: dz utils: core tools for packages
« Reply #2 on: 2007 January 03, 08:46:17 »
THANKS THIS IS GREAT

SimPE performs compression? Why in the world would you compress with only the ability to do the EA half-ass substitution method?
Logged

jrd
Terrible Twerp
****
Posts: 2498



View Profile
Re: dz utils: core tools for packages
« Reply #3 on: 2007 January 03, 08:59:12 »
THANKS THIS IS GREAT

Filesize? I compress all text-based resources (including BCONs, BHAVs, Pie Menus) and it saves a lot of space. My "mascot clothes hider" is decreased in size almost ten-times by compression.
Logged
J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: dz utils: core tools for packages
« Reply #4 on: 2007 February 15, 02:48:44 »
THANKS THIS IS GREAT

Does this business handle compressed archives yet? I'm still trying to decipher what exactly should happen if you were to, say, edit a resources. Some sort of demonstration somewhere of how it would work to load a package into some kind of memory representation and then write it back out would be nice. Extracting and appending is rather limiting and awkward, and would undoubtedly produce something that ran like a dog if everytime you edited a resource, the entire package had to be extracted that way and then recomposited by appendation one at a time.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: dz utils: core tools for packages
« Reply #5 on: 2007 February 15, 03:00:27 »
THANKS THIS IS GREAT

The extract tool handles unpacking. I don't support packing.

Well, the editing portion of the toolset hasn't even been grokked yet. I proposed using a Lua/sed type tool, but you seem to have something else in mind.

Extracting and appending is no different from when you hit "Commit" and "Save" in SimPE, it just uses virtual memory instead of writing to a file (six vs half a dozen, IMHO).

If you want the editor tool to be highly optimized, then by all means write a highly optimized editor.  Grin
Logged

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: dz utils: core tools for packages
« Reply #6 on: 2007 February 15, 03:23:23 »
THANKS THIS IS GREAT

Well, the editing portion of the toolset hasn't even been grokked yet. I proposed using a Lua/sed type tool, but you seem to have something else in mind.
I was thinking "like SimPE, only different and nonsuck", such as with the ability to skip unnecessary file reading and not break when you try to open something while the game is running for read-only purposes. But for anything, we'd sort of need a core function set that can load, allow modification of a resource's binary guts-contents by some means, and then spit the thing out again, preferrably with the compression working. So far it is not entirely clear how to do that part.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
wes_h
Knuckleheaded Knob
**
Posts: 530


Lady on Rancho Como


View Profile
Re: dz utils: core tools for packages
« Reply #7 on: 2007 February 15, 08:42:35 »
THANKS THIS IS GREAT

SimPE didn't have compression for a long time after it came out. I don't remember exactly, but it was quite a while after we had custom meshes working. Any file parts you changed were saved uncompressed, and those you used but hadn't changed were copied to the output in their original compressed form.
<* Wes *>
Logged
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: dz utils: core tools for packages
« Reply #8 on: 2007 February 15, 18:21:04 »
THANKS THIS IS GREAT

This is all very basic and I honestly can't see how this could trip you up but:

Code:
ls [-g group] [-t type] [-n name] [-o g|t|u|i|x|s|n] [-r] package [output]
extract [-g group] [-t type] [-i instance] [-s subtype] [-q] package
append package data [data...]

and as an example:

Code:
ls -g 7FD46CD0 -t 42434F4E -o i objects.package dir.txt
extract -g 7FD46CD0 -t 42434F4E -i 106 objects.package
create new.package
append new.package 7FD46CD0-42434F4E-00000106-00000000.dat

If you wanted to mod this, simply edit the dat file between the extract and the append step.
Logged

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: dz utils: core tools for packages
« Reply #9 on: 2007 February 15, 19:44:12 »
THANKS THIS IS GREAT

Code:
ls -g 7FD46CD0 -t 42434F4E -o i objects.package dir.txt
extract -g 7FD46CD0 -t 42434F4E -i 106 objects.package
create new.package
append new.package 7FD46CD0-42434F4E-00000106-00000000.dat

If you wanted to mod this, simply edit the dat file between the extract and the append step.
The flaws in that are firstly, the files are appended out of order, and secondly, there is no provision for removing the original file from the package, which makes it useful only for first-stage edits.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
dizzy
Souped!
*
Posts: 1572


unplugged


View Profile
Re: dz utils: core tools for packages
« Reply #10 on: 2007 February 16, 00:00:35 »
THANKS THIS IS GREAT

Actually, it's more useful for full-blown rebuilds, but really. Who cares *how* it works, it works.  Cool
Logged

J. M. Pescado
Fat Obstreperous Jerk
El Presidente
*****
Posts: 26288



View Profile
Re: dz utils: core tools for packages
« Reply #11 on: 2007 February 16, 00:37:31 »
THANKS THIS IS GREAT

Actually, it's more useful for full-blown rebuilds, but really. Who cares *how* it works, it works.  Cool
Yeah, but it'd be nice to see a sample of something that doesn't involve tearing apart the entire package into shredded bits all over the desktop.
Logged

Grant me the serenity to accept the things I cannot change, the courage to change the things I cannot accept, and the wisdom to hide the bodies of those I had to kill because they pissed me off.
wes_h
Knuckleheaded Knob
**
Posts: 530


Lady on Rancho Como


View Profile
Re: dz utils: core tools for packages
« Reply #12 on: 2007 February 16, 17:25:44 »
THANKS THIS IS GREAT

Well, I had thought about slapping the innards from those programs into a .DLL. While this doesn't directly help the non-MS people, it would allow something to be written in almost any language, including Visual Basic, by making function calls. You could then also make the command-line tools as not much more than a command-line parser and a function call.

But I am not doing that myself because I am doing other things that have sucked up all available non-RL time.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.124 seconds with 20 queries.