Sonic and Sega Retro Message Board: Sonic 2006 hacking - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

Sonic 2006 hacking

#1 User is offline rasgar 

Posted 27 November 2012 - 02:00 PM

  • Posts: 7
  • Joined: 23-October 12
I've been wanting to try hacking Sonic 2006 for a while now, and I'm trying to get started now that I have the means to play a hacked version. My problem is that I'm having trouble finding the guides/resources I looked up a while ago. I was hoping someone might be able to answer a couple questions, or perhaps point me in the right direction for some info. My primary goal is simply to play as the other characters in multiplayer. I know how to unpack the .arc files and decrypt the .lub files into .lua, and I think I know how to repack them (though I haven't tried yet).

First off, I have a basic understanding (I think) of how to do the model swaps (something about looking for the model_package and changing the lua file it loads, or something like that). Is that all I would need to do to, for example, switch out Sonic for a fully functioning Knuckles? Or are there more variables I need to change?

Second (I'm guessing the answer is no), is there any way to tamper with the character select menu itself to increase the number of slots that are on it, allowing me to put all the characters on the character select at the same time? Or at least, load the files for another character so that I don't have to tamper with Sonic's files at all?

#2 User is offline Irixion 

Posted 28 November 2012 - 07:22 PM

  • Posts: 1414
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
I'd very much appreciate if someone could put together instructions, however basic on how to do all of this.
Unpacking/repacking arc, decrypting lub into lua, editing decrypted files.


To answer your question, from my understanding of the game, you'd just have to rename the Player_Sonic file into whatever character you want to replace.

#3 User is offline princeofknaves 

Posted 28 November 2012 - 07:43 PM

  • Posts: 16
  • Joined: 11-March 11
  • Gender:Male
  • Location:Detroit, Michigan
  • Project:Entropy Engine, Knuckles The Echidna Game
here is the QuickBMS code for the arc files. the lub files aren't encrypted they are compiled binaries and I have no idea how to decompile them and if you could I sincerely doubt that it would be anything but uncommented assembly

# Sonic 2006
# script for QuickBMS http://aluigi.org/papers.htm#quickbms

endian big
idstring "\x55\xaa\x38\x2d"
get OFFSET long
get INFO_SIZE long
get BASE_OFFSET long
getdstring DUMMY 0x10
goto OFFSET
set NAME_BASE long 0
set PATH string ""
set NAME string ""
math XLIMIT = 0x7fffffff
putarray 0 0 0
callfunction EXTRACT

startfunction EXTRACT
    string PATH += NAME
    string PATH += /
    math LIMIT = XLIMIT
    for
        getarray I 0 0
        if I >= LIMIT
            break
        endif
        math I += 1
        putarray 0 0 I

        get FOLDER short
        get NAME_OFF short
        if FOLDER == 0
            get OFFSET long
            get ZSIZE long
            get SIZE long
        else
            get ID long
            get XLIMIT long
            get DUMMY long
        endif

        if NAME_BASE == 0
            math NAME_BASE = XLIMIT
            math NAME_BASE *= 0x10
            math INFO_SIZE -= NAME_BASE
            math NAME_BASE += OFFSET
            log MEMORY_FILE NAME_BASE INFO_SIZE
            math LIMIT = XLIMIT
        endif
        goto NAME_OFF MEMORY_FILE
        get NAME string MEMORY_FILE

        if FOLDER == 0
            set FNAME string PATH
            string FNAME += NAME
            clog FNAME OFFSET ZSIZE SIZE
        else
            callfunction EXTRACT
        endif
    next
endfunction


#4 User is offline rasgar 

Posted 28 November 2012 - 10:40 PM

  • Posts: 7
  • Joined: 23-October 12
I used this tool to unpack the .arcs, which I found on the Sonic Community Hacking Guide.

To decompile the .lub files, I used this tool. There's another program that can be used to recompile them called luac, but I can't seem to find it anywhere. Which sucks.

#5 User is offline Irixion 

Posted 29 November 2012 - 12:11 PM

  • Posts: 1414
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
Where's LINK when you need him? :V. Shame it's not documented, looks like I'm not the only one interested in tearing this game apart.

#6 User is offline rasgar 

Posted 29 November 2012 - 01:31 PM

  • Posts: 7
  • Joined: 23-October 12
I was able to get this by using the command prompt. I don't know if you've already seen this, but I'll post it:

arctool.exe [options] [filename]

Possible options:
-d: Deflate/Extract (standard if file does already exist)
-s: List files (simulate extraction)
-c: Create ARC file (standard if file does not already exist)
-l#:Compression level (# ranges from 0 to 9, 9 being default, 0 meaning no compression at all) (only for creation)
-a#:Write 32-byte-arranged ARC files (#1 for true, true is default) (only for creation)
-f: Force overwriting of old ARC file
-I: Input directory (only for creation)
-j [filesize/filename]: Fill file with junk data (only for creation)
   If a numeric value is given: the final file will be at least as large as the given value
   If a filename is given, the filesize of the filename given will be used for final size!

ARC file format/Unpacker: written by xose
Packer: written by Link


#7 User is offline Irixion 

Posted 30 November 2012 - 10:23 PM

  • Posts: 1414
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
I've seen it, just unsure of what parameters to use, such as compression level and so on.

#8 User is offline woun 

Posted 02 December 2012 - 02:52 PM

  • Change your world
  • Posts: 49
  • Joined: 04-December 09
  • Gender:Male
  • Location:Vorkuta (n.), Russia

View Postrasgar, on 28 November 2012 - 10:40 PM, said:

To decompile the .lub files, I used this tool. There's another program that can be used to recompile them called luac, but I can't seem to find it anywhere. Which sucks.
Use it https://github.com/s...y/luadec51/wiki

#9 User is offline rasgar 

Posted 02 December 2012 - 10:33 PM

  • Posts: 7
  • Joined: 23-October 12

View PostIrixion, on 30 November 2012 - 10:23 PM, said:

I've seen it, just unsure of what parameters to use, such as compression level and so on.


If you're just trying to unpack it, you can ignore all the options entirely - just type arctool.exe and the file name. As for repacking, I haven't really experimented with that yet.

#10 User is offline rasgar 

Posted 05 December 2012 - 10:54 AM

  • Posts: 7
  • Joined: 23-October 12
I want to correct something I said earlier - I actually used a different program to decompile the lub files called ChunkSpy.exe. I couldn't figure out how to get luadec to work right.

I can also say that the compression level doesn't seem to matter at all. I changed the names of some files instead of editing them (since I can't seem to figure out what exactly I need to change in the lua files, or how to recompile them), and I repacked the arc using arctool.exe without using any special parameters. Despite nothing being changed but file names, my repacked .arc was a couple hundred KB bigger than the original file, and the game played just fine regardless. The only thing you have to make sure you do is only pack in the files you need - the first time I tried, I accidentally did it wrong and packed in an extra folder, which caused it to load no characters at all in the stage.

