Jump to content
GoaSkin

adding features to the EXE

66 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online: A long, long time ago... 
 

I disassembled the binary to examine some game functions. Classes that generate vehicles or menus are easy to understand and very simple.

With a few lines of new code, we could add new game menus or new types of vehicles using included classes as reference. 

The only problem is that jump instractions force the functionality to continue on specific positions in the binary. If there is something added in the middle, all the following code shifts to another position what means that all the addresses have to been updated. Manually, that´s only possible in very small programs.

Are there useful programs that automate that?

Is it possible to source new classes out into DLLs?

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

The problem is that (in most games anyways, most probably the same with SC4) it's illegal to reverse-engineer or modify the exe. It's a pity, since so many things could be added to so many games by modding the exe.

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    Reverse-engineering binaries is only illegal in the USA. I live in Europe.

    A patch for new features that does not include original code itself should also be no problem and if we have something usable, we can ask Maxis for permission.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    doesnt buggi have close ties with them? although hes been MIA for a while..

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Originally posted by: GoaSkin I disassembled the binary to examine some game functions. Classes that generate vehicles or menus are easy to understand and very simple.

    With a few lines of new code, we could add new game menus or new types of vehicles using included classes as reference. 

    The only problem is that jump instractions force the functionality to continue on specific positions in the binary. If there is something added in the middle, all the following code shifts to another position what means that all the addresses have to been updated. Manually, that´s only possible in very small programs.

    Are there useful programs that automate that?

    Is it possible to source new classes out into DLLs?

    quote>

    one way is from where you want to put your new code put a jmp to the end of the program

    at that new adress, write the old asm instruction ( the one you have replaced by jmp ), then the new ones, then finished by a jmp to the adress after the initial jmp. This way all original adresses are still correct

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    yes ill tonkso thats what i thought if no profit is made on is not distributed it is not illeagle... but action can still be taken

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I think the whole "is it legal to modify the exe" thing has been beaten to death over and over. Someone should just do it already. Imagine how much more can be done. Many games are modded and total conversions are available, I dunno why SC4 hasn't gotten to that threshold yet. If I could do it, I would have already, ahh well. All this talk is useless unless someone does it, otherwise, why keep posting stuff like this?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I'm convinced the person who coined the phrase "intelectual property" was being ironic.

    Anyway, I hope this is possible. That would be wonderful for adding new features.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I would very much like the exe to be modified, but i'm not so sure EA would like it.

    Many games have total conversions and other substantial mods, however these tend not to touch the exe.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Before anyone else makes a judgement on the legality of this, how about they listen to those who know what they are talking about, better yet wait for official word from someone with the company.

    I would hate to see this project put down by a bunch of ignorant people who don't anything about the law.

    Talking to maxis/ea would be a good idea. After all, theyve been cool to us before, and if they say no, well then at least we know for sure

    As for my $.02, I'll just follow my own advice and keep my mouth shut. But besides that, awesome! I hope this happens

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Ok, i am in no way an expert on this. But i do know how just about every commercial game's EULA forbids reverse-engineering and the like.

    But asking EA/Maxis sounds like a good idea, there's nothing to lose. 4.gif

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Originally posted by: GoaSkin Reverse-engineering binaries is only illegal in the USA. I live in Europe.quote>
    It's not illegal ANYWHERE.  Copyright laws are meerly a civil matter, and piracy laws only cover for-profit operations.

    And actually, I beleive once the software has been abandoned or becomes 7 years old, there is significantly more lattitude in what can be done and redistributed (freely).

    And, if it could be made to patch the game, so only new materials were distributed to alter existing versions of the game, there is no legal problem with this....though significant technical barriers exist as I understand it.

    Originally posted by: Elukka Ok, i am in no way an expert on this. But i do know how just about every commercial game's EULA forbids reverse-engineering and the like.quote>
    And all EA would have to do is prove before a judge that you 1) read it, 2) understood it, 3) adequately conveyed this to EA so they could legitimately bring charge.  Since that cannot be proven, EA won't touch that because it is harrassment of you by them.  EULAs are unsigned, unilaterally issued "agreements"...They simply cannot hold up in a business bringing suit against a consumer.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    It should be legal while all the code you distribute does not contain anything what is copied from the original. Antivirus-Software, Resource Editors (programs to replace embedded sounds, pictures etc. by serious companies like Borland or Symantec) also do not make other things. If we ever create a program to patch, it would do nothing than jumping to specific positions and add/replace there a small number of bytes.

    For copy-protections, there is a special law. Same for all encrypted things. There is nothing to decrypt before it

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I am by no means an expert Hampster, but this topic has been around before. In the last one everyone said we should contact EA. Did it happen? Did we get a reply? How long are we going to wait for a reply? Either we keep contacting them or we don't do it at all. Contacting them once every year won't solve anything I believe. I am sorry for being pessimistic, but I just don't see this happening (I would like it too though). We should make up a petition or something that every member here can email to them.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    GoaSkin, that's absolutely fantastic.  I agree with you that actually having something to show Maxis will make much more of an impression than just flooding them with e-mails.  That's rather interesting that the code is user-friendly. 

    I don't know much about programming at all--probably the most advanced thing I've done is a little bit of hex-editing as part of my transit modding, and I had done a little work with Basic a number of years ago.  Obviously, the game can read DLLs as plugins, as evidenced by what Buggi has done.  In my limited knowledge, I don't know exactly how that DLL is structured, but I would imagine that it could be used as a reference point?  If I'm making no sense whatsoever, feel free to let me know.

    If I could help you out with this project, I would.  You've just inspired me to take up C++.  2.gif

    -Tarkus

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Hi goaskin

    i appreciate the effort you are taking, and i did a little research:

    http://en.wikipedia.org/wiki/Software_cracking (note to Mods: dont ban me for this, it is only a explanation of what it is and whether it is legal or not)

    my english isnt that good, but i think it is not allowed, i hope a native English speaker can translate this into English understandeble for us 2.gif

    regards

    Meastro444

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    By the WP definition, this would not be software cracking. I assume serial numbers and the like are not being removed. And the copy protection will not be altered. My guess is that the end result will be a program to edit the exe, rather than replace it. I agree that the best way to go about it would be to make something work, and then contact EA to see if they'll let it be distributed. I think there's a good chance of it.

    Oh, and Meastro444. Don't worry about your English. It was fine. You have much better English than many Americans. (Though some might make the argument that they aren't native English speakers... 3.gif)

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    I was searching for relations bethween OccupantGroups that describe the menu placing of LOTs and the classes that are set in the UI files to open that submenu and I could not find relations. Currently, it may only be easy to open menus to place non-building stuff (traffic drawers, puzzle piece rings, terrain tools etc.) that are called by SubmenuKeys.

    For example, regarding airports, the occupant group is checked only one time in method

    cSC4ViewInputControlQuery.GetBuildingOccupantTipInfo

    0021da16 cmpl $0x00001508,(%edi,%edx,4)

    The GZ class ID of that button is handled in two other functions:

    cSC4View3DWin.DoTransportMenu:

    0052af75 cmpl $0xa99234a6,%eax

    cSC4View3DWin.HandleButtonActivated:

    0052efe7 cmpl $0xa99234a6,%ebx

    No relations to find out with my knowledge, the OccupantGroup and the class that have relations are used in completely different functions where I cannot see that one calls the other.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Patching the executable on your own machine and distributing the patch to friends may not be illegal, but if one of us does it, what stops others from doing it as well, and publishing?

    If there is no co-ordination on this, it can lead to chaos.  Each fix has to be done with respect to all the others.  Taking a patch to the "end of the program" is fine, but what if it isn't any more?

    Who will co-ordinate this?  Who will watch the watcher?  Who will QA this?

    I suspect that EA will be very averse to this, and may even cut their cordial relationship with Simtropolis.


    Beware: Emancipated user.  No Windoze for me.
    The teacher opens the door but the student must enter himself. - Ancient Chinese Saying

    Every minute of hate in which one indulges oneself is sixty seconds of happiness lost.
    Music expresses that which cannot be put into words and that which cannot remain silent. -- Victor Hugo
    If you always do what you've always done, you'll mostly get what you've always got.
    JohnNewSig.gif
    "We have met the enemy, and he is us" - Walt Kelly

    Come join us at the Moose Factory

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Originally posted by: N_O_Body

    I suspect that EA will be very averse to this, and may even cut their cordial relationship with Simtropolis.quote>

     

    And they've done what for us lately? One expansion pack and then it was fold up time and let the official site fall apart. If it weren't for the community Sim City would be a forgotten memory at this point. If they get their panties in a knot, so long as no laws are broken, who cares.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Taking a patch to the "end of the program" is fine, but what if it isn't any more?quote>

    There is always an end, as far as the adress of the 'end' is not hardcoded in the patch you can have more than one patch

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     
    a generic question: Is it possible to use the assembler jumping commands like jmp, je or jn to address any file position of the binary you want or is it limited to positions inside the same class? I don

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    To be honest last time I coded in asm was in 1996, so this may be a bit outdated 4.gif

    at that time

    jmp allow you to jump to any adress

    je/jne jg/jl allow you to jump to an offseted adress. The offset was coded on a 8bit value, allowing to jump to -0x80 to +0x7f from the actual adress

    I bet the instructions set has evolved since then 4.gif

    For the Dll, you'll have to figure out the dll header, there is only one exported function in Buggy's dll. You'll need to find the others informations by studying the asm

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     

    I am working on the Mac binary at the moment and there, je and jne allow to jump to any address too and also to offset addresses. There are different parameters after the instruction and sometimes characters: * % $ printed before the destination in the disassembled code.



    question about the windows binary: If all the patches are installed, is the EXE then the same for everyone or are there still different versions for different regions? If so, possibly four windows patches are needed.

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online: A long, long time ago... 
     
    A first success:
    menuneu.jpg

    With the help of a custom UI file by ArkenbergeJoe with additional menu button, I have successfully moved all the custom interchange buttons of the NAM into a new submenu. But that was easier than the other things to do...

    For menu UI files, there are two item ID properties that normally link to the highway menu:

    0x00000031 like set for the original highway menu and 0x2B730C5B, the class-ID for avenues. The class-IDs for each network types are all well-known because they are used very often in the contents of DAT files. The standard menu buttons call submenus by using the same IDs. Because there are only six submenus in the network menu but more network types that have their classes we tried if we can have new menus by adding buttons with these unused IDs two years ago.

    Once, we found out that GZclsid 0x2B730C5B illustrates the same like 0x00000031 and two other GZ class-IDs (street and lightrail) illustrate empty menus without known OccupantGroups or SubmenuKeys to make use of them.

    By regarding the program instructions, I found out that there are neither OccupantGroups nor SubmenuKeys for the empty menus because every submenu has it

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Although most of this is way over my head , this could be very useful in modding the submenus etc. Very ambitious project . Just a question ... would moddifing an exe. the way that is being talked about allow for more control over the content in the game like disaters , different reward structures etc.?


    NAM Associate

    BSC

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections