Welcome
Ladies and Gents:

These forums are now closed and registration disabled.

Please join us at our new forum on Proboards. Our hope is that these new forums are more stable, provide more and better features, and allow continuation of the project forums in a safer, more secure, long term environment.

me3explorer.proboards.com

--The ME3Explorer Team

[It works!] Automated DLC File Injection

Coder-centric area for programming advice and questions.

[It works!] Automated DLC File Injection

Postby FemShep » 22 Apr 2013, 22:04

Update: It works, see my post here: http://me3tweaks.blogspot.com/2013/04/mod-manager-20-beta.html. I need you guys to help me test ME3Explorer and my mod manager to make sure there aren't bugs in ME3Explorer (my mod manager has some still)

Hi, I'm FemShep, I do a lot of MP modding, and now that DLC can be edited easier and without cracks, I want to update my Mod Manager to have support to command ME3 Explorer to inject files into DLC files. I've looked through the C# code (I don't write C#, I can sort of understand it, lots of dictionaries in there).

The way ME3EXP is written makes it so I can't just fire up a standalone copy of it, so I have to go through the GUI. Just wanted to get some opinions on how difficult it would be to be able to modify ME3 Explorer to support... maybe like command line arguments to call methods that open that file. I haven't looked at the entire source (it's quite large), but it looks like it doesn't take any command line operators right now, so it could be like
ME3Explorer -DLCEditor -Inject:"SFAR.file" "File1" "File2" "..." which would open up DLC Editor automatically and instruct it to inject. I've seen the methods to use but I'm just wanting some input on it, like if this seems like a good idea to have command line and automated methods. I'm thinking of also making a wave editor tool that will create some waves for MP, but I know ME3 Explorer is mainly SP so that might not be a good tool for ME3 Explorer.

Thoughts?
Last edited by FemShep on 28 Apr 2013, 21:52, edited 1 time in total.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: Automated DLC File Injection

Postby FemShep » 22 Apr 2013, 22:11

[Still can't see edit button]

Sorry, now that I look at it I think this belonged in the toolset suggestions area. Though I plan on trying this anyways.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: Automated DLC File Injection

Postby Renmiri » 22 Apr 2013, 22:31

Can you take a printscreen of your pc when you have the forum open ?
Renmiri
Emeritus
 
Posts: 207
Joined: 31 Aug 2012, 20:42
Has thanked: 141 time
Have thanks: 37 time

Re: Automated DLC File Injection

Postby FemShep » 22 Apr 2013, 22:42

Image

I'm logged in. Doesn't work on any of the 3 browsers, across 3 computers, adblock on or not.

EDIT: Changed theme (god it's even more hideous now) and I can see it.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: Automated DLC File Injection

Postby Renmiri » 23 Apr 2013, 01:17

good

ya, sorry about the theme, we haven't had time to bother with those
Renmiri
Emeritus
 
Posts: 207
Joined: 31 Aug 2012, 20:42
Has thanked: 141 time
Have thanks: 37 time

Re: Automated DLC File Injection

Postby FemShep » 23 Apr 2013, 01:43

I've started looking at the code and have identified the functions needed to automate the DLC injection, though it'll require a new ME3Explorer process for each new 'DLC file sfar' injection (just to make it simpler). My app will be able to just wait for it to exit after the automated injector closes the application.

It'll likely be ~week before I start hunkering down on it, I've made a few small edits and am learning how the program works.
Edit: 1 week = today, I've pretty much forked ME3Explorer (since someone won't let me make command line arguments) and have it auto-opening the sfar file and now am working through a script to get it to auto inject and close. It shouldn't take long, it's just a few extra if statements.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: Automated DLC File Injection

Postby FemShep » 27 Apr 2013, 01:18

I've linked up ME3Explorer and my new build of Mod Manager successfully. It now auto-injects files into the DLC and repacks them. It also backs up the original one (I'm working on making it check hashes to make sure it's backing up a real original one). It's.. a bit of a hack job, mainly I'm just adding an 'automated' if statement and simulating button presses.

Down the road I might make an auto TOC.bin updater part, where you do -tocbinupdate "toc.bin" "newfile1" "newfile2". It will automatically find and update the files for you, so all that's needed for a new build of a DLC coalesced mod is to recompile the coal file. My app will direct ME3Explorer to do the rest. That won't be in this build though.

Going to need some testers to help stress test it to make sure it works.
Also need SVN access so I can push it to a testing branch.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: [It works!] Automated DLC File Injection

Postby FemShep » 28 Apr 2013, 21:53

Updated the OP with my post about the new ME3Explorer build.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time

Re: [It works!] Automated DLC File Injection

Postby FemShep » 09 May 2013, 14:59

User that ran this with very low SSD space got this exception:

Code: Select all
************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at AmaroK86.MassEffect3.DLCBase.getStructure(Stream input) in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\AmaroK86\AmaroK86.MassEffect3.DLCBase\AmaroK86.MassEffect3.DLCBase\DLCBase.cs:line 132
   at AmaroK86.MassEffect3.DLCBase..ctor(String fileName) in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\AmaroK86\AmaroK86.MassEffect3.DLCBase\AmaroK86.MassEffect3.DLCBase\DLCBase.cs:line 155
   at ME3Explorer.DLCExplorer.openSfarFile(String fileName) in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\ME3Explorer\DLCExplorer.cs:line 160
   at ME3Explorer.DLCExplorer..ctor() in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\ME3Explorer\DLCExplorer.cs:line 84
   at ME3Explorer.Form1.dLCEditorToolStripMenuItem_Click(Object sender, EventArgs e) in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\ME3Explorer\Form1.cs:line 67
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.PerformClick()
   at ME3Explorer.Form1.Form1_Load(Object sender, EventArgs e) in f:\Dropbox\Mass Effect 3 Modding\ME3 Explorer Source SVN\ME3Explorer\Form1.cs:line 118
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
ME3Explorer
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///F:/ME3%20Modding%20Files/ME3%20Mod%20Manager%202rc2/ME3Explorer/ME3Explorer.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1002 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
PresentationCore
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.298 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
WindowsBase
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.298 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
AmaroK86.MassEffect3.DLCBase
    Assembly Version: 1.0.4873.16686
    Win32 Version: 1.0.4873.16686
    CodeBase: file:///F:/ME3%20Modding%20Files/ME3%20Mod%20Manager%202rc2/ME3Explorer/AmaroK86.MassEffect3.DLCBase.DLL
----------------------------------------
Gibbed.MassEffect3.FileFormats
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///F:/ME3%20Modding%20Files/ME3%20Mod%20Manager%202rc2/ME3Explorer/Gibbed.MassEffect3.FileFormats.DLL
----------------------------------------
AmaroK86.MassEffect3.DLCEditor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///F:/ME3%20Modding%20Files/ME3%20Mod%20Manager%202rc2/ME3Explorer/AmaroK86.MassEffect3.DLCEditor.DLL
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
Gibbed.IO
    Assembly Version: 1.0.4873.16686
    Win32 Version: 1.0.0.0
    CodeBase: file:///F:/ME3%20Modding%20Files/ME3%20Mod%20Manager%202rc2/ME3Explorer/Gibbed.IO.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Nobody else I know has seen this and I don't know how to reproduce it. From the code it sees that the header is right but then the number of blocks is 0, apparently. Going to try to get them to manually do it, but once that's done I don't know how to try to debug it.
Image
ME3Tweaks has modding guides, tools, forums for mods, a modding wiki, and ModMaker, an online mod creation tool.
ME3 Mod Manager, the civilized way of installing and managing ME3 mods.
ME3Tweaks Facebook Page
User avatar
FemShep
Modder
 
Posts: 1101
Joined: 18 Oct 2012, 20:48
Has thanked: 42 time
Have thanks: 76 time


Return to Coders' Help

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred