Quantcast

Jump to content

» «
Photo

IMGiv

  • This topic is locked This topic is locked
37 replies to this topic
REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#1

Posted 14 December 2008 - 08:27 PM

This is an early version app that will allow you to open IV PC IMG archives, it currently only supports viewing and extracting archive contents, this is to test the waters with R* and to give people access to the files so that other tools may be developed.
This application will be updated frequently over the coming days so check here regularly for updates.

The only requirement of using this app is that you supply the path to your GTAIV.exe file.
Any problems or questions just post them here.

Updated to version 1.1 - 15th Dec 2008
Download 551kb: IMGiv.rar

user posted image

Gforce
  • Gforce

    "Segregate and Rearrange" "The Hills"

  • Feroci Racing
  • Joined: 17 Sep 2003
  • United-Kingdom

#2

Posted 14 December 2008 - 08:42 PM

Great work REspawn, the first of many useful GTA IV apps i hope biggrin.gif

Fabio206
  • Fabio206

    GTA-Expert.it Webmaster

  • Members
  • Joined: 20 Oct 2006

#3

Posted 14 December 2008 - 09:00 PM

Great cookie.gif cookie.gif

FunGt
  • FunGt

    GTA-Modding.com

  • Members
  • Joined: 10 Jun 2005
  • Italy

#4

Posted 14 December 2008 - 09:08 PM

Nice,
Can't wait to see the final version. icon14.gif

ZAZ
  • ZAZ

    Kernlochbohrer

  • Members
  • Joined: 10 Jan 2005
  • European-Union

#5

Posted 14 December 2008 - 09:15 PM

Yeah, execellent cookie.gif cookie.gif cookie.gif

the hubster
  • the hubster

    Sup Homies

  • Members
  • Joined: 03 May 2005

#6

Posted 14 December 2008 - 09:23 PM

Any chance of getting the source code to this released or some documentation on the format?
Nice work btw.

Shadow-Link
  • Shadow-Link

    Li'l G Loc

  • Members
  • Joined: 01 Dec 2004
  • None

#7

Posted 14 December 2008 - 09:39 PM

QUOTE (the hubster @ Dec 14 2008, 23:23)
Any chance of getting the source code to this released or some documentation on the format?
Nice work btw.

Would be awesome if you could give us some information!

And ofcourse great work! icon14.gif

JostVice
  • JostVice

    realtime, not prerendered

  • Feroci Racing
  • Joined: 30 Oct 2005
  • None

#8

Posted 14 December 2008 - 09:44 PM

Great, REspawn. This is supposed to open the IMG files of IV, but nothing about the RPFs, right?

I'm a bit confused about the file formats, both contains game files?

REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#9

Posted 14 December 2008 - 10:50 PM

QUOTE (Prince-Link @ Dec 14 2008, 22:39)
QUOTE (the hubster @ Dec 14 2008, 23:23)
Any chance of getting the source code to this released or some documentation on the format?
Nice work btw.

Would be awesome if you could give us some information!

And ofcourse great work! icon14.gif

Yes, it will be 100% open source.
Its written in C++, wxWidgets for the GUI, more info in the next day or two if R* don't sue.

@Jost_Vice - Just the IMG files, I haven't looked at the RPF files at all.

DimazzzZ
  • DimazzzZ

    Aircraft Man

  • Members
  • Joined: 28 Jan 2006

#10

Posted 14 December 2008 - 11:01 PM

Great work REspawn!
And special thanks for OpenSource! icon14.gif

aru
  • aru

    *poof*

  • Feroci Racing
  • Joined: 20 Jun 2005
  • None

#11

Posted 15 December 2008 - 02:19 AM

Nice work REspawn!

xmen
  • xmen

    Foot Soldier

  • Members
  • Joined: 02 Jun 2005
  • None

#12

Posted 15 December 2008 - 04:29 AM

AWESOME work mate wink.gif

xadet3
  • xadet3

    Player Hater

  • Members
  • Joined: 13 Dec 2008

