Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Lab Assistant
Original Poster
#1 Old 5th Nov 2014 at 7:49 PM Last edited by mgomez : 12th Nov 2014 at 5:10 PM.
Default A (more) automated decompiler for *all* Sims 4 sources.
Tired of fiddling with a bunch of files and going through hell to decompile them every time there's an update? Well, ever since Sims 4 patched in pools, I said "to hell with it!" and wrote a script that does the job pretty damn well.

It requires TheHologramMan's "unpyc3" decompiler (forum post here) and 7-zip installed on your computer in order to work. Here's how to use it:

- Put "de.py" in the attached zip inside of your Python33 directory.
- Edit "de.py" in whatever editing program you want and change SIMS4_FOLDER to whatever folder Sims 4 is stored in. Set TEMPDIR to the location of a temporary directory you have created for the storage of Sims 4 decompiled files, and set ZIPPROGRAM to the directory (including the file name) for 7z.exe (7zip).
- Run Python.exe in your Python33 directory.
- Type "import de"
- Type "de.domagic()"

This script extracts the base, core, and simulation zip files into a temprary directory, then grabs each PYO file, decompiles it, stores the decompiled data into a PY file, then deletes the PYO file on success. NOTE: Some PYO files cannot be decompiled by unpyc3. In that case, I have programmed this script to just ignore it and move on.

Once everything is done, the next time Sims 4 comes out with an update, all you have to do is type "import de" and "de.domagic()" in your Python console and that's it!
Attached files:
File Type: zip  Mgomez's Automatic Decompiler.zip (844 Bytes, 923 downloads) - View custom content
7 users say thanks for this. (Who?)
Advertisement
Pettifogging Legalist!
retired moderator
#2 Old 6th Nov 2014 at 3:00 AM
Hi there!

Is the unpyc3.py in your upload the same as the one by TheHologramMan? If so, can you please link to it instead of re-uploading? (Unless you talked to him already and he thinks this makes more sense -- I wouldn’t know, I just think duplicates are not really a good idea unless the author says otherwise)

If you have edited it, please also include a direct link to the original in your post (when people want to compare it in order to see what is changed / how you did it, that makes it easier for them to find it .. it is somewhere in this thread http://modthesims.info/showthread.php?t=532279 I think).

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Lab Assistant
Original Poster
#3 Old 12th Nov 2014 at 5:11 PM
Quote: Originally posted by plasticbox
Hi there!

Is the unpyc3.py in your upload the same as the one by TheHologramMan? If so, can you please link to it instead of re-uploading? (Unless you talked to him already and he thinks this makes more sense -- I wouldn’t know, I just think duplicates are not really a good idea unless the author says otherwise)

If you have edited it, please also include a direct link to the original in your post (when people want to compare it in order to see what is changed / how you did it, that makes it easier for them to find it .. it is somewhere in this thread http://modthesims.info/showthread.php?t=532279 I think).


I have edited the post to reflect this request for revision. Attachment has also been edited so that unpyc3.py is removed, and the file is linked to along with the forum post where THM fixed it.
Pettifogging Legalist!
retired moderator
#4 Old 12th Nov 2014 at 5:48 PM
Thank you!

Stuff for TS2 · TS3 · TS4 | Please do not PM me with technical questions – we have Create forums for that.

In the kingdom of the blind, do as the Romans do.
Scholar
#5 Old 21st Dec 2014 at 6:09 PM
I've made a few changes to support decompiling the Deployed and Generated archives. Sometimes, scripts won't compile because they need resources from those archives.

Add the following:

Code:
def extract_other_archive(name):
	subprocess.call(ZIPPROGRAM + " x \"" + SIMS4_FOLDER + "\\Game\\Bin\\Python\\" + name + ".zip\" -o" + "\"" + TEMPDIR + "\\" + name + "\"")

def domagic():
	extract_sims_archive("base")
	extract_sims_archive("core")
	extract_sims_archive("simulation")
	extract_other_archive("deployed")
	extract_other_archive("generated")
	rundecompile()

1/8/2016: New avatar! Pre-censored for EA's approval.
3/19/2015: Teens are too close to YAs. EA needs to either shorten the teens, or add preteens and make YAs look older.
Back to top