Forum Announcement, Click Here to Read More From EA_Cade.

@SIMGURUMODSQUAD : Converting pyo files to py

«1
jtravers88jtravers88 Posts: 591 Member
Would you please give a detailed explanation as to how we are expected to convert the optimized code in pyo files into normal py format in order to read it from the python 3 shell?

Comments

  • granthesgranthes Posts: 93 Member
    edited August 2014
    I'm not a simguru, but a 10 second google got me these links:
    http://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file-into-a-py-file
    and
    http://stackoverflow.com/questions/2438578/how-to-recovery-source-python-code-py-from-pyo-file

    More time with google should get you more details if that isn't sufficient.
    Grant (granthes)
    Developer of Sims 4 Modding Tools -- Sims 4 Stuff n Things
  • Srikandi715Srikandi715 Posts: 1,753 Member
    Don't forget to add " @SimGuruModSquad "! He has a lot of forums to look at now ;)
  • _A__A_ Posts: 56 Member
    @granthes If you had actually read the links you just posted and/or tried to decompile the pyo's then you'd know that they are in python 3.3. Only one of the tools mentioned in the links you posted even claims to work for that and it won't decompile the ones in this game. Your links aren't helping and your nasty attitude isn't either.
  • JordwalJordwal Posts: 50 Member
    This is one of the first threads in our brand new categorized forum and already there is someone doing the rude "google that and don't be a bother" thing. :( Can't you play nice?
  • granthesgranthes Posts: 93 Member
    edited August 2014
    _A_ wrote: »
    @granthes If you had actually read the links you just posted and/or tried to decompile the pyo's then you'd know that they are in python 3.3. Only one of the tools mentioned in the links you posted even claims to work for that and it won't decompile the ones in this game. Your links aren't helping and your nasty attitude isn't either.

    I'm sorry you seem to think I have a nasty attitude. But the original post showed no evidence of having looked for themselves. That in turn made the post seem quite rude and unproductive to me. Of course, that is just my opinion.
    Jordwal wrote: »
    This is one of the first threads in our brand new categorized forum and already there is someone doing the rude "google that and don't be a bother" thing. :( Can't you play nice?

    It is a programmer thing. Also known as RTFM. Why should a busy SimGuru help us if we don't show any evidence of having helped ourselves? To a programmer, the original post looked rude to me.

    I guess as a professional software developer I have a different expectation to what should be done before asking for help.
    Grant (granthes)
    Developer of Sims 4 Modding Tools -- Sims 4 Stuff n Things
  • _A__A_ Posts: 56 Member
    granthes wrote: »
    _A_ wrote: »
    @granthes If you had actually read the links you just posted and/or tried to decompile the pyo's then you'd know that they are in python 3.3. Only one of the tools mentioned in the links you posted even claims to work for that and it won't decompile the ones in this game. Your links aren't helping and your nasty attitude isn't either.

    I'm sorry you seem to think I have a nasty attitude. But your original post showed no evidence of having looked for yourself. That in turn made your post seem quite rude and unproductive to me. Of course, that is just my opinion.

    I'm not sure why you are quoting me while at the same time directing your rude comment to the original poster. Read up... I am not the original poster. The original poster has a very valid modding question that I hope the @SimGuruModSquad will answer.
  • JordwalJordwal Posts: 50 Member
    @granthes - It doesn't really matter what you do for a living. There are ways to respond to people that are helpful and polite vs rude and dismissive. I guess they don't teach that at college. I certainly hope you don't talk to people this way at work because I don't think it would win you any promotions.
  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hey all, let's keep this civil... this is a place for programmers and remember it's us against the world.

    One of the reasons we chose python is because it's pretty much an open book. Unfortunately we cannot release our raw source code. So pyo->py is an exercise for the reader, we know how clever you guys are. As I have mentioned previously, we have documentation coming but it will not cover this topic. As you guys figure things out more and have specific questions on the python side of things I will do my best to give you the info you need.
  • gibbedgibbed Posts: 3 New Member
    From "We support modding." to "Do it yourself." in record time. >:)
  • JordwalJordwal Posts: 50 Member
    edited August 2014
    Unfortunately we cannot release our raw source code..."
    "As I have mentioned previously, we have documentation coming but it will not cover this topic."
    As you guys figure things out more and have specific questions on the python side of things I will do my best to give you the info you need.

    @SimGuruModSquad This brings up lots of questions. Why can't you release the code or cover this topic in your documentation? And why do people have to have specific questions in order to get an answer? It is sort of how gibbed said. You said you were going to support modding but now you're backing away to this do it yourself stance. Why is that? It's so disappointing.

  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    I am just trying to be forthright with you guys, releasing source is not something we are prepared to do. I hope you can appreciate that we are doing work to help support modding via features in the game, documentation and these forums. But releasing source is not something that game makers typically do and I apologize if there was any implication that we planned to do so. Python is a well known open source scripting language, which should give you options for reverse engineering the information you need.

    We will provide more detailed information on the tuning system, which will allow a lot of modifications that historically would have been done via script on previous Sims games.
  • jtravers88jtravers88 Posts: 591 Member
    edited August 2014
    granthes wrote: »
    I'm not a simguru, but a 10 second google got me these links:
    http://stackoverflow.com/questions/5287253/is-it-possible-to-decompile-a-compiled-pyc-file-into-a-py-file
    and
    http://stackoverflow.com/questions/2438578/how-to-recovery-source-python-code-py-from-pyo-file

    More time with google should get you more details if that isn't sufficient.

    And it's obvious you spent about 10 seconds on your google search. I spent over an hour 'googling' how to disassemble pyo files to py files, that can then be read in the python 3 shell with the 'dis' command. I'm not finding anything that supports python 3 or runs in windows instead of Linux.
  • jtravers88jtravers88 Posts: 591 Member
    Hey all, let's keep this civil... this is a place for programmers and remember it's us against the world.

    One of the reasons we chose python is because it's pretty much an open book. Unfortunately we cannot release our raw source code. So pyo->py is an exercise for the reader, we know how clever you guys are. As I have mentioned previously, we have documentation coming but it will not cover this topic. As you guys figure things out more and have specific questions on the python side of things I will do my best to give you the info you need.

    I didn't ask you for the source code. And I have no plans of converting the pyo to py, changing it, then reoptimizing to pyo and thus replacing game code. I just want to be able to read the python. It appears to me that many pyo files have 'tuning' in their names.

    It's unfortunate that you perceive us as 'clever', and need to always do things with this attitude. But we are clever, and we will figure it out without your help.

    I didn't ask for your source, I asked a 'specific question on the python side of things', as you state in your response. So please do your best to give me the info that I need. What is your recommended solution for disassembling a pyo file?

  • jtravers88jtravers88 Posts: 591 Member
    edited August 2014
    granthes wrote: »
    I'm sorry you seem to think I have a nasty attitude. But the original post showed no evidence of having looked for themselves. That in turn made the post seem quite rude and unproductive to me. Of course, that is just my opinion.

    And your opinion is wrong. The evidence is in the very fact that I've resorted to the forum to ask the question.

    Now at some point, we'll need a solution to this. I'll try Easy Python Decompiler but I suspect it won't work. And I'll keep looking.
  • velocitygrassvelocitygrass Posts: 103 Member
    If it's a company rule or licensing issue that's preventing EA/Maxis from releasing raw source code, I'd assume that giving clear instructions how to retrieve the python code (even just for reading) from the pyo files would be in violation as well, which is unfortunate, but probably not something that SimGuruModSquad can change.

    I hope Easy Python Decompiler works (I downloaded it, but won't get the game until Thursday, so I can't test it for now).
  • jtravers88jtravers88 Posts: 591 Member
    # WARNING: Decompyle incomplete on every pyo file, after a few lines.
  • SimKureeSimKuree Posts: 39 Member
    Most decompilers you can find won't work for Python3.3. Even some programs that claim to support python 3.3 broke after several lines, Easy Python Decompiler being the example.

    It is true that python is open-source, but their rapid development and the lagging in community make decompiler incomplete in terms of Python 3.X. Just think about how many Python packages still target at Python 2, though it is true that Python 3 gains much performance improvement over Python 2.
    You can find my S4PE here.
  • JordwalJordwal Posts: 50 Member
    edited August 2014
    The problem doesn't seem to be that most decompilers won't work on Python 3.3. The problem seems to be that none will. This makes it sort of difficult to do anything except stand around saying I'd like to get at that code but there's nothing that will decompile it.

    ETA: Python 3.3 was released in 2012 and, apparently, in the years between then and now no one has managed to make something publicly available that will decompile it. This is sorta something that doesn't fall in the realm of modding a game. A person modding a game isn't going to be able to make a decompiler for this. Any suggestions EA?
  • MyreMylarMyreMylar Posts: 80 Member
    Where are you guys getting these compiled .pyo files from? Are they hidden in one of the CAS demo packages?
  • IngeJonesIngeJones Posts: 3,247 Member
    They are in the preload files from Origin.
  • MyreMylarMyreMylar Posts: 80 Member
    Ah. I'll have to wait until Amazon sends me the game then.
  • jtravers88jtravers88 Posts: 591 Member
    MyreMylar wrote: »
    Where are you guys getting these compiled .pyo files from? Are they hidden in one of the CAS demo packages?

    Sims4/data/simulation --> zips.

    So it's just as I suspected. They want to appear as if they are more willing to help modders when in reality they are limiting and controlling us as best they can. Why pyo files? Probably part of the decision was that it would be very difficult for us to get at the source. I'm not surprised.

    I've also tried unpyc3. Problem with marshalling. Doesn't work. I'm looking at pyREtic-master but haven't tried it yet. Not easy to set up.

    Thanks EA, for nothing.

    I'll find a way, or I'll stop being a supporter and avid fan after 10 years.


  • MyreMylarMyreMylar Posts: 80 Member
    Did you try the method at the end of this thread?

    http://www.modthesims.info/showthread.php?t=532279&goto=lastpost

    The posters seem to be reporting good results on the Sims files with the modified unpyc3.py.

  • jtravers88jtravers88 Posts: 591 Member
    I just read it before coming to read this thread. That is my thread too. I plan to try his version of unpyc3 today.
  • jtravers88jtravers88 Posts: 591 Member
    Anyone interested should reference that discussion linked by MyreMylar above. We're getting it done man.
Sign In or Register to comment.
Return to top