Quantcast

Jump to content

» «
Photo

[REL|BIN/SRC|Beta] SparkIV

926 replies to this topic
aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#1

Posted 16 December 2008 - 11:48 PM Edited by aru, 21 April 2010 - 05:00 PM.

SparkIV

IMG/RPF Archive Viewer/Editor for GTA:IV


Latest version can be found at the Google Code page:
Download


This program is provided under the GPL v3 license. The source code for this program can be obtained from its Google Code page.

Comments/Requests/Bug Reports/etc are welcome!

NOTE: This is a public beta, and as such it is crucial that you backup all files you save/rebuild with SparkIV! I won't be held responsible for any loss of files/limbs/cake/etc that may result due to the use of SparkIV.

Version 0.6.2 Features
- Support for previewing FragType Model (*.wft) files
- Support for viewing LOD models
- Support for exporting audio as multichannel WAV files
- Support for Russian patched version (1.0.1.1)
- Workaround for Windows 7 textures bug for older betas (should already be fixed in newest beta of Windows 7)
- Updated list of audio filesnames (thanks to DerPlaya78)
- Other minor bug fixes/speed improvements

Version 0.6.1 Features
- Critical bug fix with import/export textures.
- Fixed a few bugs in WHM preview
- Auto-check for readonly when opening IMG/RPF files

Version 0.6.0 Features
- Support for version 1.0.2 of GTAIV
- Support for previewing WHM files (might not preview exactly as shown in game)
- Support for all Audio files, with playback and export support (thanks to DerPlaya78!)
- Default filenames are now shown when exporting/importing textures in Edit mode
- Support for loading IMG/RPF/Directories by passing a command line argument
- IMG/RPF files are opened in read/write share mode now instead of just read share
- Work around for Windows 7's GDI+ bug
- Added support for "type 3" vertices in models
- Fixed bug with textures that have a name of less than 6 characters

Version 0.5.4 Features
- Fixed critical bug in texture size calculation for mipmaps
- Added support for 8bit grayscale (L8) textures
- Added support for "type 8" vertices in models

Version 0.5.3 Features
- Improved model loading, most models should display correctly now.
- Added support for 32bit ARGB textures
- Fixed a few texture file memory leaks
- Fixed bug in texture mapping in 3D preview
- Fixed bug in size calculation for thumbnail generation

Version 0.5.2 Features
- Support for editing textures embedded in Model (wdr) and HTML (whm) files
- Added View/Edit buttons. Default action is View now, so use the Edit button if you wish to edit textures.
- Fixed bug with texture encoding producing low quality mipmaps.
- Fixed bug with loading SparkIV.Config.xml file

Version 0.5.1 Features
- Support for Texture File editing with Import (replace only) functionality
- Support for viewing Texture mipmaps and viewing colour channels seperately
- Support for showing most of the filenames in Audio RPF (v3) files.
- Support for launching external registered editors based on extension
- Fixed some bugs with IMG file saving

