| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2391 人关注过本帖
标题:如何判断exe是debug出来的,还是Release出来的?
只看楼主 加入收藏
yuma
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:银河系
等 级:贵宾
威 望:37
帖 子:1927
专家分:2992
注 册:2009-12-22
收藏
得分:0 
回复 10楼 rjsp
图片附件: 游客没有浏览图片的权限,请 登录注册

心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
2022-09-08 00:17
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:0 
对比一下你发的 Test1.exe
PS D:\mingw64\bin> objdump.exe --debugging C:\Users\Someone\Desktop\Text1.exe

C:\Users\Someone\Desktop\Text1.exe:     file format pei-x86-64

crtexe.c:
typedef void void;
crtbegin.c:
Text1.c:
mingw_helpers.c:
dllargv.c:
merr.c:
pseudo-reloc.c:
crt_handler.c:
CRT_fp10.c:
gccmain.c:
gs_support.c:
tlssup.c:
cinitexe.c:
natstart.c:
wildcard.c:
_newmode.c:
xtxtmode.c:
atonexit.c:
charmax.c:
pesect.c:
pseudo-reloc-list.c:
tlsthrd.c:
tlsmcrt.c:
fake:
libgcc2.c:
mingw_matherr.c:
invalid_parameter_handler.c:
fake:
fake:
fake:
fake:
crtend.c:
*globals*:
void __xc_z /* 0x409010 */;
void ___RUNTIME_PSEUDO_RELOC_LIST__ /* 0x4047e0 */;
void __imp_GetStartupInfoA /* 0x408224 */;
void __imp_abort /* 0x408334 */;
void __lib64_libkernel32_a_iname /* 0x408754 */;
void __data_start__ /* 0x403000 */;
void ___DTOR_LIST__ /* 0x402c80 */;
void __imp__fmode /* 0x40830c */;
void __imp__lock /* 0x40831c */;
void __imp_RtlVirtualUnwind /* 0x40826c */;
void SetUnhandledExceptionFilter /* 0x402bb8 */;
void __imp_calloc /* 0x40833c */;
void ___tls_start__ /* 0x40a000 */;
void .refptr.__native_startup_state /* 0x404370 */;
void __ImageBase /* 0x400000 */;
void .refptr.__imp__onexit /* 0x404340 */;
void __xl_a /* 0x409038 */;
void GetLastError /* 0x402bd8 */;
void GetSystemTimeAsFileTime /* 0x402be8 */;
void mingw_initltssuo_force /* 0x407940 */;
void __rt_psrelocs_start /* 0x4047e0 */;
void __imp___dllonexit /* 0x4082bc */;
void .refptr.mingw_initltsdyn_force /* 0x404460 */;
void __dll_characteristics__ /* 0x0 */;
void __size_of_stack_commit__ /* 0x1000 */;
void __imp__acmdln /* 0x4082f4 */;
void __size_of_stack_reserve__ /* 0x200000 */;
void __major_subsystem_version__ /* 0x5 */;
void ___crt_xl_start__ /* 0x409038 */;
void __imp_DeleteCriticalSection /* 0x4081f4 */;
void __xl_d /* 0x409048 */;
void __imp__set_invalid_parameter_handler /* 0x403068 */;
void _tls_end /* 0x40a060 */;
void .refptr.__CTOR_LIST__ /* 0x4042c0 */;
void VirtualQuery /* 0x402bc8 */;
void ___crt_xi_start__ /* 0x409018 */;
void .refptr.__imp__fmode /* 0x404330 */;
void __imp__amsg_exit /* 0x4082fc */;
void ___crt_xi_end__ /* 0x409038 */;
void .refptr.__imp___initenv /* 0x404310 */;
void _tls_start /* 0x40a000 */;
void __mingw_winmain_lpCmdLine /* 0x407a10 */;
void .refptr._matherr /* 0x404410 */;
void .refptr.__RUNTIME_PSEUDO_RELOC_LIST__ /* 0x4042e0 */;
void __mingw_oldexcpt_handler /* 0x407080 */;
void __imp_GetCurrentThreadId /* 0x408214 */;
void .refptr.mingw_initltssuo_force /* 0x404470 */;
void GetCurrentProcessId /* 0x402bf0 */;
void _CRT_MT /* 0x403040 */;
void TlsGetValue /* 0x402c48 */;
void TerminateProcess /* 0x402c38 */;
void __bss_start__ /* 0x407000 */;
void __imp___C_specific_handler /* 0x4082b4 */;
void ___RUNTIME_PSEUDO_RELOC_LIST_END__ /* 0x4047e0 */;
void RtlLookupFunctionEntry /* 0x402c18 */;
void __size_of_heap_commit__ /* 0x1000 */;
void __imp_GetLastError /* 0x40821c */;
void .refptr._dowildcard /* 0x4043e0 */;
void __imp_free /* 0x408354 */;
void .refptr.__onexitend /* 0x404390 */;
void __imp_RtlLookupFunctionEntry /* 0x408264 */;
void VirtualProtect /* 0x402bd0 */;
void mingw_app_type /* 0x407030 */;
void ___crt_xp_start__ /* 0x409058 */;
void __imp_scanf_s /* 0x40837c */;
void __imp_LeaveCriticalSection /* 0x408244 */;
void __mingw_pinit /* 0x409028 */;
void __C_specific_handler /* 0x402ab0 */;
void .refptr.mingw_initcharmax /* 0x404440 */;
void __imp_GetTickCount /* 0x408234 */;
void .refptr.__mingw_oldexcpt_handler /* 0x404350 */;
void .refptr.__RUNTIME_PSEUDO_RELOC_LIST_END__ /* 0x4042d0 */;
void ___crt_xp_end__ /* 0x409058 */;
void __dll__ /* 0x0 */;
void __minor_os_version__ /* 0x0 */;
void __imp_GetSystemTimeAsFileTime /* 0x40822c */;
void EnterCriticalSection /* 0x402c40 */;
void _MINGW_INSTALL_DEBUG_MATHERR /* 0x403050 */;
void .refptr.__xi_a /* 0x4043c0 */;
void __image_base__ /* 0x400000 */;
void .refptr._CRT_MT /* 0x4042a0 */;
void RtlCaptureContext /* 0x402c10 */;
void __section_alignment__ /* 0x1000 */;
void __native_dllmain_reason /* 0x403024 */;
void _tls_used /* 0x40a020 */;
void UnhandledExceptionFilter /* 0x402c28 */;
void mingw_initcharmax /* 0x407980 */;
void __IAT_end__ /* 0x4083ac */;
void __imp_memcpy /* 0x40836c */;
void __RUNTIME_PSEUDO_RELOC_LIST__ /* 0x4047e0 */;
void __imp_RtlAddFunctionTable /* 0x408254 */;
void Sleep /* 0x402bb0 */;
void .refptr._newmode /* 0x404420 */;
void mingw_pcppinit /* 0x409008 */;
void __data_end__ /* 0x403090 */;
void __imp_fwrite /* 0x40835c */;
void __CTOR_LIST__ /* 0x402c70 */;
void __imp___getmainargs /* 0x4082c4 */;
void _head_lib64_libkernel32_a /* 0x408000 */;
void __bss_end__ /* 0x407a60 */;
void __xi_z /* 0x409030 */;
void .refptr.mingw_initltsdrot_force /* 0x404450 */;
void GetTickCount /* 0x402c00 */;
void _head_lib64_libmsvcrt_a /* 0x408014 */;
void __native_vcclrit_reason /* 0x403020 */;
void ___crt_xc_end__ /* 0x409018 */;
void RtlAddFunctionTable /* 0x402be0 */;
void .refptr.__native_startup_lock /* 0x404360 */;
void __imp_EnterCriticalSection /* 0x4081fc */;
void _tls_index /* 0x40794c */;
void __native_startup_state /* 0x407a20 */;
void ___crt_xc_start__ /* 0x409000 */;
void __onexitbegin /* 0x407a30 */;
void __imp_GetCurrentProcessId /* 0x40820c */;
void __imp___lconv_init /* 0x4082dc */;
void __imp_TerminateProcess /* 0x408284 */;
void ___CTOR_LIST__ /* 0x402c70 */;
void .refptr.__dyn_tls_init_callback /* 0x4042f0 */;
void __imp_signal /* 0x408384 */;
void __rt_psrelocs_size /* 0x0 */;
void __imp_QueryPerformanceCounter /* 0x40824c */;
void __imp_strlen /* 0x40838c */;
void __imp_malloc /* 0x408364 */;
void __mingw_winmain_nShowCmd /* 0x403000 */;
void mingw_pcinit /* 0x409020 */;
void .refptr._gnu_exception_handler /* 0x404400 */;
void __file_alignment__ /* 0x200 */;
void __imp_InitializeCriticalSection /* 0x40823c */;
void __lconv_init /* 0x402b90 */;
void InitializeCriticalSection /* 0x402c60 */;
void __imp_exit /* 0x408344 */;
void __major_os_version__ /* 0x4 */;
void __imp_vfprintf /* 0x40839c */;
void __imp___initenv /* 0x4082cc */;
void .refptr.__onexitbegin /* 0x404380 */;
void __IAT_start__ /* 0x4081f4 */;
void __imp__cexit /* 0x408304 */;
void __imp_UnhandledExceptionFilter /* 0x408294 */;
void __xl_z /* 0x409050 */;
void __end__ /* 0x40b000 */;
void __imp_SetUnhandledExceptionFilter /* 0x408274 */;
void .refptr.mingw_app_type /* 0x404430 */;
void __imp__onexit /* 0x408324 */;
void __DTOR_LIST__ /* 0x402c80 */;
void RtlVirtualUnwind /* 0x402c20 */;
void __xi_a /* 0x409018 */;
void .refptr.__imp__acmdln /* 0x404320 */;
void __imp_Sleep /* 0x40827c */;
void LeaveCriticalSection /* 0x402c50 */;
void __xc_a /* 0x409000 */;
void __imp___setusermatherr /* 0x4082ec */;
void __size_of_heap_reserve__ /* 0x100000 */;
void ___crt_xt_start__ /* 0x409058 */;
void __subsystem__ /* 0x3 */;
void _fmode /* 0x407970 */;
void __security_cookie_complement /* 0x403080 */;
void __imp_TlsGetValue /* 0x40828c */;
void GetCurrentProcess /* 0x402c30 */;
void __imp_fprintf /* 0x40834c */;
void __imp_VirtualProtect /* 0x40829c */;
void __xl_c /* 0x409040 */;
void ___tls_end__ /* 0x40a068 */;
void __onexitend /* 0x407a38 */;
void QueryPerformanceCounter /* 0x402c08 */;
void __imp_VirtualQuery /* 0x4082a4 */;
void __imp__initterm /* 0x408314 */;
void mingw_initltsdyn_force /* 0x407944 */;
void _dowildcard /* 0x407950 */;
void __imp___iob_func /* 0x4082d4 */;
void __dyn_tls_init_callback /* 0x404290 */;
void .refptr.__image_base__ /* 0x404300 */;
void _newmode /* 0x407960 */;
void __imp_strncmp /* 0x408394 */;
void .refptr._fmode /* 0x4043f0 */;
void __major_image_version__ /* 0x0 */;
void __loader_flags__ /* 0x0 */;
void ___chkstk_ms /* 0x402a70 */;
void __native_startup_lock /* 0x407a28 */;
void __mingw_winmain_hInstance /* 0x407a18 */;
void GetStartupInfoA /* 0x402bc0 */;
void GetCurrentThreadId /* 0x402bf8 */;
void _onexit /* 0x402b88 */;
void __rt_psrelocs_end /* 0x4047e0 */;
void __imp__get_invalid_parameter_handler /* 0x403060 */;
void __minor_subsystem_version__ /* 0x2 */;
void __minor_image_version__ /* 0x0 */;
void __imp__unlock /* 0x40832c */;
void __imp___set_app_type /* 0x4082e4 */;
void mingw_initltsdrot_force /* 0x407948 */;
void _charmax /* 0x403030 */;
void __imp_printf /* 0x408374 */;
void .refptr.__xc_a /* 0x4043a0 */;
void .refptr.__xi_z /* 0x4043d0 */;
void .refptr._MINGW_INSTALL_DEBUG_MATHERR /* 0x4042b0 */;
void DeleteCriticalSection /* 0x402c58 */;
void __imp_RtlCaptureContext /* 0x40825c */;
void __RUNTIME_PSEUDO_RELOC_LIST_END__ /* 0x4047e0 */;
void __imp_GetCurrentProcess /* 0x408204 */;
void .refptr.__xc_z /* 0x4043b0 */;
void ___crt_xt_end__ /* 0x409058 */;
void __lib64_libmsvcrt_a_iname /* 0x4087dc */;
void __security_cookie /* 0x403070 */;
2022-09-08 08:22
yuma
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:银河系
等 级:贵宾
威 望:37
帖 子:1927
专家分:2992
注 册:2009-12-22
收藏
得分:0 
这种方法也不准,都能输出调试信息

