- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Tools >
- Python Script Decompiler (Version 1.1) (Written in Python)
- Site Map >
- Modding and Creation >
- Sims 4 Creation >
- Modding Tools >
- Python Script Decompiler (Version 1.1) (Written in Python)
Replies: 7 (Who?), Viewed: 9617 times.
#1
15th Sep 2014 at 4:41 AM
Last edited by ThatUsernameGuy : 21st Sep 2014 at 4:25 AM.
Posts: 4
Thanks: 5 in 1 Posts
Python Script Decompiler (Version 1.1) (Written in Python)
This is a Python decompiler for Sims 4, run it in the same folder as the python code you wish to decompile and it will decompile it. If any further help is needed refer to the readme or leave a comment below. (You should read the readme regardless.)Requirements:
Python 3.3
WARNING: I recommend you make backups of any files sharing a directory with this script. I am not liable for any damage caused.
Version 1.5.6 includes a folder called compileBox, which will compile an .py files inside it when the "compile.py" script is ran.
- Make sure not to leave important .pyo files in there or they will be erased.
- As for now, files with more than 15 characters (Not including the extension.) in their name will be cut to that point. (Don't know how this works or how to fix it, Python's decompileall module works in silly ways.)
Version 1.5.6 (As of 3:12 on Sunday, September 21, 2014 - UTC) has fixed the first bug. Previous to this patch I had forgotten to put input() at the end of the script, meaning the Python window would close when the script finished, preventing you from seeing the variables listed and any errors the program encountered.
- The script should have a fair few scripts that didn't decompile, this is due to "unpyc3.py" not being able to decompile them and cannot be fixed within my own script.
Attached files:
pyDecompileVer1.5.5.zip (16.0 KB, 196 downloads) - View custom content | ||
4790 09-19-2014 13:41 pyDecompileVer1.5.5 - firstRelease.py 64257 09-16-2014 02:04 unpyc3.py 825 09-19-2014 14:08 pyDecompile README.txt --------- ------- 69872 3 files |
||
pyDecompileVer1.5.6.zip (16.6 KB, 1468 downloads) - View custom content | ||
0 09-20-2014 18:02 compileBox/ 780 09-20-2014 18:02 compileBox/compile.py 825 09-19-2014 14:08 pyDecompile README.txt 4799 09-20-2014 19:55 pyDecompileVer1.5.6 - inputAtEnd.py 64257 09-16-2014 02:04 unpyc3.py --------- ------- 70661 5 files |
5 users say thanks for this.
(Who?)
Thanks
Advertisement
Test Subject
#2
15th Sep 2014 at 5:46 AM
Posts: 45
While I cannot say for sure, you are not doing anything with the output of the unpyc3.decompile string. unpyc3 does not write to any files by default and when run from command line just outputs to stdout. Maybe you want to open a file and write the string to it? What would be useful in general if you are going to do this is probably read the zip files directly; get the file structure from that and output the contents to a folder . Or use os.walk and recursively walk through the pyo files and write the py files or something.
Scholar
#3
20th Sep 2014 at 10:31 AM
Posts: 1,466
I used your script and decompiled successfully. Now I found an interesting thing in file Simulation\Sims\Housholds.py:
MAXIMUM_SIZE = Tunable(int, 8, description='Maximum number of Sims you can have in a household at a time.')
I like to increase the number of sims on a lot from 8 to 10. How do I do that? Lots of tutorials on decompiling but compiing but not the opposit.
Found this but.....?
https://docs.python.org/3/library/p...l?highlight=pyo
MAXIMUM_SIZE = Tunable(int, 8, description='Maximum number of Sims you can have in a household at a time.')
I like to increase the number of sims on a lot from 8 to 10. How do I do that? Lots of tutorials on decompiling but compiing but not the opposit.
Found this but.....?
https://docs.python.org/3/library/p...l?highlight=pyo
#4
20th Sep 2014 at 1:43 PM
Posts: 3,552
Thanks: 55521 in 750 Posts
There is an XML on that. I might suggest tuning the Xml number first, and see if it works or not. It's ten times simpler than using Scripting to do the exact same thing.
MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
MedievalMods and Sims3mods: Dive Cave Reset Fix, Resort Revamp, Industrial Oven Revamp, Will O' Wisp fix, UI Sounds Disabled, No Cars, Gnome Family Planner, Townies Out on the Town, No Martial Arts Clothes, Fast Skilling, etc. http://simsasylum.com/tfm/
Scholar
#5
21st Sep 2014 at 12:13 AM
Last edited by Morphar : 21st Sep 2014 at 12:30 AM.
Posts: 1,466
Quote: Originally posted by Shimrod101
There is an XML on that. I might suggest tuning the Xml number first, and see if it works or not. It's ten times simpler than using Scripting to do the exact same thing. |
I was just out for the correct syntax of the compile command so a bad example by me. I found an answer in another thred. Someone just asked the same thing:
http://modthesims.info/showthread.php?t=535142
So if I compile that .py file, zip it and place the zip-file in the Mods directory will override the orginal funktion?
#6
21st Sep 2014 at 2:20 AM
Posts: 4
Thanks: 5 in 1 Posts
Quote: Originally posted by Morphar
I was just out for the correct syntax of the compile command so a bad example by me. I found an answer in another thred. Someone just asked the same thing: http://modthesims.info/showthread.php?t=535142 So if I compile that .py file, zip it and place the zip-file in the Mods directory will override the orginal funktion? |
Sorry for not getting back to very quickly. If you check, the newest update comes with a compile script. It may be of use as is, or to dissect for it's code. As for how Sims 4 handles mod code, I'm not entirely sure. I have no experience with the game itself yet. You might have luck asking some of the script modders on the site, as can be found here: http://modthesims.info/browse.php?f...gameOrig=1&gs=4
Test Subject
#7
27th Sep 2014 at 7:51 PM
Last edited by Gh0st_wires : 27th Sep 2014 at 9:34 PM.
Posts: 3
it doesn't seem to decompile anything useful. i only got 2 .py files out of it and there is nothing interesting i can derive from them. This may seem weird but im just running it in a virtual env on my linux machine. I haven't look at the code yet i just ran it. Is there something in your code that would prevent me from running it in the way im running it.
#8
2nd Oct 2014 at 2:58 AM
Posts: 4
Thanks: 5 in 1 Posts
Quote: Originally posted by Gh0st_wires
it doesn't seem to decompile anything useful. i only got 2 .py files out of it and there is nothing interesting i can derive from them. This may seem weird but im just running it in a virtual env on my linux machine. I haven't look at the code yet i just ran it. Is there something in your code that would prevent me from running it in the way im running it. |
Not that I know of, but I don't run Linux or a virtual OS, so I wouldn't know. The script was written so as not to exclude any particular operating system or file system, but testing is limited to my personal computer, which runs Windows 7.
Who Posted
|