Version 0.5.0 Features
- New "Browse" feature loads up GTAIV directory into view allowing easy access to open IMG/RPF files, as well as previewing resource files not in archives.
- Experimental support for saving RPF files (hasn't been extensively tested)
- Experimental support for previewing script (*.sco) files in a pseudo C-like decompiled form as well as a disassembled form.
- Support for previewing XML and other text files
- Support for previewing Model Dictionary (*.wdd) files
- Experimental support for texture mapping in model preview (will automatically load filename.wtd if present or display textures embedded in model -- mapping may not be accurate for all models!)
- Model meshes without textures will now show in a random colour
- Model preview has a tree control allowing to view submeshes
- Model preview allows viewing model in wireframe mode (might be slow)
- Some minor bug fixes

Version 0.4.5 Features
- Texture (*.wtd) preview and support for exporting textures
- Experimental Model (*.wdr) preview
- Double click/Press enter on a supported file to preview it
- Fixed bug in resource file segment size calculation when importing data in Resoursaur.

Version 0.4.0 Features
- Opens IMGs (ver 3), and RPFs (ver 2/3). Old style IMGs (GTA3/VC/SA) are unfortunately not supported.
- Saves/Rebuilds IMGs. Saving RPFs is currently not supported, but will be added eventually.
- Allows you to import/export files.

Requirements
- Microsoft .NET Framework 3.5. If SparkIV does not run, you need to download and install this from here.
- Version 1.0, 1.01 or 1.02 of GTAIV.exe. This is required for the cryptographic keys.

Resource Files
Exported Resource files will be exported as-is and compressed. To extract the data segments out of the resource file, a tool called Resoursaur (yes, creative... aren't I? smile.gif ) is available in versions of Spark 0.5.4 and older (download available at the Google code link). This tool will be quite useful to those wishing to explore the resource file formats in a hex editor.

Legal Issues
A cryptographic encryption key is required for running SparkIV. For legal reasons (DMCA/EUCD/etc), this key is not included in SparkIV but rather extracted from GTAIV.exe on startup. So, you will need a supported version of GTAIV installed, or have a GTAIV.exe placed in the same directory as SparkIV.

Webmasters
Please don't reupload this to your website. Link to this forum topic instead. This tool is still a WIP and there are many many more updates/fixes to come.
  • UltimateGTR, Deadly Target, LiveApk25 and 2 others like this

Millenia
  • Millenia

    Gunz 'R Us

  • Members
  • Joined: 12 Aug 2005

#2

Posted 16 December 2008 - 11:54 PM

Great work there aru, thanks!

uNi
  • uNi

    Feroci

  • Administrator
  • Joined: 14 May 2004
  • Scotland
  • Best Official Gang 2014 [Feroci]

#3

Posted 16 December 2008 - 11:55 PM

Good job as always aru. icon14.gif

blazer30uk
  • blazer30uk

    Player Hater

  • Members
  • Joined: 05 Dec 2008

#4

Posted 17 December 2008 - 12:09 AM

Nice one mate icon14.gif

Fabio206
  • Fabio206

    GTA-Expert.it Webmaster

  • Members
  • Joined: 20 Oct 2006

#5

Posted 17 December 2008 - 12:24 AM

Great!

Starion
  • Starion

    hmm..

  • Andolini Mafia Family
  • Joined: 14 Feb 2005

#6

Posted 17 December 2008 - 12:24 AM

..You can import files now?


This may be a stupid question, but is there any way to view an exported file? That would open so many doors to modding IV.

Glumok
  • Glumok

    8 years on GTAForums... Bordel de foutre !

  • Members
  • Joined: 04 Apr 2007
  • None

#7

Posted 17 December 2008 - 02:48 AM

Another good job, Aru !

Note you have to remove the "read only" attribute for the file you want to open, or you'll get an error (at least, it was the case for me).

Now, how to edit the wbn, wdr, wad, ... ?

Off topic : are you gonna work in "team" with the OpenIV crew ? Your goal is, I guess, to create the same kind of tool.

DexX
  • DexX

    Black Hat

  • Feroci
  • Joined: 16 May 2002

#8

Posted 17 December 2008 - 03:14 AM

Excellent. The game doesn't check img files in the models folder, so i'll be happily testing stuff there soon, hopefully. I did do some testing with the resource segment import/export, i didn't have much progress ingame. I get the following error, just as my model (Huntley, as the case may be) should appear:
http://img296.images...resourcezl5.gif

"GTA IV Fatal Error: RC20
Invalid Resource Detected - Please re-install the game"

What i did was this:
-extract the Huntley.wft, and make a backup copy
-open huntley.wft in Resoursaur.exe
-extract system data, and gfx data
-import system data, and gfx data back into huntley.wft
-save huntley.wft
-import huntley.wft into vehicles.img, and start the game
-wait impossibly long time for game to load (thats normal, your img tool seems to work fine)
-wait for huntley to spawn, then crash!

The huntley.wft that is saved from Resoursaur is 571,426 bytes, vs the 573,440 bytes of the original, unmodified huntley.wft file. There appears to be a giant block of '00' padding on the end of the original huntley.wft, that is completely absent from the one your app saves out.

Otherwise, good start to what will be an invaluable tool.

HazardX
  • HazardX

    pedestrian mangler

  • Members
  • Joined: 13 Dec 2008

#9

Posted 17 December 2008 - 03:26 AM

Great work aru! As you seem to have some great insight to GTA4 fileformats and related cryptography, maybe you can help me out with something:

I'm working on an easy-to-use modmanager for GTA4 (made some for other games already). However, if the modmanager replaces the original game files, chances are, that patches or stuff in combination with modified files will mess up the installation. thus it would be best to have one package file that contains all modified files and has preference over all other files. best bet for such a package would be the filelist.pak . the file format is very easy, however, contained files haven't got filenames and instead an integer value which identifies the file (i.e. 80E49686 = common\data\fonts.dat , A4E833EF = common\data\decision\cop.ped). My guess is, that this integer is a hash of the filename, but i haven't got a clue which algorithm might be used to generate the hash. do you have any idea? the rpf files seem to use such hashes too.

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#10

Posted 17 December 2008 - 03:58 AM Edited by aru, 17 December 2008 - 09:51 AM.

@gorgeprofondegta4... I think the goal of OpenIV is the same as mine, but our methodology for going about this is quite different. When I'm happy with the maturity of SparkIV, its going to be open source. I'm more than happy to share what I know/learnt with others, as long as they are willing to do the same. I think OpenIV wants to be a bit more closed (i.e. see this)... and IMHO, that really doesn't work well with a dynamic community like this where we have a lot of talented programmers around.

@DexX... good catch! I was testing Resoursaur with the the RSCs that were already outside the archives so I never ended up getting that error. I guess I'll have to pad it properly when importing in SparkIV. smile.gif

@HazardX... try the One-at-a-Time hash function. R* seems to like that. See http://www.gtaforums...st&p=1058720528

coin-god
  • coin-god

    High Roller

  • $outh $ide Hoodz
  • Joined: 18 Mar 2007
  • None

#11

Posted 17 December 2008 - 04:17 AM

Awesome work aru. icon14.gif

Glumok
  • Glumok

    8 years on GTAForums... Bordel de foutre !

  • Members
  • Joined: 04 Apr 2007
  • None

#12

Posted 17 December 2008 - 04:29 AM

QUOTE (aru @ Dec 17 2008, 04:58)
When I'm happy with the maturity of SparkIV, its going to be open source.

open source = open mind (and vice versa).
I like the way you think, dude.
I will follow every release of SparkIV, it looks promising. Keep on this way !

saintone
  • saintone

    Player Hater

  • Members
  • Joined: 09 Apr 2008

#13

Posted 17 December 2008 - 10:09 AM

Can this program open gta IV x360 archives?

Good job icon14.gif

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#14

Posted 17 December 2008 - 10:14 AM

QUOTE (saintone @ Dec 17 2008, 05:09)
Can this program open gta IV x360 archives?

Good job icon14.gif

In theory, yes (atleast it used to)... but I haven't tested it since I added support for the PC version.

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#15

Posted 17 December 2008 - 10:21 AM Edited by mr.Dageron, 17 December 2008 - 01:14 PM.

aru, you are coolest coder! icon14.gif icon14.gif icon14.gif
Your programm will be brilliant if it will support opening&editing Xbox360 GTAIV files cookie.gif

What about WTD/XTD supporting in future realises?

REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#16

Posted 17 December 2008 - 10:52 AM

Excellent work as always Aru

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#17

Posted 17 December 2008 - 01:18 PM

Awesome.
Does anyone know where are all the models and textures for Niko are kept? I haven't found any niko.img or player.img.

Shadow-Link
  • Shadow-Link

    Li'l G Loc

  • Members
  • Joined: 01 Dec 2004
  • Netherlands

#18

Posted 17 December 2008 - 01:52 PM

QUOTE (simkas @ Dec 17 2008, 15:18)
Awesome.
Does anyone know where are all the models and textures for Niko are kept? I haven't found any niko.img or player.img.

There is a playerped.rpf in the \pc\models\cdimages folder.. Think that contains the player models/textures.

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#19

Posted 17 December 2008 - 02:01 PM

QUOTE (Prince-Link @ Dec 17 2008, 13:52)
QUOTE (simkas @ Dec 17 2008, 15:18)
Awesome.
Does anyone know where are all the models and textures for Niko are kept? I haven't found any niko.img or player.img.

There is a playerped.rpf in the \pc\models\cdimages folder.. Think that contains the player models/textures.

That's for the multiplayer character.

the hubster
  • the hubster

    Sup Homies

  • Members
  • Joined: 03 May 2005

#20

Posted 17 December 2008 - 02:18 PM

Excellent work aru

JostVice
  • JostVice

    realtime, not prerendered

  • Feroci
  • Joined: 30 Oct 2005
  • None

#21

Posted 17 December 2008 - 02:24 PM

Awesome aru, the import/export works great, tried it tounge.gif

ParoXum
  • ParoXum

    Proud PC Gamer

  • Feroci
  • Joined: 28 Jul 2005
  • None
  • Best Texture/Model 2013 "SRt3 2012 Mipmap Edition"

#22

Posted 17 December 2008 - 02:32 PM

Nice work aru. I'm really impatient to get things ingame now. turn.gif

evilrex
  • evilrex

    Foot Soldier

  • Members
  • Joined: 27 May 2006

#23

Posted 17 December 2008 - 02:42 PM

Now it's time to make some car mods?

Wersaq
  • Wersaq

    Player Hater

  • Members
  • Joined: 16 Dec 2008

#24

Posted 17 December 2008 - 02:52 PM

Great work Aru. Can we expect a tool for editing the textures by you ?

SLAYERMAGGOT
  • SLAYERMAGGOT

    Stay Wild

  • Members
  • Joined: 19 Mar 2008

#25

Posted 17 December 2008 - 04:20 PM

Perfect work, aru

@Wersaq: When OpenIV is ready for public, then we are able to open .wtd-files (textures) icon14.gif

ceedj
  • ceedj

    PEDS Creator

  • Feroci
  • Joined: 21 May 2005
  • United-States

#26

Posted 17 December 2008 - 04:57 PM

Kick ass aru! smile.gif Keep up the awesome work!

MixerX
  • MixerX

    Player Hater

  • Members
  • Joined: 17 Sep 2005

#27

Posted 17 December 2008 - 06:21 PM Edited by MixerX, 17 December 2008 - 06:33 PM.

hey!
nice one, but seems like the resource dinosaur smile.gif can't import bigger files properly. i tried to export graphic resource from cashmachine.wtd, import it back and save, and it worked. then i tried a bigger file (uncompressed >1MB) and after importing and saving it always says that the size of the graphic segment is 0 bytes. simply said, the graphic part isnt readable anymore. hope you fix this soon, i was about to import font textures smile.gif

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#28

Posted 17 December 2008 - 06:49 PM

This program will be the best if it has function of Xbox360 files editing smile.gif Much better than OpenIV

aru
  • aru

    *poof*

  • Feroci
  • Joined: 20 Jun 2005
  • None

#29

Posted 17 December 2008 - 07:42 PM

@Wersaq... I might be adding a texture previewer to SparkIV, but there won't be a full editor from me. Someone else from here is working on one though... wink.gif

@MixerX... Yes, theres some problems with the dinosaur calculating the sizes... Also, I think I should enforce that all segments must be a multiple of 4096 bytes... which they usually are.

@mr.Dageron... Why the need to edit xbox360 files? Anyway, IMG opening/saving for 360 should work with SparkIV, but I have no way of testing that. Resoursaur will currently export the segments out of a 360 resource file, but not import.

anadolu1923
  • anadolu1923

    Square Civilian

  • Members
  • Joined: 20 Jul 2008

#30

Posted 17 December 2008 - 08:02 PM

great work, thanks smile.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users