资源简介
EurekaLog对Delphi C ++ BuilderC#和Delphi Prism开发者来说是一个完整的错误解决方案工具,让您的应用程序捕捉每一个异常和内存泄漏,直接在最终用户的PC上,生成一个详细的日志调用堆栈(文件,类,方法和行号),可选择性地通过电子邮件发送每个日志项的副本或发送到一个web错误跟踪器
代码片段和文件信息
// This file is based on FastMM‘s support unit for C++ Builder.
#pragma option push
#pragma option -k- -d -vi- -O2 -b- -3 -a8 -pc -RT- -x -xd -r -AT -vG- -vG0- -vG1- -vG2- -vG3- -vGc- -vGt- -vGd-
#pragma hdrstop
#include “EMemLeaks.hpp“
#include “EResLeaks.hpp“
// BCB6 support
#include
#ifdef __cplusplus
extern “C“ {
#endif // __cplusplus
typedef void * (__fastcall * GetMemFunc)(int Size);
typedef int (__fastcall * FreeMemFunc)(void * P);
typedef void * (__fastcall * ReallocMemFunc)(void * P int Size);
typedef void * (__fastcall * AllocMemFunc)(unsigned Size);
typedef void (_RTLENTRY *HeapRedirect_free) (void *);
typedef void * (_RTLENTRY *HeapRedirect_malloc) (size_t);
typedef void * (_RTLENTRY *HeapRedirect_realloc) (void * size_t);
typedef void (_RTLENTRY *HeapRedirect_terminate) (void);
//_________________________________________________________________________________
// Patch routines
#pragma pack(push1)
typedef struct {
unsigned char JmpInst; // E9
int Offset;
} TRelativeJmp32 * PRelativeJmp32;
typedef struct {
unsigned short JmpInst; // FF 25
void * * DestPtr;
} TIndirectJmp32 * PIndirectJmp32;
#pragma pack(pop)
bool __fastcall WriteMem(void * Location void * Data unsigned int DataSize)
{
unsigned long OldProtect;
if (VirtualProtect(Location DataSize PAGE_EXECUTE_READWRITE &OldProtect))
{
memmove(Location Data DataSize);
FlushInstructionCache(GetCurrentProcess() Location sizeof(DataSize));
VirtualProtect(Location DataSize OldProtect &OldProtect);
return true;
}
else {
return false;
}
}
#define RelativeJmp32Inst (0xE9)
bool __fastcall PatchProc(void * OldProc void * NewProc TRelativeJmp32 * Backup)
{
if (OldProc && NewProc)
{
TRelativeJmp32 JmpData;
JmpData.JmpInst = RelativeJmp32Inst;
JmpData.Offset = (int)NewProc - ((int)OldProc + sizeof(JmpData));
if (Backup)
{
*Backup = *((PRelativeJmp32)OldProc);
}
return WriteMem(OldProc &JmpData sizeof(JmpData));
}
else {
return false;
}
};
bool __fastcall UnPatchProc(void * OldProc void * NewProc TRelativeJmp32 * Backup)
{
if (OldProc && NewProc && Backup)
{
int Offset = (int)NewProc - ((int)OldProc + sizeof(TRelativeJmp32));
if ((((PRelativeJmp32)OldProc)->JmpInst == RelativeJmp32Inst)
&& (((PRelativeJmp32)OldProc)->Offset == Offset))
{
return WriteMem(OldProc &Backup sizeof(*Backup));
}
}
return false;
};
#ifndef _RTLDLL //Not using Dynamic RTL
extern void _terminate(int code);
#endif // _RTLDLL
void __fastcall FinalizeModuleCodeDataRanges(void);
void __fastcall FinalizeHeapRedirectorStoreList(void);
void New_terminate(int code)
{
FinalizeMemoryManager();
GetCppVirtObjTypeNameFunc = NULL;
FinalizeModuleCodeDataRanges();
ExitProcess(code);
}
void * PatchLocat
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3568888 2015-12-02 22:42 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\AddressLookup.exe
文件 89088 2013-11-27 21:51 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\BorDebug.dll
文件 2732304 2015-12-02 22:43 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\Cacher.exe
文件 1213200 2013-11-27 21:44 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\dbghelp.dll
文件 3178496 2014-09-30 15:39 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\Default.fdb
文件 2539272 2015-12-02 22:42 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\DialogTest.exe
文件 4394240 2015-12-02 22:42 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ErrorLookup.exe
文件 805377 2015-12-02 22:40 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\EurekaLog.dbg
文件 12867328 2015-12-02 22:40 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\EurekaLog.dll
文件 2740224 2013-11-27 21:49 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\gds32.dll
文件 1339392 2013-11-27 21:50 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\icudt30.dll
文件 274432 2013-11-27 21:49 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\icuin30.dll
文件 675840 2013-11-27 21:50 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\icuuc30.dll
文件 3017992 2015-12-02 22:38 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\InstallDiag.exe
文件 1637972 2013-11-27 21:50 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\libeay32.dll
文件 3577088 2015-12-02 22:42 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ManageProfiles.exe
文件 3497712 2015-12-02 22:41 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ModuleInformer.exe
文件 1206024 2015-12-02 22:37 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\Process.exe
文件 3600648 2015-12-02 22:41 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\SetDebugSymbolsPath.exe
文件 5212920 2015-12-02 22:42 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\SettingsEditor.exe
文件 355446 2013-11-27 21:50 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ssleay32.dll
文件 131856 2013-11-27 21:44 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\symsrv.dll
文件 1 2013-11-27 21:51 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\symsrv.yes
文件 1873144 2015-12-02 22:41 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ThreadsSnapshot.exe
文件 3724536 2015-12-02 22:41 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\ThreadsSnapshotGUI.exe
文件 14355688 2015-12-02 22:41 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin\Viewer.exe
文件 6459640 2015-12-02 22:43 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin64\AddressLookup.exe
文件 4390672 2015-12-02 22:43 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin64\Cacher.exe
文件 1558912 2013-11-27 21:49 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin64\dbghelp.dll
文件 6379248 2015-12-02 22:43 EurekaLog 7.5.1.0 Enterprise for Delphi 10.3 Full Source FiXED\Bin64\ModuleInformer.exe
............此处省略412个文件信息
评论
共有 条评论