Robert Tisdale wrote: Glen Richards wrote:Is there a way to do this. I mean, is there a company who converts asmto their wsl language and then from that to c?No.Is there a way that we can do this?No.Information is discarded in the processof compiling a higher level language to assemblerthat cannot be recovered from the assembler alone.OK, this is off-topic here, but I'm not convinced by the impossibilityclaim. What is surely impossible is to retrieve the particular Ccode that, when run through some (unknown) compiler, generated a givenglob of machine code. But given the asm, shouldn't it be possiblein principle to generate (non-unique) C code of equivalent effect?Whether anyone provides this sort of service commercially, I haveno idea.-Allin CottrellDepartment of EconomicsWake Forest University, NC. Allin Cottrell wrote:OK, this is off-topic herebut I'm not convinced by the impossibility claim.What is surely impossible is to retrieve the particular C codethat, when run through some (unknown) compiler,generated a given glob of machine code.But given the assembler, shouldn't it be possible, in principle,to generate (non-unique) C code of equivalent effect?In general, no. You would be obliged to emulatethe machine architecture and the operating system (OS).You would need to be able to recognize calls to the OSfor I/O for example. In other words, you would need informationabout the program besides what remains in the assembler listingto resolve all of these references.Whether anyone provides this sort of service commercially,I have no idea.There are (or at least were) people in the KBG, CIA, NSA, etc.that could do a fairly reasonable job of 'reverse engineering'machine codes (assembler).
'Glen Richards' wrote in messagenews:GYhWb.143769$U%5.658804@attbis03. Is there a way to do this.Sure. Find out what the ASM program does, thenwrite the C code to do the same thing.I mean there is a company who converts asm totheir wsl language and then from that to c is there a way that we can dothis?There might indeed exist some 'automated' methods, buttheir output (C source) would very likely be very cryptic,usually meant only for consumption by a computer.-Mike.
Allin Cottrell wrote:E. Robert Tisdale wrote:Glen Richards wrote:Is there a way to do this. I mean, is there a company who convertsasm to their wsl language and then from that to c?No.Is there a way that we can do this?No.Information is discarded in the processof compiling a higher level language to assemblerthat cannot be recovered from the assembler alone.OK, this is off-topic here, but I'm not convinced by the impossibilityclaim.
What is surely impossible is to retrieve the particular Ccode that, when run through some (unknown) compiler, generated a givenglob of machine code. But given the asm, shouldn't it be possiblein principle to generate (non-unique) C code of equivalent effect?In principle, yes. Enumerate all possible files (an infinite, butcountable set); compile them with all possible compiler/flagscombinations (a finite set); compare the results with the executable.You will lose information (comments; symbol names; high-levelconstructs) but it is guaranteed to work (given a rather large amount oftime).But of course, there are smarter ways. Searching for 'decompilation' onGoogle gives a couple of interesting hits.A large amount of work has been done in this area; both in an academicsetting and a commercial setting. With regard to the latter: there's aterrifying quantity of code out there that is in active use, but forwhich the source code is no longer available (mostly COBOL).
Somecompanies specialize in semi-automatic reverse-engineering of this vitalsoftware.Best regards, Sidney. On Wed, 11 Feb 2004, Glen Richards wrote:Is there a way to do this. I mean there is a company who converts asm totheir wsl language and then from that to c is there a way that we can dothis?Normally people ask if you can convert machine language to C source. Tworeasons for this. First is that I have the binaries but lost the sourcecode (it happens even with backups).
The second is that I have someoneelse's binaries and I want to reverse engineer them.If you want to go from machine code to C source there are programs outthere that will do something. All are operating system specific and mostare compiler specific as well. Just do a search on 'reverse engineer ' and you might find something. The source code theyproduct is difficult to read and next to impossible to maintain. It isoften easier to reverse engineer the requirements and write the programfrom scratch.If you have actual assembly source code and want to turn it into C sourcecode that might actually be harder. The market for people who know C buthave some assembly code is a lot smaller than people who want to reverseengineer binaries. It would also be specific to the assembler and theoperating system.
Maybe the search for reverse engineering might findsomething but the results will be about the same or worse than going frombinary to C source. If you cannot find an assembly language to C sourceconverter you can try getting an assembler, create a binary then usemachine language to C source converts.Bottom line, it is usually more effort to maintain the resulting sourcecode then it would be to write the application from scratch.-Send e-mail to: darrell at cs dot toronto dot eduDon't send e-mail to. In Kelsey Bjarnason writes:snipsOn Tue, 10 Feb 2004 21:44:59 -0800, E. Robert Tisdale wrote:Whether anyone provides this sort of service commercially,I have no idea.There are (or at least were) people in the KBG, CIA, NSA, etc.that could do a fairly reasonable job of 'reverse engineering'machine codes (assembler).Umm. It's not all that hard to reverse-engineer machine code, actually.It's just tedious, slow, and not amenable to algorithmic solutions.It's an excellent exercise for anyone heavily involved in assemblyprogramming.
And, occasionally, a must if a piece of software (or evenhardware) is not properly documented.As a trivial example, it's usually easier to figure out how to interfaceC code to a Fortran program by looking at the Fortran compiler outputthan by digging into the documentation.Dan-Dan PopDESY Zeuthen, RZ groupEmail. Darrell Grainger wrote:(snip)If you have actual assembly source code and want to turn it into C sourcecode that might actually be harder. The market for people who know C buthave some assembly code is a lot smaller than people who want to reverseengineer binaries. It would also be specific to the assembler and theoperating system. Maybe the search for reverse engineering might findsomething but the results will be about the same or worse than going frombinary to C source. If you cannot find an assembly language to C sourceconverter you can try getting an assembler, create a binary then usemachine language to C source converts.It was more popular some years ago when some assembly programsneeded Y2K fixes.
Some decided if they were going to work on themat all they might use more modern machines. The result might be Cthat is about as readable as the assembly language. Maybe C variablesnamed after each register, and then operations are done to thosevariables as they would be to the registers of the source machine.- glen. Dan Pop wrote:(snip regarding reverse engineering)It's an excellent exercise for anyone heavily involved in assemblyprogramming. And, occasionally, a must if a piece of software (or evenhardware) is not properly documented.As a trivial example, it's usually easier to figure out how to interfaceC code to a Fortran program by looking at the Fortran compiler outputthan by digging into the documentation.Especially if the compiler will generate the assembly codein people readable form, as most will.
Though it mighttake more work to find the special cases and exceptions.- glen. In glen herrmannsfeldt writes:Dan Pop wrote:(snip regarding reverse engineering)It's an excellent exercise for anyone heavily involved in assemblyprogramming. And, occasionally, a must if a piece of software (or evenhardware) is not properly documented. As a trivial example, it's usually easier to figure out how to interfaceC code to a Fortran program by looking at the Fortran compiler outputthan by digging into the documentation.Especially if the compiler will generate the assembly codein people readable form, as most will.Even if it doesn't, there may be tools that 'reverse engineer' objectfiles into highly readable assembly, because the symbol table ispresent in the file. Objdump from the GNU binutils, but I rememberusing a similar tool under MSDOS, too.Though it might take more work to find the special cases and exceptions.The idea is that you investigate the cases that are relevant to you.If you need to pass 2 double precision numbers and one integer numberto the C routine, you couldn't care less about how Fortran passes strings.You simply write the function/subroutine call of interest to you andcompile it. By examining the generated code, you know what the Cfunction will receive.Dan-Dan PopDESY Zeuthen, RZ groupEmail. On 11 Feb 2004 14:57:06 GMT, (DarrellGrainger) wrote:On Wed, 11 Feb 2004, Glen Richards wrote:Is there a way to do this.
I mean there is a company who converts asm totheir wsl language and then from that to c is there a way that we can dothis?Normally people ask if you can convert machine language to C source. Tworeasons for this. First is that I have the binaries but lost the sourcecode (it happens even with backups).
Micro-Processor Services, Inc.Tel.
Update Log Version 3.38 - June 9, 2019New Features:1. Prompt if a dependent DLL does not existVersion 3.36 - June 5, 2019New Features:1. Split sections but connect them while loadingVersion 3.32 - May 20, 2019New Features:1. Generate ordinal in Module Definition FileVersion 3.28 - May 12, 2019New Features:1. Export resources in DLL or EXE automatically2. Convert DLL or EXE which does have a.text section3. Connect all the sections4.
Convert EXE files if it is convertible5. Handle TLS directory6. Display all the sections of a DLL or EXE7. Choose the sections to be outputVersion 3.18 - January 14, 2019New Features:1. Handle loop instructionsVersion 3.16 - November 20, 2018New Features:1. Make the conversion speed much fasterVersion 3.06 - September 16, 2018New Features:1. Make the decompile engine much fasterVersion 3.04 - July 5, 2018New Features:1.
Convert encrypted DLL filesVersion 3.01 - June 14, 2018New Features:1. Export C class member functionsVersion 2.99 - May 19, 2018New Features:1. Use Simple ModeVersion 2.96 - November 24, 2017New Features:1.
Z80 Assembly To C Converter
Display the current disassemble positionVersion 2.94 - July 29, 2017New Features:1. Create project files2. Create EXE Project3. Create DLL ProjectVersion 2.93 - July 11, 2017New Features:1.
Rename functions and labels2. Replace a function with a custom functionVersion 2.92 - July 7, 2017New Features:1. Collapse/Expand a function2.
Undefine a function3. Goto function end/start address4. Jump to previous position5. Jump to next position6. Identify SEH filter and handlerVersion 2.88 - May 14, 2017New Features:1. Decompile switch case statement2.
Decompile magic numbers3. Set function end addressVersion 2.78 - April 19, 2017New Features:1. Added tool Eye of God2. Analysis function prototype3. Analysis ESP/EBP values in a function4. Convert assembly code to C code5. Output optimized C code6.
![Online Online](/uploads/1/2/4/1/124196675/293417768.png)
Output unoptimized C codeVersion 2.76 - March 22, 2017New Features:1. Integrate a Jump Table into the functionVersion 2.72 - February 25, 2017New Features:1. Log ESP EBP to identify all used function arguments and local variables2. Rename function arguments and local variablesVersion 2.68 - February 15, 2017New Features:1. Generate function referencesVersion 2.66 - February 14, 2017New Features:1. Support C names2. Optimize compilation speed for Complete Structure ModeVersion 2.64 - January 29, 2017New Features:1.
Automatically identify the static library functions of CVersion 2.62 - January 18, 2017New Features:1. Create Debug Tools2. Dynamic Log Function InvocationsVersion 2.52 - January 12, 2017New Features:1. Generate Module Definition FileVersion 2.48 - January 10, 2017New Features:1.
Added tool Decompiled File AnalyzerVersion 2.42 - December 24, 2016New Features:1. Disassemble with Complete Structure ModeVersion 2.36 - December 16, 2016New Features:1. Disassemble the code section2.
Disassemble with Comment Mode3. Disassemble with Precise Mode4. Disassemble with Complete ModeVersion 2.32 - December 7, 2016New Features:1. Generate data structures for all data sectionsVersion 2.28 - December 5, 2016New Features:1. Initialize Import Address Table with dynamic mode2.
Initialize Import Address Table with static mode3. Initialize Import Address Table with direct addressesVersion 2.12 - November 26, 2016DLL to C Released.
Assembly Language To C Program Converter
@OP Now one is blowing you off here but what you are asking to do is rather complex; aka it takes more than just some simple manipulations. There are many open source compilers out there such as gcc and fasm that could get you started in the right direction but this isn't a task for the faint of heart.Speaking of assembly however, I know with gcc you can use the -S to create the assembly language for your C program. I use to know how to do it with the older versions for VC compiler but 2010 has seemed to hide it on me. Does anyone now where they moved that setting to? I did try searching but all I was able to turn up was info for the older versions.