So through what little experimentation I tried, you can swap the names of the files (I.e., change silver.lub to blaze.lub within player.arc) to change one character into another without having to do any editing of the lua. It works flawlessly. The only problem I'm having now is that when I try to do this for Shadow, it messes things up really bad - for example, trying to switch him with Rouge resulted in Shadow's character model trying to do Rouge's moves without proper animations or even voice clips (neither Shadow's voice nor Rouge's - total silence). Trying to switch him with Omega caused the game to freeze. I can't figure out why this happens.

Could anyone offer tips on lua editing?

#11 User is offline Azu 

Posted 05 December 2012 - 12:31 PM

  • I must be stupid.
  • Posts: 1463
  • Joined: 23-February 08
  • Gender:Male
  • Location:Home

View Postwoun, on 02 December 2012 - 02:52 PM, said:

View Postrasgar, on 28 November 2012 - 10:40 PM, said:

To decompile the .lub files, I used this tool. There's another program that can be used to recompile them called luac, but I can't seem to find it anywhere. Which sucks.
Use it https://github.com/s...y/luadec51/wiki


I can't find any download other than the source.

#12 User is offline rasgar 

Posted 05 December 2012 - 03:28 PM

  • Posts: 7
  • Joined: 23-October 12

View PostAzu, on 05 December 2012 - 12:31 PM, said:

I can't find any download other than the source.


Hopefully these links will be helpful:

luadec
luac
ChunkSpy

#13 User is offline Irixion 

Posted 05 December 2012 - 09:47 PM

  • Posts: 1414
  • Joined: 30-December 04
  • Gender:Male
  • Location:Ontario, Canada
  • Project:Life
  • Wiki edits:152
Chunkspy? What's that for?

I've also tried contacting Melpontro and mephilestheD regarding some things and I've gotten nothing. Was hoping either one of them could shed some light on this whole thing. Even Link or PolygonJim...but I'm just hitting walls.

#14 User is offline rasgar 

Posted 05 December 2012 - 11:59 PM

  • Posts: 7
  • Joined: 23-October 12

View PostIrixion, on 05 December 2012 - 09:47 PM, said:

Chunkspy? What's that for?


Posted about it a while back:

View Postrasgar, on 05 December 2012 - 10:54 AM, said:

I want to correct something I said earlier - I actually used a different program to decompile the lub files called ChunkSpy.exe. I couldn't figure out how to get luadec to work right.


#15 User is offline woun 

Posted 07 December 2012 - 02:33 PM

  • Change your world
  • Posts: 49
  • Joined: 04-December 09
  • Gender:Male
  • Location:Vorkuta (n.), Russia

View PostIrixion, on 05 December 2012 - 09:47 PM, said:

Chunkspy? What's that for?

I've also tried contacting Melpontro and mephilestheD regarding some things and I've gotten nothing. Was hoping either one of them could shed some light on this whole thing. Even Link or PolygonJim...but I'm just hitting walls.

isn't mephilestheD, this is Mefiresu.

How to use ChunkSpy.exe (BTW, I use 5.0.2):
e.g.:
chunkspy script.lub > script.lua

Use NotePad++ to open lua files:
tadam
Posted Image
You can change it as soon as you want to import into the back .lub. You have to destroy the information from Pos and Hex Data.

UPD:
If you have any difficulties in hacking or want to use it. You can use the PM.
This post has been edited by woun: 07 December 2012 - 02:36 PM

  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users