Gta-Action Mod Pack (*.gamp) and encrypted modpack.ini

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Gta-Action Mod Pack (*.gamp) and encrypted modpack.ini

Post by barti »

This is a package format used for some GTA mods, for example Pimp my car. The installer for these packages, GAMI, has not been updated in almost a decade and doesn't even work with modern computers (and apparently it's not available on the internet anymore). As a result, I started disassembling the mod pack and figured almost everything out. Except for the modpack.ini file, which I couldn't decrypt after numerous retries. It contains the most useful information, like the installation script which puts files from the package in the correct place.

Here's my QuickBMS script (unpacks all data, but modpack.ini is left encrypted):

Code: Select all

idstring "VER2"
get FILES  long

for i = 0 < FILES
    get  OFFSET long
    math OFFSET *= 0x800
   
    get  ZSIZE  long
    math ZSIZE  *= 0x800
   
    getdstring NAME 24
    set EXT extension NAME
   
    if EXT == "jpg"
        log NAME OFFSET ZSIZE
    elif EXT == "ini"
   log NAME OFFSET ZSIZE
        #encryption "" ""
    else
        math SIZE = ZSIZE
        math SIZE *= 64
        clog NAME OFFSET ZSIZE SIZE
    endif
next i


The Pimp my car mod along with GAMI is available here:
http://zazmahall.de/ZAZGTASANATORIUM/za ... _final.zip

- link expired -

