gpt4 book ai didi

c - 一个空模块有 228 个符号?

转载 作者:太空狗 更新时间:2023-10-29 16:04:03 24 4
gpt4 key购买 nike

char_array.c:

char arr[1]; 

int main(void) { printf("%s\n", arr); return 0; }

由 windbg 转储的 char_array.exe 中的符号:

0:000> x char_array!*
0040702c char_array!__security_cookie_complement = 0x44bf19b1
00407148 char_array!envp = 0x00000000
00405b08 char_array!uninit_postmsg = char [43] "' is being used without being initialized."
00407168 char_array!_RTC_ErrorReportFunc = 0x00000000
00407150 char_array!managedapp = 0n0
0040716c char_array!_RTC_ErrorReportFuncW = 0x00000000
00407174 char_array!_commode = 0n0
004068d0 char_array!__rtc_taa = <function> *[1]
00407178 char_array!_fmode = 0n0
004065c4 char_array!__rtc_iaa = <function> *[1]
00405000 char_array!__xc_a = <function> *[]
00405000 char_array!__xc_a = <function> *[1]
0040827c char_array!_imp____initenv = 0x10315760
00407030 char_array!mspdbName = 0x00405f88 "MSPDB80.DLL"
00405a98 char_array!_RTC_ErrorMessages = char *[6]
004074f4 char_array!__dyn_tls_init_callback = 0x00000000
00405618 char_array!__xi_z = <function> *[]
00405618 char_array!__xi_z = <function> *[1]
00407004 char_array!_RTC_ErrorLevels = int [5]
00407024 char_array!__native_vcclrit_reason = 0xffffffff
004071e8 char_array!GS_ContextRecord = struct _CONTEXT
00405410 char_array!pcinit = 0x00401240
004071e0 char_array!DebuggerWasPresent = 0n0
004074d0 char_array!__native_startup_lock = 0x00000000
00407170 char_array!_forceCRTManifestRTM = 0n0
00405e68 char_array!_RTC_errlist = char *[5]
00407020 char_array!__native_dllmain_reason = 0xffffffff
00407141 char_array!arr = char [1] ""
00407160 char_array!has_cctor = 0n0
0040715c char_array!mainret = 0n0
00407180 char_array!_newmode = 0n0
004082a8 char_array!_imp___adjust_fdiv = 0x103166cc
004074d4 char_array!__onexitend = 0x00000000
00405ab0 char_array!_RTC_NoFalsePositives = int [6]
00408248 char_array!_imp___onexit = 0x102cf660
0040530c char_array!__xi_a = <function> *[]
0040530c char_array!__xi_a = <function> *[1]
00407154 char_array!argret = 0n0
00406034 char_array!GS_ExceptionPointers = struct _EXCEPTION_POINTERS
0040714c char_array!argv = 0x00000000
004067cc char_array!__rtc_izz = <function> *[1]
00405208 char_array!__xc_z = <function> *[]
00405208 char_array!__xc_z = <function> *[1]
00407184 char_array!mspdb = 0x00000000
00407018 char_array!__globallocalestatus = 0n-2
004074e8 char_array!_adjust_fdiv = 0n0
00406ad8 char_array!__rtc_tzz = <function> *[1]
004064c0 char_array!__safe_se_handler_table = void *[]
00407190 char_array!GS_ExceptionRecord = struct _EXCEPTION_RECORD
00406040 char_array!_load_config_used = struct IMAGE_LOAD_CONFIG_DIRECTORY32_2
0040717c char_array!_dowildcard = 0n0
00405ac8 char_array!stack_premsg = char [28] "Stack around the variable '"
00407158 char_array!startinfo = struct _startupinfo
00407028 char_array!__security_cookie = 0xbb40e64e
00405af8 char_array!uninit_premsg = char [15] "The variable '"
0040701c char_array!__defaultmatherr = 0n1
004074e4 char_array!__onexitbegin = 0x00000000
00405514 char_array!pinit = 0x00401f10
00407164 char_array!wsprintffp = 0x00000000
00407144 char_array!argc = 0n0
00405104 char_array!pcppinit = 0x004012e0
004074c0 char_array!__native_startup_state = __uninitialized (0n0)
00405ae4 char_array!stack_postmsg = char [17] "' was corrupted."
004022f0 char_array!_FindPESection (unsigned char *, unsigned long)
00401040 char_array!_RTC_CheckEsp (void)
00401f70 char_array!_invoke_watson_if_error (int, wchar_t *, wchar_t *, wchar_t *, unsigned int, unsigned int)
00401790 char_array!failwithmessage (void *, int, int, char *)
00401a40 char_array!_RTC_StackFailure (void *, char *)
00401fd0 char_array!_RTC_Initialize (void)
00401e80 char_array!_RTC_GetErrorFunc (void *)
00401010 char_array!main (void)
00401de0 char_array!_RTC_NumErrors (void)
00401e60 char_array!_RTC_SetErrorFuncW (<function> *)
00401730 char_array!_RTC_Failure (void *, int)
00401670 char_array!DebuggerKnownHandle (void)
00401110 char_array!_RTC_CheckStackVars2 (void *, struct _RTC_framedesc *, struct _RTC_ALLOCA_NODE *)
004019a0 char_array!DebuggerRuntime (unsigned long, int, void *, wchar_t *)
00402150 char_array!atexit (<function> *)
00401e40 char_array!_RTC_SetErrorFunc (<function> *)
00402000 char_array!_RTC_Terminate (void)
00401f10 char_array!__CxxSetUnhandledExceptionFilter (void)
00401e90 char_array!_RTC_GetErrorFuncW (void *)
00402290 char_array!_ValidateImageBase (unsigned char *)
00401340 char_array!mainCRTStartup (void)
00401b40 char_array!_RTC_AllocaFailure (void *, struct _RTC_ALLOCA_NODE *, int)
00401fc0 char_array!_setargv (void)
004015b0 char_array!NtCurrentTeb (void)
004012e0 char_array!pre_cpp_init (void)
00401c80 char_array!_getMemBlockDataString (char *, char *, char *, unsigned int)
00401e10 char_array!_RTC_SetErrorType (_RTC_ErrorNumber, int)
004016a0 char_array!DebuggerProbe (unsigned long)
00401fb0 char_array!_matherr (struct _exception *)
00401360 char_array!__tmainCRTStartup (void)
00402970 char_array!__security_check_cookie (unsigned int)
00401ea0 char_array!__CxxUnhandledExceptionFilter (struct _EXCEPTION_POINTERS *)
00401cf0 char_array!_RTC_UninitUse (char *)
00401220 char_array!_RTC_Shutdown (void)
004024a0 char_array!_except_handler4 (struct _EXCEPTION_RECORD *, struct _EXCEPTION_REGISTRATION_RECORD *, struct _CONTEXT *, void *)
00401df0 char_array!_RTC_GetErrDesc (_RTC_ErrorNumber)
004010d0 char_array!_RTC_AllocaHelper (struct _RTC_ALLOCA_NODE *, unsigned int, struct _RTC_ALLOCA_NODE **)
00401f30 char_array!_setdefaultprecision (void)
00401070 char_array!_RTC_CheckStackVars (void *, struct _RTC_framedesc *)
004015c0 char_array!check_managed_app (void)
004024d0 char_array!_RTC_GetSrcLine (unsigned char *, wchar_t *, unsigned long, int *, wchar_t *, unsigned long)
00402790 char_array!GetPdbDll (void)
00401240 char_array!pre_c_init (void)
00402190 char_array!__security_init_cookie (void)
004029b0 char_array!__report_gsfailure (void)
00402040 char_array!_onexit (<function> *)
004011f0 char_array!_RTC_InitBase (void)
00402370 char_array!_IsNonwritableInCurrentImage (unsigned char *)
004081a8 char_array!_imp__FreeLibrary = <no type information>
00402ac4 char_array!InterlockedExchange = <no type information>
004082a0 char_array!_imp____p__fmode = <no type information>
00408290 char_array!_imp____getmainargs = <no type information>
00405e84 char_array!<CrtImplementationDetails>::NativeDll::ThreadAttach = <no type information>
00402afa char_array!GetProcAddress = <no type information>
0040826c char_array!_imp___initterm_e = <no type information>
00408274 char_array!_imp___CrtDbgReportW = <no type information>
004081d0 char_array!_imp__QueryPerformanceCounter = <no type information>
004081fc char_array!_imp__Sleep = <no type information>
004081f4 char_array!_imp__IsDebuggerPresent = <no type information>
0040216c char_array!_encode_pointer = <no type information>
004081bc char_array!_imp__HeapFree = <no type information>
004081e8 char_array!_imp__WideCharToMultiByte = <no type information>
0040828c char_array!_imp___exit = <no type information>
004081a4 char_array!_imp__TerminateProcess = <no type information>
00402172 char_array!__set_app_type = <no type information>
004081c0 char_array!_imp__GetSystemTimeAsFileTime = <no type information>
004082b4 char_array!_imp___CRT_RTC_INITW = <no type information>
00401038 char_array!printf = <no type information>
0040227e char_array!exit = <no type information>
004082ac char_array!_imp____setusermatherr = <no type information>
00408284 char_array!_imp___cexit = <no type information>
00402aee char_array!MultiByteToWideChar = <no type information>
004081e0 char_array!_imp__lstrlenA = <no type information>
004081cc char_array!_imp__GetTickCount = <no type information>
00402992 char_array!_unlock = <no type information>
004081d4 char_array!_imp__SetUnhandledExceptionFilter = <no type information>
00408294 char_array!_imp___amsg_exit = <no type information>
004081c4 char_array!_imp__GetCurrentProcessId = <no type information>
0040248e char_array!_initterm_e = <no type information>
00402980 char_array!terminate = <no type information>
00408000 char_array!_IMPORT_DESCRIPTOR_MSVCR90D = <no type information>
00405e88 char_array!<CrtImplementationDetails>::NativeDll::ThreadDetach = <no type information>
00408270 char_array!_imp___initterm = <no type information>
00402b00 char_array!LoadLibraryA = <no type information>
0040829c char_array!_imp___encode_pointer = <no type information>
00408208 char_array!KERNEL32_NULL_THUNK_DATA = <no type information>
00402ad6 char_array!IsDebuggerPresent = <no type information>
004081dc char_array!_imp__GetProcAddress = <no type information>
00401f9c char_array!__setusermatherr = <no type information>
00402284 char_array!_CrtSetCheckCount = <no type information>
0040299e char_array!_lock = <no type information>
00408250 char_array!_imp___except_handler4_common = <no type information>
00402b5a char_array!UnhandledExceptionFilter = <no type information>
0040825c char_array!_imp___unlock = <no type information>
00402aca char_array!Sleep = <no type information>
00408260 char_array!_imp___invoke_watson = <no type information>
00402b42 char_array!VirtualQuery = <no type information>
00408280 char_array!_imp__exit = <no type information>
00402abe char_array!_crt_debugger_hook = <no type information>
00408254 char_array!_imp___crt_debugger_hook = <no type information>
00402026 char_array!__p__commode = <no type information>
00402b18 char_array!GetCurrentThreadId = <no type information>
004081ac char_array!_imp__VirtualQuery = <no type information>
00402272 char_array!_XcptFilter = <no type information>
004081a0 char_array!_imp__GetCurrentProcess = <no type information>
0040824c char_array!_imp___lock = <no type information>
00402adc char_array!RaiseException = <no type information>
00408264 char_array!_imp___controlfp_s = <no type information>
004081b4 char_array!_imp__GetProcessHeap = <no type information>
00408268 char_array!_imp_?terminateYAXXZ = <no type information>
00402b3c char_array!GetModuleFileNameW = <no type information>
004081d8 char_array!_imp__LoadLibraryA = <no type information>
00402998 char_array!__dllonexit = <no type information>
004029a4 char_array!_decode_pointer = <no type information>
00402b1e char_array!GetCurrentProcessId = <no type information>
00408278 char_array!_imp___CrtSetCheckCount = <no type information>
004029aa char_array!_except_handler4_common = <no type information>
00402488 char_array!_initterm = <no type information>
00402b30 char_array!HeapAlloc = <no type information>
0040298c char_array!_invoke_watson = <no type information>
00408204 char_array!_imp__UnhandledExceptionFilter = <no type information>
004082b0 char_array!_imp___configthreadlocale = <no type information>
004081ec char_array!_imp__DebugBreak = <no type information>
004082c0 char_array!MSVCR90D_NULL_THUNK_DATA = <no type information>
004081f8 char_array!_imp__InterlockedCompareExchange = <no type information>
00401e96 char_array!_CRT_RTC_INITW = <no type information>
00402b24 char_array!GetSystemTimeAsFileTime = <no type information>
00401f24 char_array!_configthreadlocale = <no type information>
0040217e char_array!__getmainargs = <no type information>
00405e7c char_array!<CrtImplementationDetails>::NativeDll::ProcessDetach = <no type information>
00402ad0 char_array!InterlockedCompareExchange = <no type information>
00402b48 char_array!FreeLibrary = <no type information>
004081f0 char_array!_imp__RaiseException = <no type information>
00402af4 char_array!lstrlenA = <no type information>
00402b2a char_array!HeapFree = <no type information>
00402b36 char_array!GetProcessHeap = <no type information>
00405e80 char_array!<CrtImplementationDetails>::NativeDll::ProcessAttach = <no type information>
00408014 char_array!_IMPORT_DESCRIPTOR_KERNEL32 = <no type information>
00402482 char_array!_CrtDbgReportW = <no type information>
00402b12 char_array!GetTickCount = <no type information>
0040202c char_array!__p__fmode = <no type information>
004081e4 char_array!_imp__MultiByteToWideChar = <no type information>
00402986 char_array!_controlfp_s = <no type information>
004081b8 char_array!_imp__HeapAlloc = <no type information>
00402b06 char_array!SetUnhandledExceptionFilter = <no type information>
00402b4e char_array!TerminateProcess = <no type information>
004082b8 char_array!_imp___decode_pointer = <no type information>
004081c8 char_array!_imp__GetCurrentThreadId = <no type information>
00402178 char_array!_amsg_exit = <no type information>
00405e8c char_array!<CrtImplementationDetails>::NativeDll::ProcessVerifier = <no type information>
00408298 char_array!_imp____set_app_type = <no type information>
00402b54 char_array!GetCurrentProcess = <no type information>
00408288 char_array!_imp___XcptFilter = <no type information>
004082bc char_array!_imp__printf = <no type information>
00402278 char_array!_cexit = <no type information>
00402ae8 char_array!WideCharToMultiByte = <no type information>
00408200 char_array!_imp__InterlockedExchange = <no type information>
00402ae2 char_array!DebugBreak = <no type information>
00402b0c char_array!QueryPerformanceCounter = <no type information>
004082a4 char_array!_imp____p__commode = <no type information>
00408258 char_array!_imp____dllonexit = <no type information>
004081b0 char_array!_imp__GetModuleFileNameW = <no type information>
00408028 char_array!_NULL_IMPORT_DESCRIPTOR = <no type information>
0040226c char_array!_exit = <no type information>

我惊讶地发现,即使像上面这样一个空程序也有这么多符号,为什么?

最佳答案

MSVC 的 C 和 C++ 库在 main 之前和之后做了很多魔术。此外,您正在使用启用各种运行时检查的开关进行编译(这需要例如 _RTC* 符号)。您也有用于处理例如堆和调试构建错误报告机制。

“编译器魔术”术语中的“魔术”(编译器/工具链在幕后为您做的事情)包括例如

  • 设置堆栈“cookies”以检测堆栈溢出
  • 从 Windows 检索各种信息(例如 GetStartupInfoGetCommandLineGetEnvironmentStrings)
  • 初始化内存管理器
  • 设置堆的调试检查
  • 设置 FPU 标志
  • 添加 atexit 处理程序

如果您在 Debug模式下构建此应用,并在 main 的开头设置断点,您将看到调用 main 的内容。通读例如__tmainCRTStartup 及其调用的函数。

关于c - 一个空模块有 228 个符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5926799/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com