[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::languages

Title:Languages
Notice:Speaking In Tongues
Moderator:TLE::TOKLAS::FELDMAN
Created:Sat Jan 25 1986
Last Modified:Wed May 21 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:394
Total number of notes:2683

239.0. "foo.exe -> foo.obj -> foo.pas (or .for or etc)" by GALLOP::COOPERM (It's a Bee-u-tiful place bob !) Thu Jun 22 1989 08:43

                
    Is there a tool available which can produce source code from a .exe
    file. Even if the output was only roughly right that would do.
    Is it possible to write one (with SCAN for instance ?)?
                
    Or maybe    
              EXE.OOF NUR
              JBO.OOF KNIL
              SAP.OOF LACSAP
                
    Would work ;-)
                
    Martin
T.RTitleUserPersonal
Name
DateLines
239.1Artificial Intelligence problemSAUTER::SAUTERJohn SauterThu Jun 22 1989 09:1111
    It would be possible to write a program to produce a MACRO file
    from an EXE file (I saw it done on TOPS-10).  However, the resulting
    MACRO isn't very maintainable.  The disassembler can't be sure
    which operands are relocatable and which are not, and it sometimes
    confuses data and program.  Therefore, you can't add or remove
    any instructions, you can only modify existing instructions.
    
    Turning the assembly language into PASCAL would be a much harder job,
    but not impossible.  It's sort of like turning fish soup into an
    aquarium, to steal a Russian proverb.
        John Sauter
239.2DebugDWOVAX::YOUNGSharing is what Digital does best.Sat Jun 24 1989 19:312
    The VAX Debugger does a passable job of translating executable into
    its Macro equivilant.
239.3I don't think he wants macro!OZROCK::MCGINTYThu Jun 29 1989 04:378
    Re: .2

    I think .0 really wants to translate it to the source code, otherwise
    I would have suggested using PATCH.  I have used patch to create an 
    identical device driver from the executable code when the vendor
    would not give us a new executable that would have allowed us to 
    upgrade.
239.4I thoght Patch was a dogs nameGALLOP::COOPERMIt's a Bee-u-tiful place bob !Thu Jul 20 1989 13:3717
    Thanks for the replies folks,
re .3 I don't know if I want Macro either !
    
    What I want to do exactly is take an existing small fortran executable
    and take a look at how it was written (it's actually Bakgam.exe
    which is floating around on the net, but no source), then I can
    write a better one !
    I want to see how it was written, because it is a pretty good program,
    and I can't see how it could all be fitted into 34 blocks.
    
    As well as using it to see how to write my own program, it would
    be nice to be able to make changes to bakgam.exe to make the screen
    output better.
    Now you know what I want to now you can you tell me me if macro can help  
    (I don't program in Macro, but might be able to do a bit of hacking in it.)
                                                                               
                                                                               
239.5not a simple taskSAUTER::SAUTERJohn SauterThu Jul 20 1989 14:1111
    If the .EXE file is only 34 blocks long, it probably doesn't have the
    debug symbol table included.  Thus, the best you could do is extract
    Macro instructions from it, with no symbolic names for routines and
    no comments.  You will have to study the instructions carefully to
    learn how the program works.  What you want to do is called "reverse
    engineering", and in general requires a lot of skill.
    
    I once did this to a chess program in order to patch its output
    routines.  I wouldn't have considered trying to figure out its
    game-playing logic.  Good luck.
        John Sauter