Advertisement

vs6.0c语言转汇编,将.c转换为.asm(c语言转换为汇编)

阅读量:

将.c转换为.asm(c语言转换为汇编)

答案:6 信息版本:手机版

解决时间 2019-10-04 01:28

已解决

2019-10-03 22:23

现有一个C语言的程序 编译通过了 想转成汇编程序 用什么软件编译为汇编的程序(.asm),要有步骤!只要能用,不管程序怎么复杂。

最佳答案

2019-10-03 22:33

VC++ 编译器 自带的 dumpbin 就可以 做反汇编。

C:\Program Files\Microsoft Visual Studio\VC98\BIN\DUMPBIN.exe

dumpbin /DISASM abc.exe

出来了

dumpbin /DISASM abc.exe /OUT:abc.asm

存入abc.asm

全部回答

1楼

2019-10-04 02:24

vc自带调试功能可以查看C的汇编代码

或者将编译出的exe文件反汇编了都可以

只是不太明白这样做的目的是什么

先写C再反汇编 代码效率那么低

如果需要在C里加汇编模块直接

__asm

{

}

就可以了啊

2楼

2019-10-04 01:16

#include

#include

#include

void main(int argc,char ** argv,char ** arge)

{

string str;

cin >> str;

cout << "content-type:text/html\r\n\r\n";

cout << "abc\r\n

";

while ((arge)++,*arge!=NULL){

cout << *arge << "";

}

}

然后,判断进行字符串判断找到“QUERY_STRING”

以上代码可在任何os上编译

这是c++语法,

上面的例子中不需要#include 这一行

iostream.h相当与stdio.h

cout是输出,可以用printf代替

cin是输入,可以用scanf代替

#include

include

#include

#include

void main(int argc,char ** argv,char ** arge)

{

puts("content-type:text/html\r\n\r\n");

while ((arge)++,*arge!=NULL){

puts(*arge);

puts("");

}

}

再给你个网站

3楼

2019-10-04 00:08

VC++ 编译器 自带的 dumpbin 就可以 做反汇编。

C:\Program Files\Microsoft Visual Studio\VC98\BIN\DUMPBIN.exe

dumpbin /DISASM abc.exe

就 出来了。

dumpbin /DISASM abc.exe /OUT:abc.asm

就存入abc.asm

dumpbin 还有许多其它功能。

dumpbin /? 得帮助文件。

4楼

2019-10-03 23:50

//正确的c代码

int a[]={4,12,0,4};

int b[]={2,543,2,3};

main(){

int i,t;

for(i=0;i<4;i++){

if(a[i]>b[i]){

t=a[i];

a[i]=b[i];

b[i]=t;

}

}

}翻译后得到的汇编代码:

; listing generated by microsoft (r) optimizing compiler version 17.00.50727.1

title \desktop\main.c

.686p

.xmm

include listing.inc

.model flat

includelib libcmt

includelib oldnames

public _a

public _b

_data segment

_a dd 04h

dd 0ch

dd 00h

dd 04h

_b dd 02h

dd 021fh

dd 02h

dd 03h

_data ends

public _main

; function compile flags: /odtp

_text segment

_t$ = -8 ; size = 4

_i$ = -4 ; size = 4

_main proc

; line 3

push ebp

mov ebp, esp

sub esp, 8

; line 5

mov dword ptr _i$[ebp], 0

jmp short $ln4@main

$ln3@main:

mov eax, dword ptr _i$[ebp]

add eax, 1

mov dword ptr _i$[ebp], eax

$ln4@main:

cmp dword ptr _i$[ebp], 4

jge short $ln5@main

; line 6

mov ecx, dword ptr _i$[ebp]

mov edx, dword ptr _i$[ebp]

mov eax, dword ptr _a[ecx*4]

cmp eax, dword ptr _b[edx*4]

jle short $ln1@main

; line 7

mov ecx, dword ptr _i$[ebp]

mov edx, dword ptr _a[ecx*4]

mov dword ptr _t$[ebp], edx

; line 8

mov eax, dword ptr _i$[ebp]

mov ecx, dword ptr _i$[ebp]

mov edx, dword ptr _b[ecx*4]

mov dword ptr _a[eax*4], edx

; line 9

mov eax, dword ptr _i$[ebp]

mov ecx, dword ptr _t$[ebp]

mov dword ptr _b[eax*4], ecx

$ln1@main:

; line 11

jmp short $ln3@main

$ln5@main:

; line 12

xor eax, eax

mov esp, ebp

pop ebp

ret 0

_main endp

_text ends

end

5楼

2019-10-03 23:27

VC命令行下面就是/FA编译选项

在菜单project setting下选C/C++属性页

下拉列表框里面选生成listing file

有几种附加选择:code是带机器码、source是带C语言源代码

C++ Builder、GCC下面都有类似的编译选项

我要举报

如果感觉以上信息为低俗/不良/侵权的信息,可以点下面链接进行举报,我们会做出相应处理,感谢你的支持!

大家都在看

推荐资讯

全部评论 (0)

还没有任何评论哟~