Thread: exe to assembly

  1. #1
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246

    Question exe to assembly

    I want to create a program(exe) then disassemble it into a text file and change it and then recompile it. I know some debuggers to do so, but I want to know that is this possible using MSVS2005 pro or is there any program bundled with it to do so?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  2. #2
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    These are words thesaurus.com or something gave me for a thesaurus search of the word Hard:

    adamantine, callous, compact, compacted, compressed, concentrated, consolidated, dense, firm, hardened, impenetrable, indurate, indurated, inflexible, iron, packed, rigid, rocky, set, solid, stiff, stony, strong, thick, tough, unyielding

    Here's the site: http://thesaurus.reference.com/browse/hard ...

    You want to create a program which dis-assembles an exe to assembly, changes something, then reassembles ... have you ever looked at an exe in notepad?

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    You cannot expect to find programs that grab a executable and disassemble it to C++ or C code.

    The debuggers do that because the program was compiled with debug symbols and only if the source file is still around to be checked against those symbols
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    You think I am a beginner? Maybe I am. But I know what can be done and what cannot be done.
    I can do this
    foo.cpp ----> foo.asm

    But I want to know how to do this:
    foo.asm ---> foo.exe //An assembler

    And this:
    foo.exe----> foo.asm //A disassembler

    With MSVC++2005Pro of course.

    [edit] You can attach its debugger to an exe, but only when it is running and you can't change anything.
    Last edited by siavoshkc; 07-24-2006 at 04:31 AM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    I don't know if you are a beginner. Are you?

    What you want is a disassembler. Only beginners don't use google.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    A friend of mine got a disassembler, but it didn't bring it to c code, it brought it to assembly. That's probably the best you're going to get, I think. You'll have to learn that, cause how's the assembler going to know, for example, what kind of loop you're in. A for, while, do while, while do, do for, for while etc.

  7. #7
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Its near impossible to convert asm to c/c++ code.
    I asked how to do it with MSVS2005Pro else I know some debuggers. But I expect MSVS to do these jobs.
    And I used search engines as I began using internet, though I am not new to these kinds of answers.
    Last edited by siavoshkc; 07-24-2006 at 05:00 AM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  8. #8
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    This is nothing to do with C++ anyways.

    search for decompilers, engineering, rever engineering and add Visual Studio 2005 to the search string. You will soon find two things:

    1. You will not get many references to Visual Studio 2005
    2. Because it doesn't matter if you use Visual Studio 2005, GCC or my mum's linker.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #9
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    >>This is nothing to do with C++ anyways.
    True, I go to MS forum.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  10. #10
    The superhaterodyne twomers's Avatar
    Join Date
    Dec 2005
    Location
    Ireland
    Posts
    2,273
    The GD or the Tech may be more help to you on these forums ...

  11. #11
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    From that time I posetd my last post till now, I am trying to enter MS forum. What a headache. I should thank cprogramming forum guys and vbulletin!
    Last edited by siavoshkc; 07-24-2006 at 06:36 AM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  12. #12
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    I asked from MS forum. Good news:
    There is a file dumpbin.exe in vc\bin that disassembles exe files to asm file.
    There is a MS Macro Assembler named ml.exe that gets an asm and builds an obj or exe.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  13. #13
    Dump Truck Internet valis's Avatar
    Join Date
    Jul 2005
    Posts
    357
    nasm.sourceforge.net is exploding with an error right now, but you should steer clear of anything that has to do with masm.
    See ndisasm too:
    http://nasm.sourceforge.net/doc/html/nasmdoc0.html

    Also, it's much nicer to look at exe's with a debugger (ollydbg for instance) that labels calls and such for you, you can save the disassembled file for later viewing.

    Also: http://boomerang.sourceforge.net/

  14. #14
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Thanks for the links valis.
    dumbin format is different from ml asm format!
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  15. #15
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    attach the debugger, and look at the disassembly.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Learning Assembly
    By mrafcho001 in forum Tech Board
    Replies: 5
    Last Post: 03-12-2006, 05:00 PM
  2. C to assembly interface
    By Roaring_Tiger in forum C Programming
    Replies: 4
    Last Post: 02-04-2005, 03:51 PM
  3. assembly language...the best tool for game programming?
    By silk.odyssey in forum Game Programming
    Replies: 50
    Last Post: 06-22-2004, 01:11 PM
  4. True ASM vs. Fake ASM ????
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 04-02-2003, 04:28 AM
  5. C,C++,Perl,Java
    By brusli in forum C Programming
    Replies: 9
    Last Post: 12-31-2001, 03:35 AM