用C语言编写了一个程序,源代码和工程文件都弄丢了,只剩下.exe的二进制程序文件。怎么反编译出.c

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用C语言编写了一个程序,源代码和工程文件都弄丢了,只剩下.exe的二进制程序文件。怎么反编译出.c相关的知识,希望对你有一定的参考价值。

用C语言编写了一个程序,源代码和工程文件都弄丢了,只剩下.exe的二进制程序文件。怎么反编译出.c源代码?

参考技术A 这个确实很困难。如果是DOS程序还好办,如果是Windows程序,其反汇编的工作量相当巨大。而且这仅是反汇编,得到的只是勉强能用的汇编代码,而从汇编代码再反工程到.C,真的是件很困难的事。程序简单还好办,复杂的就真是件费力的事了。放弃吧。

如果是自己写的程序,只要整个设计还记得,那就重新写一遍吧。追问

好吧,也只能这样了

参考技术B 反编译不能反编译出C
只能反编译出汇编

如果不懂汇编的话那就没办法了
重新写一个吧追问

这个程序写了一个星期了,估计有2000多行,实在没办法重新写啊。学过一点点的汇编,我想问一下怎么用汇编方法反编译

追答

用Reflector工具反编译
教程网上很多的

参考技术C 你还是再写一个吧,反汇编比你重新写一个还要复杂. 真的没有那个必要哦!

不知道你写的是什么程序,说不定有源码.追问

这个程序我写了一个星期,2000多行啊。。我懂一点汇编,怎么用汇编反编译呢?

追答

图片是我从OD里面截图出来的,你真的要把这些汇编代码再翻译成C语言吗?  没有这个必要嘛.


追问

给跪了,真的要重新写,哎。。。。

本回答被提问者采纳
参考技术D 在网上看看

我昨天不小心弄丢了conio.h,该怎么办啊??需要重装软件吗??急!!

不需要重装。conio.h 是个很小的头文件。根据你的编译器类型和版本,下载一个,或找谁复制一个。
例如 MS C V2.03 compatible console I/O 如下:
/***
*conio.h - console and port I/O declarations
*
* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This include file contains the function declarations for
* the MS C V2.03 compatible console I/O routines.
*
* [Public]
*
****/
#if _MSC_VER > 1000
#pragma once
#endif
#ifndef _INC_CONIO
#define _INC_CONIO
#if !defined(_WIN32) && !defined(_MAC)
#error ERROR: Only Mac or Win32 targets supported!
#endif

#ifndef _MAC
#ifdef __cplusplus
extern "C"
#endif

/* Define _CRTAPI1 (for compatibility with the NT SDK) */
#ifndef _CRTAPI1
#if _MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI1 __cdecl
#else
#define _CRTAPI1
#endif
#endif

/* Define _CRTAPI2 (for compatibility with the NT SDK) */
#ifndef _CRTAPI2
#if _MSC_VER >= 800 && _M_IX86 >= 300
#define _CRTAPI2 __cdecl
#else
#define _CRTAPI2
#endif
#endif

/* Define _CRTIMP */
#ifndef _CRTIMP
#ifdef _NTSDK
/* definition compatible with NT SDK */
#define _CRTIMP
#else /* ndef _NTSDK */
/* current definition */
#ifdef _DLL
#define _CRTIMP __declspec(dllimport)
#else /* ndef _DLL */
#define _CRTIMP
#endif /* _DLL */
#endif /* _NTSDK */
#endif /* _CRTIMP */

/* Define __cdecl for non-Microsoft compilers */
#if ( !defined(_MSC_VER) && !defined(__cdecl) )
#define __cdecl
#endif

/* Function prototypes */
_CRTIMP char * __cdecl _cgets(char *);
_CRTIMP int __cdecl _cprintf(const char *, ...);
_CRTIMP int __cdecl _cputs(const char *);
_CRTIMP int __cdecl _cscanf(const char *, ...);
_CRTIMP int __cdecl _getch(void);
_CRTIMP int __cdecl _getche(void);
#ifdef _M_IX86
int __cdecl _inp(unsigned short);
unsigned short __cdecl _inpw(unsigned short);
unsigned long __cdecl _inpd(unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl _kbhit(void);
#ifdef _M_IX86
int __cdecl _outp(unsigned short, int);
unsigned short __cdecl _outpw(unsigned short, unsigned short);
unsigned long __cdecl _outpd(unsigned short, unsigned long);
#endif /* _M_IX86 */
_CRTIMP int __cdecl _putch(int);
_CRTIMP int __cdecl _ungetch(int);

#if !__STDC__
/* Non-ANSI names for compatibility */
#ifdef _NTSDK
#define cgets _cgets
#define cprintf _cprintf
#define cputs _cputs
#define cscanf _cscanf
#define getch _getch
#define getche _getche
#define kbhit _kbhit
#define putch _putch
#define ungetch _ungetch
#else /* ndef _NTSDK */
_CRTIMP char * __cdecl cgets(char *);
_CRTIMP int __cdecl cprintf(const char *, ...);
_CRTIMP int __cdecl cputs(const char *);
_CRTIMP int __cdecl cscanf(const char *, ...);
#ifdef _M_IX86
int __cdecl inp(unsigned short);
unsigned short __cdecl inpw(unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl getch(void);
_CRTIMP int __cdecl getche(void);
_CRTIMP int __cdecl kbhit(void);
#ifdef _M_IX86
int __cdecl outp(unsigned short, int);
unsigned short __cdecl outpw(unsigned short, unsigned short);
#endif /* _M_IX86 */
_CRTIMP int __cdecl putch(int);
_CRTIMP int __cdecl ungetch(int);
#endif /* _NTSDK */
#endif /* __STDC__ */
#ifdef __cplusplus

#endif
#endif /* _MAC */
#endif /* _INC_CONIO */
参考技术A 下一个吧,http://download.csdn.net/detail/x931210007/4989321
vc的库函数conio.h,放到...\Microsoft Visual Studio\VC98\Include 文件夹中
参考技术B 下个对应的conio.h看行不

以上是关于用C语言编写了一个程序,源代码和工程文件都弄丢了,只剩下.exe的二进制程序文件。怎么反编译出.c的主要内容,如果未能解决你的问题,请参考以下文章

求助,RAC环境卸载oracle软件把ASM磁盘组弄丢了

怎么用Visual Studio 2008编写C++程序?

用C语言编写DLL

怎么用C语言打开一个程序?

tomcat类加载体系

C语言中。如果编写了一个函数,想在不同源文件中调用。