Welcome, Guest. Please login or register.

Author Topic: Executables  (Read 2719 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Executables
« on: November 13, 2006, 08:23:52 PM »
In general, (not just Amiga) is it possible to modify a compiled executable so that it starts at a different point? A real world example usually helps to express these types of questions, so here's what I'm thinking. The X-Box game Project Gotham Racing 2 has a brilliant sub-game called Geometry Wars. Getting in to the sub-game means loading a massive game (PGR2 itself) and going through quite a long winded process to launch the Geometry Wars. We're trying to find a way of hacking the PGR2 binary so that when you run it it skips past the PGR2 game itself and goes straight to the point which it would go to when you start the sub-game.

I assume you would need to be able to find the correct starting point in the executable (with a hex editor???) and then edit the original binary (again, with a hex editor???), and also that the sub-game will execute on its own without initialization from the main game, but we're just wondering if this kind of thing is even possible before we investigate too much.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Quixote

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 2059
    • Show only replies by Quixote
Re: Executables
« Reply #1 on: November 26, 2006, 08:27:22 AM »
;-) Of course it's possible in theory.  As for actually doing it....

One thought that occurrs to me would be to use a decompiler to expand the software into a form that an editor would understand.  Then look thought it to sort out the subroutines, then to compile each subroutine separately and to run each of them until you find the one you want.

Bear in mind that it's obviously more complicated than that; the subroutine you want may require certain resources to have been made available ahead of time by the main program, for example.

Mind you, my own programming days were on the Vic20 and later Commodore64, so take my musings with a grain of salt....


 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Executables
« Reply #2 on: November 26, 2006, 10:47:09 AM »
Quote
Quixote wrote:
One thought that occurrs to me would be to use a decompiler to expand the software into a form that an editor would understand.  Then look thought it to sort out the subroutines, then to compile each subroutine separately and to run each of them until you find the one you want.

Is that actually possible?

Quote
Quixote wrote:
Bear in mind that it's obviously more complicated than that; the subroutine you want may require certain resources to have been made available ahead of time by the main program, for example.

Of course. It would probably be best to follow the code through and allow any variables to be set, screens to be opened, files to be loaded in to RAM etc just in case any of this is required, but remove any requirement for user input in getting to the part of the code you want. Then it will be just like the user chose the options required to that part of the application, except it would be automatic.

What kind of code would you actually end up with if you decompiled the executable?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10