ASM => C [英] ASM => C

查看:85
本文介绍了ASM => C的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道将英特尔奔腾组件转换为C
的转换器?输出代码的质量不一定非常好,只要它是准确的,就是

解决方案

< blockquote>>任何人都知道将英特尔奔腾组件

列表转换为C的翻译器?输出代码的质量不一定非常好,只要它准确无误。




可以写一个模拟器用于C中的奔腾CPU。

从那里,你可以添加


unsigned char memory [] = {

(代码对于程序来到这里)

(哦,是的,你可能还需要输入一份

的BIOS ROM和操作系统)

};


和模拟器将运行代码,它用C语言编写。

(你可能还需要做更多的事情具体关于I / O

进入真实设备,模拟器可能不会实时运行




Gordon L. Burditt


go ** *********@burditt.org 写道......

任何人都知道转换英特尔奔腾程序集的翻译器/>列入C?输出代码的质量不一定非常好,只要它准确无误。



可以为Pentium CPU编写仿真器在C.
从那里,你可以添加

unsigned char memory [] = {
(程序代码在这里)
(哦,是的,你可能还要投入一份BIOS ROM和操作系统的副本。
};

并且模拟器将运行代码,并且它是用C语言编写的。
(你可能需要做一些关于I / O的更具体的事情才能进入一个真实的设备,模拟器可能不会实时运行


Gordon L. Burditt




我正在寻找更直接翻译.s的东西(或

..asm )文件到.c文件 - 但这是一个有趣的观察

你做的。


一般来说,是什么你问不能做。即使假设

汇编是由C编译器生成的,理论上它仍然是不可能的。

一般声明是你不能做牛排一个汉堡包 -

信息在编译过程中被销毁;你无法恢复原始代码
。转到vivisimo并搜索''反编译''。


你*可以*生成一个C程序,其功能相当于

汇编代码的功能,虽然这取决于你如何严格定义

''等价''。你不能做的是创建一个C程序,保证

来做所有事情,只做原始C程序所做的事情。有关

变量类型的信息可能会丢失。例如,变量可以在

C代码中签名,但程序集没有给出任何指示,因为实际使用该符号的C中没有任何内容。如果你在

反编译中使它无符号,则可能会获得与

原始程序不同的行为。


话虽如此,我的价格是半合理的。


-

#include< standard.disclaimer>

_

Kevin D Quitt USA 91387-4454所有统计数据的96.37%组成

根据FCA,此地址可能不会添加到任何商业邮件列表


Anyone know of a translator that converts an Intel Pentium assembly
listing into C? The quality of output code doesn''t have to be great,
so long as it''s accurate.

解决方案

>Anyone know of a translator that converts an Intel Pentium assembly

listing into C? The quality of output code doesn''t have to be great,
so long as it''s accurate.



It is possible to write an emulator for a Pentium CPU in C.
From there, you can add

unsigned char memory[] = {
(code for program goes here)
(oh, yes, you probably have to throw in a copy of
the BIOS ROM and the OS, too)
};

and the emulator will run the code, and it''s written in C.
(You will probably have to do something more specific about I/O
getting to a real device, and the emulator probably won''t run
real-time).

Gordon L. Burditt


go***********@burditt.org wrote...

Anyone know of a translator that converts an Intel Pentium assembly
listing into C? The quality of output code doesn''t have to be great,
so long as it''s accurate.



It is possible to write an emulator for a Pentium CPU in C.
From there, you can add

unsigned char memory[] = {
(code for program goes here)
(oh, yes, you probably have to throw in a copy of
the BIOS ROM and the OS, too)
};

and the emulator will run the code, and it''s written in C.
(You will probably have to do something more specific about I/O
getting to a real device, and the emulator probably won''t run
real-time).

Gordon L. Burditt



I am looking for something that more directly translates an .s (or
..asm) file into a .c file -- but that''s an interesting observation
you''ve made.


Generally speaking, what you''re asking cannot be done. Even assuming the
assembly was generated by a C compiler, it''s still impossible in theory.
The general statement is "You can''t make steak from a hamburger" -
information is destroyed in the compilation process; you cannot recover
the original code. Go to vivisimo and search for ''decompilation''.

You *can* generate a C program that does the equivalent of what the
assembly code does, although that depends on how strictly you define
''equivalent''. What you cannot do is create a C program that is guaranteed
to do all and only the things the original C program did. Information on
variable types can be lost. For example, a variable may be signed in the
C code, but the assembly gives no indication because there was nothing in
the C that actually made use of the sign. If you make it unsigned in the
decompilation, it''s possible to get behaviour that is different from the
original program.

That being said, my rates are semi-reasonable.

--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
Per the FCA, this address may not be added to any commercial mail list


这篇关于ASM =&gt; C的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