#13

Posted 15 December 2008 - 08:01 AM

Very nice work, looking forward to the open source release.

listener
  • listener

    Monkey with a disassembler

  • Members
  • Joined: 06 Sep 2007
  • None

#14

Posted 15 December 2008 - 08:51 AM

Great work, REspawn, but something wrong with your size calculations.

Each RSC contains two segments: CPU (virtual) segment and GPU (physical) segment.
CPU seg contains one object with all included subobjects (in case of .wtd - rage::pgDictionary<rage::grcTexture>), GPU seg contains pixel/vertex data. You need segment sizes to resolve relocations.

CODE

struct RscHeader {
 DWORD dwMagick;
 DWORD dwVersion;
 DWORD dwFlags;
};

RscHeader header;
// ... some code skipped
DWORD cpuSize = (header.dwFlags&0x7FF) << (((header.dwFlags >> 11) & 0xF) + 8);
DWORD gpuSize = ((header.dwFlags >> 15)&0x7FF) << (((header.dwFlags >> 26) & 0xF) + 8);
// ... anothr part of code skipped
int inLength = filelength (rscFile)-sizeof (RscHeader);
int outLength = (int)(cpuSize+gpuSize);
// ... allocate memory and read file
int result = uncompress (outBuf, &outLength, inBuf, inLength);


Shurik123
  • Shurik123

    Player Hater

  • Members
  • Joined: 07 Dec 2008

#15

Posted 15 December 2008 - 08:59 AM Edited by Shurik123, 15 December 2008 - 09:01 AM.

excellent!!! lol.gif icon14.gif thx

aru
  • aru

    *poof*

  • Feroci Racing
  • Joined: 20 Jun 2005
  • None

#16

Posted 15 December 2008 - 09:26 AM

QUOTE (listener @ Dec 15 2008, 03:51)
Great work, REspawn, but something wrong with your size calculations.

Heh, thats because the sizes that are displayed is the compressed RSC sizes (theres nothing wrong with that) and when exported, they get decompressed.

Ideally, I think each RSC should be exported as-is (compressed), and let the future RSC tools deal with the de/compression of them. If you look at the RSC files that are outside of the .img/.rpf archives (.whm, etc).. you'll notice that they are still compressed. However, the decompressed version is still useful for format REing smile.gif

listener
  • listener

    Monkey with a disassembler

  • Members
  • Joined: 06 Sep 2007
  • None

#17

Posted 15 December 2008 - 09:51 AM

aru, look at this:
CODE

15.12.2008  10:38         5 771 264 brook_new_roads.wtd.listener
15.12.2008  10:36         5 788 518 brook_new_roads.wtd.respawn

Input file: brook_new_roads.wtd
Loaded resource file: version=8, CPU_size = 0x1000, GPU_size = 0x580000
Output file: brook_new_roads.wtd.listener
in = 3137524, out = 5771264
OutSize = 5771264, err = 0
Complete.


uNi
  • uNi

    Cyclop 9

  • Moderator
  • Joined: 14 May 2004
  • None

#18

Posted 15 December 2008 - 09:55 AM

Awesome REspawn, this will be handy. biggrin.gif

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#19

Posted 15 December 2008 - 10:05 AM

Your work is cool, REspawn icon14.gif
I have got just only one question: why we need to have GTAIV.exe to make this programm workable? biggrin.gif Can you put this spesial parametres wich your program "read from exe" right into it?

simkas
  • simkas

    That guy

  • Members
  • Joined: 13 Dec 2006

#20

Posted 15 December 2008 - 11:23 AM

Nice.
But, is there a way to open the .wtd texture files yet?

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#21

Posted 15 December 2008 - 11:29 AM

In OpenIV

REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#22

Posted 15 December 2008 - 11:47 AM

@listener - Thanks for the info, I'm at work now but will check it out as soon as I get home

@aru- Yea, letting tools handle the decompression themselves is the way to go, and provides a nice common ground for everyone to work with.

