SADX/SA1 Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 15, 2009.

  1. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://x-hax.cultnet.net/MainMemory/SADXMDL.7z" target="_blank">SADXMDL 0.75</a> adds animation viewing, it doesn't seem to be perfect, but it's good enough.

    Check the 'Load Animation' checkbox and enter an address or you'll just get the model by itself.
    The 'Load model from animation' box will disable the model address input and load the model referenced by the animation instead. You'll have to leave this unchecked if you want to see Metal Sonic with animations.

    The [ and ] keys go backwards and forwards through the animation respectively.

    Also, the (very small) list of animations is at <a href="http://info.sonicretro.org/SCHG:Sonic Adventure DX: PC/Model Editing#Animation Locations" target="_blank" style="background: url(http://info.sonicretro.org/images/5/50/Reticon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">SCHG:Sonic Adventure DX: PC/Model Editing#Animation Locations</a>.
     
  2. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    [​IMG]
    [​IMG]

    That export was handled almost entirely by the revised exporter script. The only hex editing involved was actually placing it in sonic.exe, and fixing a minor sadxmdl_porter bug that I ran into. The script itself works perfectly now, so I'll be releasing a new version with tutorial soon.
     
  3. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    No new tutorial but <a href="http://x-hax.cultnet.net/dudetoolsv1_5.rar" target="_blank">The new exporter is part of Dude's Model Tools v 1.5</a>

    As you imagined, this script exports a single *.nj file that you run through sadxmdl_porter, then paste into sonic.exe wherever you told the porter you were going to. This should cut level production time at least in half. I absolutely love this thing. I'll be making it independent of sadxmdl_porter soon, as sadxmdl_porter is still very buggy.

    OH and the most important thing... The output directory CANNOT have spaces. I recommend exporting to the drive's root to avoid problems, as its the simplest directory name.

    oh and re-download it if you already got it... I fixed a bug.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://info.sonicretro.org/File:SADXTweakerR11.zip" target="_blank">SADXTweaker R11</a> adds the following features:
    Extender can add space to your exe without needing to touch PEInfo. It will also fix the .data section so that programs will be able to read pointers to data after it. All you need to do is specify a size in hex for the .data2 section, and it'll do everything for you.
    There's also a freespace manager which will keep track of the unused areas of your exe as you move/delete/add data. This feature allows the Object list editor, Object texture list editor and Trial level list editor to expand and shrink lists, instead of just replacing the data that's there.
    The data needed for the freespace manager will be stored in a file with the same name as your exe + .fsp, sonic.exe.fsp. This file simply lists start and end addresses for each area of free space.

    If you have already extended your exe, you will probably want to add the existing free space to the fsp file yourself.
     
  5. Endgame

    Endgame

    Formerly The Growler Member
    I've only just recently reinstalled SA:DX, but without having to go through 101 pages, could you please tell me where to put the Sonic.ct file?
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    Probably in the same folder as Cheat Engine.
     
  7. Endgame

    Endgame

    Formerly The Growler Member
    <!--quoteo(post=458254:date=May 23 2010, 06:20 PM:name=MainMemory)--><div class='quotetop'>QUOTE (MainMemory @ May 23 2010, 06:20 PM) <a href="index.php?act=findpost&pid=458254">[​IMG]</a></div><div class='quotemain'><!--quotec-->Probably in the same folder as Cheat Engine.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Oh sorry, which one's the Cheat Engine in those links on the first page - or do I need to go elsewhere to find it?

    All I can see is the .CT file (on its own), then SETedit, SADXTweaker, and SADXLVL.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://cheatengine.org/" target="_blank">http://cheatengine.org/</a> although you may want the Trainer instead (which I really should update sometime)
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://x-hax.cultnet.net/MainMemory/SADXMDL.7z" target="_blank">SADXMDL 0.8</a> adds:

    F2 to open a new file
    F3 to open a new model/animation from the current file
    P to play the animation at 30fps

    And a Hex checkbox for the model address, since Dude's tools all use decimal >_>.
     
  10. Aquaslash

    Aquaslash

    Emerald Dragoon Moderator
    2,818
    0
    16
    Hampton, VA
    The S Factor: Sonia and Silver
    For anyone interested, <a href="http://www.fileden.com/files/2007/4/11/975179/V_SHADOWTAILS_E_BANK06.dat" target="_blank">here's a Sonic and Tails Voice Bank that replaces Sonic with Shadow</a>. Since apparently the packer WAS made, and I just found it yesterday.

    Feel free to use, and if you want the 4kids voice, you're a faggot.

    Oh, and you'll obviously have to rename either the file itself or the reference to it.
     
  11. PsychoSk8r

    PsychoSk8r

    PsychedelAnt | Tone Turner Oldbie
    2,582
    3
    18
    Birmingham, UK
    30 Day Project: Revisited.A New Release!
    Nice, that'll work well with Dude's old hack. =P
     
  12. This looks interesting. Can't wait to see what people do with it :rolleyes:
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://info.sonicretro.org/SADXLVL#v4.8" target="_blank">SADXLVL v4.8</a> is now available!

    I would like to note that the .obj export is half-broken at the moment regarding UV coordinates, and I don't know why.
     
  14. Woofmute

    Woofmute

    Y and -Y and XYZ-X-Y-Z. Member
    184
    0
    16
    Hacking and researching Rez.
    I should look at this more than I do. I think I'm still using one of the close to first releases of SADXLVL.

    Well, with nothing more to contribute other than 'This is turning out to be even more awesome than I imagined it being, keep it up!' I'll leave now.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <a href="http://x-hax.cultnet.net/MainMemory/SADXMDL.7z" target="_blank">SADXMDL 1.0</a>
    Now it has a menu, a treeview, and Advanced Info window, .obj export with broken UVs.

    Also, <a href="http://info.sonicretro.org/SCHG:Sonic Adventure DX: PC/Model Editing" target="_blank" style="background: url(http://info.sonicretro.org/images/5/50/Reticon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">SCHG:Sonic Adventure DX: PC/Model Editing</a> is being updated frequently with new model locations by the members of #x-hax, specifically myself and Aquaslash.
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec--><&MMBot> Current SADXLVL version: 4.87
    <&MMBot> Updates:
    <&MMBot> Importing a .vt file no longer requires reloading the level.
    <&MMBot> .nj importing added, for EXE only. Uses same code and fsp file as SADXTweaker to find/create free space. *fixed
    <&MMBot> Run option added to File menu, allows you to play your game.
    <&MMBot> Show Animated option added to View menu.
    <&MMBot> Puyo Tools updated to 1.0.7.
    <&MMBot> Updated 11:05 PM 6/22/2010<!--QuoteEnd--></div><!--QuoteEEnd-->
    Finally I've done it. SADXLVL can import .nj files of any size over any model, provided that you have enough space somewhere in your EXE to put it. As noted, this works exactly the same way SADXTweaker does, so any space freed by using one program will be available to the other, and SADXLVL is able to expand the EXE if there is not enough space.

    Both the nj file and the model in the EXE have to start with the MATERIAL struct and end with the ATTACH struct.
     
  17. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    NJKey isn't the best solution... I'll be releasing an exporter update very soon. Also, if you have the sa2dx team's custom exporter build, set the key to 0 on export and it'll work fine.
     
  18. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Also, I tried importing an nj file and got this error: Arithmetic operation resulted in an overflow
    Code (Text):
    1. See the end of this message for details on invoking
    2. just-in-time (JIT) debugging instead of this dialog box.
    3.  
    4. ************** Exception Text **************
    5. System.OverflowException: Arithmetic operation resulted in an overflow.
    6. &nbsp;&nbsp; at SAModel.MESH.MESH..ctor(Byte[] file, UInt32 address, FileTypes type) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SAModel\Model.vb:line 0
    7. &nbsp;&nbsp; at SAModel.MESH..ctor(Byte[] file, UInt32 address, UInt16 Count, FileTypes type) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SAModel\Model.vb:line 326
    8. &nbsp;&nbsp; at SAModel.ATTACH..ctor(Byte[] file, UInt32 address, FileTypes type) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SAModel\Model.vb:line 387
    9. &nbsp;&nbsp; at SAModel.OBJECT..ctor(Byte[] file, UInt32 address, FileTypes type, OBJECT& Parent) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SAModel\Model.vb:line 418
    10. &nbsp;&nbsp; at SADXLVL.COL.COL..ctor(Byte[] file, UInt32 address, FileTypes type) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SADXLVL\Form1.vb:line 1472
    11. &nbsp;&nbsp; at SADXLVL.Form1.ReloadCOL(Int32 index) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SADXLVL\Form1.vb:line 1210
    12. &nbsp;&nbsp; at SADXLVL.Form1.ImportnjFileToolStripMenuItem_Click(Object sender, EventArgs e) in C:\Users\Mike\Documents\Visual Studio 2008\Projects\SAModel\SADXLVL\Form1.vb:line 1238
    13. &nbsp;&nbsp; at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
    14. &nbsp;&nbsp; at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
    15. &nbsp;&nbsp; at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
    16. &nbsp;&nbsp; at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
    17. &nbsp;&nbsp; at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
    18. &nbsp;&nbsp; at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
    19. &nbsp;&nbsp; at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
    20. &nbsp;&nbsp; at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
    21. &nbsp;&nbsp; at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    22. &nbsp;&nbsp; at System.Windows.Forms.Control.WndProc(Message& m)
    23. &nbsp;&nbsp; at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
    24. &nbsp;&nbsp; at System.Windows.Forms.ToolStrip.WndProc(Message& m)
    25. &nbsp;&nbsp; at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
    26. &nbsp;&nbsp; at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    27. &nbsp;&nbsp; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    28. &nbsp;&nbsp; at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    29.  
    30.  
    31. ************** Loaded Assemblies **************
    32. mscorlib
    33. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    34. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3603 (GDR.050727-3600)
    35. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    36. ----------------------------------------
    37. SADXLVL
    38. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.0.0
    39. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 1.0.0.0
    40. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/SADX/SADXLVL/SADXLVL.exe
    41. ----------------------------------------
    42. Microsoft.VisualBasic
    43. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 8.0.0.0
    44. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 8.0.50727.3053 (netfxsp.050727-3000)
    45. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
    46. ----------------------------------------
    47. System
    48. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    49. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    50. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    51. ----------------------------------------
    52. System.Windows.Forms
    53. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    54. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    55. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    56. ----------------------------------------
    57. System.Drawing
    58. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    59. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    60. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    61. ----------------------------------------
    62. System.Runtime.Remoting
    63. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    64. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    65. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Runtime.Remoting/2.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
    66. ----------------------------------------
    67. Microsoft.DirectX.Direct3D
    68. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.2902.0
    69. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 9.05.132.0000
    70. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3D/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.Direct3D.dll
    71. ----------------------------------------
    72. SAModel
    73. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.0.0
    74. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 1.0.0.0
    75. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/SADX/SADXLVL/SAModel.DLL
    76. ----------------------------------------
    77. Microsoft.DirectX
    78. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.2902.0
    79. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 5.04.00.2904
    80. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
    81. ----------------------------------------
    82. Rat234
    83. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.0.0
    84. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 1.0.0.0
    85. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/SADX/SADXLVL/Rat234.DLL
    86. ----------------------------------------
    87. System.Web
    88. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    89. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3614 (GDR.050727-3600)
    90. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
    91. ----------------------------------------
    92. System.Configuration
    93. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    94. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3053 (netfxsp.050727-3000)
    95. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    96. ----------------------------------------
    97. System.Core
    98. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 3.5.0.0
    99. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 3.5.30729.1 built by: SP
    100. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
    101. ----------------------------------------
    102. System.Xml
    103. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 2.0.0.0
    104. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 2.0.50727.3082 (QFE.050727-3000)
    105. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    106. ----------------------------------------
    107. Microsoft.DirectX.Direct3DX
    108. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.2911.0
    109. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 9.12.589.0000
    110. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.DirectX.Direct3DX/1.0.2911.0__31bf3856ad364e35/Microsoft.DirectX.Direct3DX.dll
    111. ----------------------------------------
    112. Microsoft.VisualC
    113. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 8.0.0.0
    114. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 8.00.50727.3053
    115. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Microsoft.VisualC/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualC.dll
    116. ----------------------------------------
    117. puyo_tools
    118. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.0.0
    119. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 1.0.0.0
    120. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/SADX/SADXLVL/puyo_tools.EXE
    121. ----------------------------------------
    122. VrSharp
    123. &nbsp;&nbsp;&nbsp;&nbsp;Assembly Version: 1.0.0.0
    124. &nbsp;&nbsp;&nbsp;&nbsp;Win32 Version: 1.0.0.0
    125. &nbsp;&nbsp;&nbsp;&nbsp;CodeBase: file:///C:/Documents%20and%20Settings/Owner/My%20Documents/SADX/SADXLVL/VrSharp.DLL
    126. ----------------------------------------
    127.  
    128. ************** JIT Debugging **************
    129. To enable just-in-time (JIT) debugging, the .config file for this
    130. application or computer (machine.config) must have the
    131. jitDebugging value set in the system.windows.forms section.
    132. The application must also be compiled with debugging
    133. enabled.
    134.  
    135. For example:
    136.  
    137. <configuration>
    138. &nbsp;&nbsp;&nbsp;&nbsp;<system.windows.forms jitDebugging="true" />
    139. </configuration>
    140.  
    141. When JIT debugging is enabled, any unhandled exception
    142. will be sent to the JIT debugger registered on the computer
    143. rather than be handled by this dialog box.
    I was trying to load this file: <a href="http://x-hax.cultnet.net/out.nj" target="_blank">http://x-hax.cultnet.net/out.nj</a>

    to replace model C0F8D0
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    The problem is that I was checking whether the nj file's VColor address was 0 to determine whether I needed to adjust the UV pointer.

    I fixed it.

    Edit: But I forgot to remove the code that automatically selects model C0F8D0 if it's used in a level. It's nothing big, and I think it might actually be useful to be able to select a model by SEG address in the next update.
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,525
    133
    43
    SonLVL
    It should now be able to figure out the key for the nj file, and I added the option to select by address.