I was somehow able to decrypt the modpack.ini from this modpack, not sure how (the most I remember is that I used Cheat Engine to browse through the program's memory):

Code: Select all

[Info]
Title=drowningpoolsz
EndScript=RebuildImg {<nl>\models\gta3.img<nl>}
HTML=<html><nl><head><nl></head><nl><frameset rows="100%"><nl><frame src="http://gta-action.com/gta-action/content/mod-pack/gamp_single/intro.php"><nl></frameset><nl></html>
HTMLHeight=218
[Typ1]
TypeID=1
Name=Modifikation
Description=
Picture=_cover.jpg
[Mod1]
TypeID=1
Name=Mazda RX-7
Description=Replace: ZR350 | Tuningparts: 0 | Paintjobs: 0 | Extras: 0
InstallScript=RemoveImg {<nl>\models\gta3.img<nl>zr350.dff<nl>zr350.txd<nl>}<nl># ====================================Check TXD<nl>IfExistGoto {<nl>Img<nl>\models\gta3.img<nl>zr3500.txd<nl>zr3500YES<nl>zr3500NO<nl>}<nl>:zr3500YES<nl>RemoveImg {<nl>\models\gta3.img<nl>zr3500.txd<nl>}<nl>Goto {<nl>Step1<nl>}<nl>:zr3500NO<nl>Goto {<nl>Step1<nl>}<nl>:Step1<nl>IfExistGoto {<nl>Img<nl>\models\gta3.img<nl>zr3501.txd<nl>zr3501YES<nl>zr3501NO<nl>}<nl>:zr3501YES<nl>RemoveImg {<nl>\models\gta3.img<nl>zr3501.txd<nl>}<nl>Goto {<nl>Step2<nl>}<nl>:zr3501NO<nl>Goto {<nl>Step2<nl>}<nl>:Step2<nl>IfExistGoto {<nl>Img<nl>\models\gta3.img<nl>zr3502.txd<nl>zr3502YES<nl>zr3502NO<nl>}<nl>:zr3502YES<nl>RemoveImg {<nl>\models\gta3.img<nl>zr3502.txd<nl>}<nl>Goto {<nl>Step3<nl>}<nl>:zr3502NO<nl>Goto {<nl>Step3<nl>}<nl>:Step3<nl>IfExistGoto {<nl>Img<nl>\models\gta3.img<nl>zr3503.txd<nl>zr3503YES<nl>zr3503NO<nl>}<nl>:zr3503YES<nl>RemoveImg {<nl>\models\gta3.img<nl>zr3503.txd<nl>}<nl>Goto {<nl>Step4<nl>}<nl>:zr3503NO<nl>Goto {<nl>Step4<nl>}<nl>:Step4<nl>IfExistGoto {<nl>Img<nl>\models\gta3.img<nl>zr3504.txd<nl>zr3504YES<nl>zr3504NO<nl>}<nl>:zr3504YES<nl>RemoveImg {<nl>\models\gta3.img<nl>zr3504.txd<nl>}<nl>Goto {<nl>Step5<nl>}<nl>:zr3504NO<nl>Goto {<nl>Step5<nl>}<nl>:Step5<nl>AddImg {<nl>\models\gta3.img<nl>zr350.dff<nl>zr350.txd<nl>}<nl>ReplaceLine {<nl>\data\vehicles.ide<nl>477,    zr350,*<nl>477,    zr350,       zr350,       car,       ZR350,      ZR350,       null,   richfamily,    10,    0,   0,      -1, 0.76, 0.76,      0<nl>}<nl>ReplaceLine {<nl>\data\handling.cfg<nl>ZR350*<nl>ZR350        1200.0 2998.3 2.0 0.0 0.1 -0.8 75 0.70 0.80 0.47 5 350.0 50.0 5.0 R P 8.0 0.45 0 55.0 1.4 0.15 0.0 0.28 -0.05 0.5 0.3 0.25 0.10 35000 00110000 00c24007 0 2 0<nl>}<nl>ReplaceLine {<nl>\data\carmods.dat<nl>zr350,*<nl>zr350, nto_b_l, nto_b_s, nto_b_tw<nl>}<nl>ReplaceLine {<nl>\data\carcols.dat<nl>zr350,*<nl>zr350, 92,1, 94,1, 101,1, 121,1, 0,1, 22,1, 36,1, 75,1<nl>}
Readme=************Mazda Rx-7 By:drowningpoolsz*************<nl><nl><nl>How to install<nl><nl><nl><nl>Installation:<nl>1. Dowload Sami mod installer in gtagaming.com<nl>2. Install Sami mod installer <nl>3. Find the folder where you input GTA san andreas <nl> Example: Local Disk C / Program Files<nl> <nl>Sorry for my English Im filipino<nl><nl><nl><nl><nl>************Tagalog instolasyon*************<nl><nl>Instolasyon:<nl>1.i download ang sami mod installer<nl>2. i install ang sami mod installer<nl>3. hanapin kung saan nakalagay ang folder<nl> Example: Example: Local Disk C / Program Files<nl><nl>u can use my handling <nl>Example:<nl>Carname: 1200.0 2998.3 2.0 0.0 0.1 -0.8 75 0.70 0.80 0.47 5 350.0 50.0 5.0 R P 8.0 0.45 0 55.0 1.4 0.15 0.0 0.28 -0.05 0.5 0.3 0.25 0.10 35000 00110000 00c24007 0 2 0<nl><nl><nl><nl><nl><nl><nl>Special Thanks to: m11osass09<nl>Visit: www.pngaming.co.cc<nl><nl>Please Note: Don't Re-post Without my permission <nl>E-mail me at drowning_poolsz@yahoo.com<nl><nl>                   ***************Thank you For Downloading**************<nl><nl>
Files=zr350.dff|zr350.txd|
Picture=_cover.jpg
Last edited by barti on Fri Sep 02, 2016 12:23 pm, edited 1 time in total.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Gta-Action Mod Pack (*.gamp) and encrypted modpack.ini

Post by aluigi »

Very interesting.
I have found the way to decrypt the ini file and embedded everything in a new script:
http://aluigi.org/papers/bms/others/gta_action_mod.bms

My only doubt is about the 0x800 alignment because it leaves garbage at the end of the file after the decryption.
barti
Posts: 34
Joined: Sun Nov 09, 2014 2:40 pm

Re: Gta-Action Mod Pack (*.gamp) and encrypted modpack.ini

Post by barti »

Thank you very much for the script.
Yes, it's strange that the unaligned sizes aren't stored anywhere. Weird format.