3.exe和4.exe谁是debug出来的。两个都是debug的。还是都是Release出来的。

fb.zip (92.47 KB)


[此贴子已经被作者于2022-9-8 11:17编辑过]


心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
2022-09-08 11:12
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42934
注 册:2014-5-20
收藏
得分:0 
可不可以从PE结构的“段头部”起分析
各段头部:.text、.bss、.rdata、.data、.rsrc、.edata、.idata、.pdata和.debug
有些不需要所有的这些段,同样有些自定义了更多的段。(每段占40byte)
2022-09-08 16:13
yuma
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:银河系
等 级:贵宾
威 望:37
帖 子:1927
专家分:2992
注 册:2009-12-22
收藏
得分:0 
回复 14楼 吹水佬
我找了一下段结构,也没有发现什么大的区别。

心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
2022-09-08 16:24
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42934
注 册:2014-5-20
收藏
得分:0 
以下是引用yuma在2022-9-8 16:24:34的发言:

我找了一下段结构,也没有发现什么大的区别。

调试信息位于.debug段之中,但也支持单独的调试文件(.DBG)。
调试目录在.rdata段,其中每个目录都涉及了.debug段之中的调试信息。
调试目录的结构IMAGE_DEBUG_DIRECTORY被定义为:
typedef struct _IMAGE_DEBUG_DIRECTORY {
  ULONG Characteristics;
  ULONG TimeDateStamp;
  USHORT MajorVersion;
  USHORT MinorVersion;
  ULONG Type;
  ULONG SizeOfData;
  ULONG AddressOfRawData;
  ULONG PointerToRawData;
} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY;
2022-09-08 16:40
yuma
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:银河系
等 级:贵宾
威 望:37
帖 子:1927
专家分:2992
注 册:2009-12-22
收藏
得分:0 
回复 16楼 吹水佬
都不存在.debug字段。

