Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Modifying already compiled applications

Options
  • 10-01-2007 2:16pm
    #1
    Closed Accounts Posts: 5


    What I'm trying to do is to add a menu button to an application that has already been compiled and the source code is not available to me.

    Say for example I wanted to add a button to the menu bar in MS Word.

    Is there anyway to do this or can anybody put me on the right track?:confused:

    The Software uses Fox Pro.


Comments

  • Registered Users Posts: 2,757 ✭✭✭masterK


    It's not possible to modify compiled code, there are some backward generators that can produce source code from an assembly but I doubt they'd be reliable.

    The only possible way would to be make it appear it's the original software by placing a transparent form with only a small visible portion on top of the compiled software, this would be horrible to even attempt to do though.


  • Closed Accounts Posts: 17,208 ✭✭✭✭aidan_walsh


    It's not possible to modify compiled code
    Hex editor.


  • Registered Users Posts: 1,193 ✭✭✭liamo


    Assuming you've got rights to the code (or permission to de-compile the application) Refox would be a good place to start.

    Although it's been a while since I've had to use it, it's a great utility.

    Regards,

    Liam


  • Registered Users Posts: 1,193 ✭✭✭liamo


    Hex editor.

    Ha! Lightweight!

    Real men extend compiled apps with debug ! ;)


  • Closed Accounts Posts: 5 HairyMammoth


    Any links for free refox?? :D Even a eval edition


  • Advertisement
  • Closed Accounts Posts: 6,300 ✭✭✭CiaranC


    Doesnt MS Word have a VB scripting engine for adding buttons like in your example?


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Ok first up CiaranC is probably the best answer here.

    If thats not possible you can get resource editors that allow you to change UI however that UI would never be trapped by anything within code and unless your a l33t haX0r who can patch binaries is unlikely to.


  • Registered Users Posts: 4,188 ✭✭✭pH


    Any links for free refox?? :D Even a eval edition
    Here a demo editions of another foxpro decompiler:

    http://decomp.chat.ru/index.htm

    I'm in NO way saying these work, they could be trojans that delete your hard disk for all I know.

    Use google, search for foxpro, decompile and "reverse engineer"


  • Registered Users Posts: 1,193 ✭✭✭liamo


    Any links for free refox?? :D Even a eval edition
    The refox site used to have an eval download. It probably still does. However, until you unlock it (ie pay for it), you only get snippets of decompiled code.

    Free refox? If you find one, I wouldn't trust it an inch.

    Regards,

    Liam


  • Closed Accounts Posts: 5 HairyMammoth


    Thanks lads loadsa info there.
    Do you think it would be possible to use the applications API somehow, to access or modify inner workings of the application. Tis a very vague concept I know but don't want to go down an endless path.


  • Advertisement
  • Registered Users Posts: 4,188 ✭✭✭pH


    Thanks lads loadsa info there.
    Do you think it would be possible to use the applications API somehow to, access or modify inner workings of the application. Tis a very vague concept I know but don't want to go down an endless path.:rolleyes:
    Yes it is possible, but without some skill and background in it you'll waste your time. There a plenty of examples of people who work with compiled code everyday, and do some pretty amazing things.

    You however are not one of those people. I'm still not clear what you mean by 'add a menu button'. Given enough time you could certainly add a menu button, however if you want it to do anything when it's clicked then I'd say (given your current skillset) forget it.

    You only have 2 real options
    - Rewrite the App.
    - Spend the money get a foxpro decompiler, get a foxpro development environment and see if you can get it working, then make your changes.

    Modifying the app's bytecode is not really an option.


  • Closed Accounts Posts: 1,467 ✭✭✭bushy...


    http://www.datarescue.com/ used to offer a free version of IDA before if you want a quick look at what you were thinking of heading into.


  • Registered Users Posts: 5,618 ✭✭✭Civilian_Target


    There's a fantastic application called "Deepweaver" in development that allows you to edit compiled java code using a PROLOG-style syntax in a semi-aspect-oriented way, any bit of code, including network code!


  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    there was a virus released some years ago that could disassemble a program, insert code blocks, re-assemble into working program again..probably most complex virus ever written.

    called <snip/> E.P.

    the simplified algorithm, quoting the author:
    Load PE file into virtual addresses; allocate flag table (DWORD for each byte), and initialize it with special PE structure - related bits; in other words, perform initial PE structure analysis.
    Disassemble file (instruction by instruction), at the same time filling flag table with new information about instruction offsets. At this step we can not make a mistake, i.e. to recognize code as data or vise versa, because such fault is fatal; so, dual situations should be excluded, and some files may not be processed at all.
    Convert all known information into list of: instructions, datablocks, labels and pointers. I.e. to make our information a bit more high-level, a bit nearer to source. Such list is an easy-modifiable substance we was speaking about; it is generated because of easy manipulation with its elements.
    Call <user's mutator> (external relative to engine), which will modify instruction list; for example insert additional instructions or remove existing ones.
    Assemble file back: recalculate all offsets; fix PE structure; rebuild fixup table and so on.

    as hobbes says, you can modify resources to a PE file, the more difficult part would be modifiying the actual code/data sections, it is possible, but is it worth the hassle?

    there was this really cool windows 32 bit dis-assembler that supported debugging long before IDA did, which was used by lots of software reversers.
    when the author discontinued releasing new versions, the reversers themselves added new features and fixed bugs with the help of IDA and resource editors.

    so..it is perfectly possible to do this kind of thing, just not so easy.
    probably more difficult when modifiying programs written in oop languages.
    CiaranC wrote:
    Doesnt MS Word have a VB scripting engine for adding buttons like in your example?

    i'd look into this, if it is ms word menu you want to modify, of course.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Right:

    Anyone, ANYONE, posts a link to virii source code again they will be banned permanently.

    HairyMammoth: Ph was trying to help you and I don't see any evidence of a petty dig. If you had the skillset you wouldn't be asking that question in the first place and would have given a much clearer picture of what exactly you were trying to achieve. Please keep you temper in future.


  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    Evil Phil wrote:
    Anyone, ANYONE, posts a link to virii source code again they will be banned permanently.

    i respect your wishes Phil, apologies for including the link..i'm not trying to be antagonistic or push my luck here, but i think its fair to point out that there is no source on that page..just a description.

    although, i probably should have just quoted the text.

    i also should have called it an "engine" rather than a "virus" because that is what it is...not something that propagates, but could of course be used for that purpose.

    its an "engine" used to disassemble a binary and insert code blocks into it, reassemble again.
    Call <user's mutator> (external relative to engine)

    sorry..


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,693 Mod ✭✭✭✭Capt'n Midnight


    What I'm trying to do is to add a menu button to an application that has already been compiled and the source code is not available to me.

    Say for example I wanted to add a button to the menu bar in MS Word.

    Is there anyway to do this or can anybody put me on the right track?:confused:

    The Software uses Fox Pro.
    Word is a bad example as you could simply write a macro and assign a button to it and then put the button on a toolbar, you could also write an addin as well.

    NB. Check the application license - reverse engineering is usually prohibited so even if you could do it you aren't allowed. And even if you could and were allowed you would have to reinvent the wheel when the next version comes out.

    On the other hand open source means you don't need to modify executables.

    Way back when I had time I tweaked debug.com for the laugh - it made a call to display characters on screen, but it removed the leading bit, so I looked up the Int 21 call , there were three of them IIRC and tweaked each in turn trial/error so a different mask was used so only the first 32 were lost instead of the last 128. You can do stuff like that when you have a specific entry point, but to add a button is far more complicated as you have far more points of entry.

    another option is to head over to sourceforge and see if someone already has a similar project, there is no point in trying to hack say paintshoppro when http://www.getpaint.net rebuilding it.


  • Closed Accounts Posts: 5 HairyMammoth


    True Word is a bad example. The software I'm using is a non microsoft app :D

    Thanks Capt'n Midnight.


  • Closed Accounts Posts: 18,056 ✭✭✭✭BostonB


    Seems like your trying to invent the wheel no good reason. If you gave more information about what exactly you are trying to do people could help you. Being vague will only get you vague answers.

    Pretty much everything word can do, can be programmed using VBA/VB and the Word oject model. All you need is Word installed. You can write something far more advanced that a simple macro, you can write (I should say program) a comprehensive application using VBA.

    I've seen very complex validated solutions developed that use Excel/Word etc and securely link to other applications, even online financial systems. There are ways to link to non MS applications too, you could write a command line interface or an XML feed etc. I've seeb that used to link mainframes to Excel modeing applications for example, or word reports.


Advertisement