@mr.Dageron - The reason for this is a legal one, I'm not sure how R* will react to tools, but having the AES key in my app might not be the best, so thats why it needs the path to the .exe. This im sure will become less of an issue over the next few weeks.


_CP_
  • _CP_

    Group: Vice City Stories team

  • Feroci Racing
  • Joined: 27 Dec 2007
  • Poland
  • Best Map 2013 "ViceCityStories PC Edition"

#23

Posted 15 December 2008 - 02:34 PM

It's possible to open files from x0?

Kakashevich
  • Kakashevich

    Player Hater

  • BUSTED!
  • Joined: 30 Nov 2008

#24

Posted 15 December 2008 - 04:38 PM

It writes me "AES Key did not match. Unable to continue"

What to do? I have official russian version of the game from 1C (legal of course)

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#25

Posted 15 December 2008 - 05:04 PM

Maybe the .exe file error. If your version already has last patch updates, you should backup new exe and put old into directory. (old it is possible to get from first GTAIV realise)

Kakashevich
  • Kakashevich

    Player Hater

  • BUSTED!
  • Joined: 30 Nov 2008

#26

Posted 15 December 2008 - 05:30 PM

QUOTE (mr.Dageron @ Dec 15 2008, 17:04)
Maybe the .exe file error. If your version already has last patch updates, you should backup new exe and put old into directory. (old it is possible to get from first GTAIV realise)

Could be... Я до сих пор не разобрался, патченная ли версия от 1С или нет.

aru
  • aru

    *poof*

  • Feroci Racing
  • Joined: 20 Jun 2005
  • None

#27

Posted 15 December 2008 - 05:43 PM

QUOTE (listener @ Dec 15 2008, 04:51)

aru, look at this:
CODE

15.12.2008  10:38         5 771 264 brook_new_roads.wtd.listener
15.12.2008  10:36         5 788 518 brook_new_roads.wtd.respawn

Input file: brook_new_roads.wtd
Loaded resource file: version=8, CPU_size = 0x1000, GPU_size = 0x580000
Output file: brook_new_roads.wtd.listener
in = 3137524, out = 5771264
OutSize = 5771264, err = 0
Complete.



Interesting... I wonder if REspawn is doing anything special... my current version of SparkIV just deflates the data and lets the deflater take care of the output size.

QUOTE (mr.Dageron @ Dec 15 2008, 05:05)

Your work is cool, REspawn icon14.gif
I have got just only one question: why we need to have GTAIV.exe to make this programm workable?  biggrin.gif Can you put this spesial parametres wich your program "read from exe" right into it?


Heh, including the AES encryption key into the program is an open invitation for Rockstar's lawyers to start sending DCMA/EUCD notices not only to the author but also the sites hosting the program (GTAForums, etc). As long as the key is not included, no DRM has been broken. Extracting it out of the exe is probably the best way to go.

REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#28

Posted 15 December 2008 - 05:49 PM

QUOTE (aru @ Dec 15 2008, 18:43)
Interesting... I wonder if REspawn is doing anything special... my current version of SparkIV just deflates the data and lets the deflater take care of the output size.

Nope, nothing special at all, I just pass the data to zlib and let it take care of the output size itself, I'm at work ATM but will have a look when I get home.

@Kakashevich - I will have a look at your exe when I get home and post here with an update.

mr.Dageron
  • mr.Dageron

    Bbobik - my old nickname

  • BUSTED!
  • Joined: 25 Nov 2008

#29

Posted 15 December 2008 - 06:13 PM

aru, please, post some screens of your SparkIV smile.gif I am sure that it is as cool as OpenIV icon14.gif

What about encrypting code, will it description be on gtamodding.com? Or maybe the "way how to read it from exe"?

REspawn
  • REspawn

    REgent

  • Members
  • Joined: 06 Jul 2002
  • None

#30

Posted 15 December 2008 - 10:20 PM

Updated to version 0.1
- Added support for Russian exe version 1.1
- fixed the file size bug




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users