rData段中的结果差不多。

看图
图片附件: 游客没有浏览图片的权限,请 登录注册

心生万象,万象皆程序!
本人计算机知识网:http://bbs.为防伸手党,本站已停止会员注册。
2022-09-08 17:03
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42934
注 册:2014-5-20
收藏
得分:0 
调试目录可以位于专门的.debug节中,也可以位于其他任何节中,或者不在任何节中。IMAGE_OPTIONAL_HEADER结构的DataDirectory[6]字段用来记录调试目录的位置和长度,
通过DataDirectory[6]的RVA地址和大小得出文件偏移值,从而找到对应的区域位于什么节中。
根据调试目录结构(IMAGE_DEBUG_DIRECTORY)中的信息可以找到各个调试数据块。
2022-09-08 18:17
吹水佬
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:451
帖 子:10541
专家分:42934
注 册:2014-5-20
收藏
得分:0 
以下是引用yuma在2022-9-8 11:12:29的发言:

这种方法也不准,都能输出调试信息

3.exe和4.exe谁是debug出来的。两个都是debug的。还是都是Release出来的。

从PE看,初步判断:3.exe是32位Release,4.exe是64位debug

[此贴子已经被作者于2022-11-6 10:37编辑过]

2022-11-05 10:54
快速回复:如何判断exe是debug出来的,还是Release出来的?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019690 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved