1.跳出错误法  ===================================================
在主界面的implementation  {$R *.dfm} 下放入以下代码:
procedure PatchInt3;
var
  NOP: Byte;
  NTDLL: THandle;
  BytesWritten: DWORD;
  Address: Pointer;
begin
  if Win32Platform <> VER_PLATFORM_WIN32_NT then
  Exit;
  NTDLL := GetModuleHandle('NTDLL.DLL');
  if NTDLL = 0 then
  Exit;
  Address := GetProcAddress(NTDLL, 'DbgBreakPoint');
  if Address = nil then
  Exit;
  try
  if Char(Address^) <> #$CC then
    Exit;
    NOP := $90;
    if WriteProcessMemory(GetCurrentProcess, Address, @NOP, 1, BytesWritten) and (BytesWritten = 1) then
    FlushInstructionCache(GetCurrentProcess, Address, 1);
  except // Do not panic if you see an EAccessViolation here, it is perfectly harmless!
    on EAccessViolation do ;
  else
    raise;
  end;
end;
然后在窗体的Create中调用 PatchInt3 ;或者在窗体代码的最后一个end.前加入一下代码即可以解决
//-------------------------------------------------------------- i
initialization
begin
PatchInt3; //防止关闭窗口时出现CPU: ntdll.DbgBreakPoint
end;
2.DELPHI 7控件漏洞法=====================================================
文件名:D7ComboBoxStringsGetPatch.pas
原代码:

unit D7ComboBoxStringsGetPatch;
 
// The patch fixes TCustomComboBoxStrings.Get method for empty string item in Delphi 7.
 
interface
 
{$IF RTLVersion <> 15.0}
'This patch is intended for Delphi 7 only';
{$IFEND}
 
implementation
 
uses
  Windows, SysUtils, StdCtrls;
 
resourcestring
  RsPatchingFailed = 'TCustomComboBoxStrings.Get patching failed.';
 
type
  TPatchResult = (prNotNeeded, prOk, prError);
 
function PatchCode(RoutineStartAddr: Pointer; PatchOffset: Cardinal; OriginalCode: Pointer;
  OriginalCodeLen: Cardinal; PatchedCode: Pointer; PatchedCodeLen: Cardinal): TPatchResult;
const
  JmpOpCode = $25FF;
type
  PPackageThunk = ^TPackageThunk;
  TPackageThunk = packed record
    JmpInstruction: Word;
    JmpAddress: PPointer;
  end;
var
  CodeStart: Pointer;
  BytesWritten: DWORD;
begin
  if FindClassHInstance(System.TObject) <> HInstance then
    with PPackageThunk(RoutineStartAddr)^ do
      if JmpInstruction = JmpOpCode then
        RoutineStartAddr := JmpAddress^
      else
      begin
        Result := prError;
        Exit;
      end;
  CodeStart := Pointer(LongWord(RoutineStartAddr) + PatchOffset);
  if CompareMem(CodeStart, OriginalCode, OriginalCodeLen) then
  begin
    if WriteProcessMemory(GetCurrentProcess, CodeStart, PatchedCode, PatchedCodeLen, BytesWritten) and
      (BytesWritten = PatchedCodeLen) then
    begin
      FlushInstructionCache(GetCurrentProcess, CodeStart, PatchedCodeLen);
      Result := prOk;
    end
    else
      Result := prError;
  end
  else
    Result := prNotNeeded;
end;
 
type
  TCustomComboBoxStringsHack = class(TCustomComboBoxStrings);
 
function AddrOfTCustomComboBoxStringsGet: Pointer;
begin
  Result := @TCustomComboBoxStringsHack.Get;
end;
 
procedure PatchTCustomComboBoxStringsGet;
const
  OriginalCode: Cardinal  = $74FFF883; // CMP EAX, -1 | JZ  +$26
  PatchedCode: Cardinal   = $7E00F883; // CMP EAX,  0 | JLE +$26
  PatchOffset             = $1F;
  // for DEBUG DCU by Pavel Rogulin
  OriginalCodeD: Cardinal = $FFF07D83;
  PatchedCodeD: Cardinal  = $00F07D83;
  PatchOffsetD            = $2E;
var
  PatchResult: TPatchResult;
begin
  PatchResult := PatchCode(AddrOfTCustomComboBoxStringsGet, PatchOffset, @OriginalCode, SizeOf(OriginalCode),
    @PatchedCode, SizeOf(PatchedCode));
  if PatchResult = prNotNeeded then
    PatchResult := PatchCode(AddrOfTCustomComboBoxStringsGet, PatchOffsetD, @OriginalCodeD, SizeOf(OriginalCodeD),
      @PatchedCodeD, SizeOf(PatchedCodeD));
  case PatchResult of
    prError:
      begin
        if IsConsole then
          WriteLn(ErrOutput, RsPatchingFailed)
        else
          MessageBox(0, PChar(RsPatchingFailed), nil, MB_OK or MB_ICONSTOP or MB_TASKMODAL);
        RunError(1);
      end;
  end;
end;
 
initialization
  PatchTCustomComboBoxStringsGet;
 
end.
3.内存处理法(这个也是我单位出现的问题)========================== 
方法:
将XE2的borlndmm.dll,rlink32.dll二个文件给复制到D:\delphi\Borland\Delphi7\Bin 中。
原因:
说是因为DLPHI7的内存管理没有XE2的好。

问题-Delphi编译到最后Linking时总是出现与ntdll.dll有关的错误还有Fatal Error Out of memory错误的更多相关文章

  1. VS2010 win7 64位安装后新建项目生成时错误:LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    解决方案:VS2010在经历一些更新后,建立Win32 Console Project时会出“error LNK1123” 错误,解决方案为将 项目|项目属性|配置属性|清单工具|输入和输出|嵌入清单 ...

  2. tesseract编译错误:fatal error: allheaders.h: No such file or directory

    错误描述: globaloc.cpp::: fatal error: allheaders.h: No such file or directory #include "allheaders ...

  3. VS编译错误:fatal error C1859:unexpected precompiled header error, simply rerunning the compiler might fix this problem

    fatal error C1859:unexpected precompiled header error, simply rerunning the compiler might fix this ...

  4. 用Visual Studio高版本号打开低版本号的project,转换时出现错误:fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    解决方法是: 在电脑里面搜索发现   C:\Program Files\Microsoft Visual Studio 10.0\VC\bin   C:\Windows\winsxs\x86_netf ...

  5. VS2010编译错误:fatal error C1189: #error : This file requires _WIN32_WINNT to be #defined at least to 0x

    下面是彻底解决方法:在工程的stdafx.h中添加(如有类似语句,需注释掉)#ifndef WINVER // Allow use of features specific to Windows 95 ...

  6. fatal error C1010: 在查找预编译头时遇到意外的文件结尾 (转)

    错误描述:fatal error C1010: 在查找预编译头时遇到意外的文件结尾.是否忘记了向源中添加“#include "stdafx.h"”? 错误分析:     此错误发生 ...

  7. 错误描述:fatal error C1010: 在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "stdafx.h"”?(转)

    错误分析: 此错误发生的原因是编译器在寻找预编译指示头文件(默认#include "stdafx.h")时,文件未预期结束.没有找到预编译指示信息的头文件"stdafx. ...

  8. C++ VS编译问题--LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏

    用VS编译时,当出现错误LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏: 这个问题的解决方案为: 1. 找到项目\xx属性\配置属性\清单工具\输 ...

  9. VS中c++文件调用c 函数 ,fatal error C1853 预编译头文件来自编译器的早期版本号,或者预编译头为 C++ 而在 C 中使用它(或相反)

    出现错误:error C1853: "Debug\ConsoleApplication1.pch"预编译头文件来自编译器的早期版本号.或者预编译头为 C++ 而在 C 中使用它(或 ...

随机推荐

  1. MongoDB 覆盖索引查询

    MongoDB 覆盖索引查询 官方的MongoDB的文档中说明,覆盖查询是以下的查询: 所有的查询字段是索引的一部分 所有的查询返回字段在同一个索引中 由于所有出现在查询中的字段是索引的一部分, Mo ...

  2. 《JavaScript启示录》摘抄

    1.JavaScript预包装的9个原生的对象构造函数: Number(),String(),Boolean(),Object(),Array(),Function(),Data(),RegExp() ...

  3. oracle srvctl 命令

    SRVCTL命令可以控制RAC数据库中的instance,listener以及services. 通常SRVCTL在ORACLE用户下执行.下面我们来介绍srvctl命令. 1.通过SRVCTL命令来 ...

  4. FastCGI中文规范

    http://fuzhong1983.blog.163.com/blog/static/1684705201051002951763/ . 介绍 FastCGI是对CGI的开放的扩展,它为所有因特网应 ...

  5. Using FireMonkey Layouts

    FireMonkey has many layout controls to choose from. Come learn the differences and how to use them t ...

  6. tshark 使用说明

    yum install -y wireshark 最近才发现,原来wireshark也提供有Linux命令行工具-tshark.tshark不仅有抓包的功能,还带了解析各种协议的能力.下面我们以两个实 ...

  7. Co-variant array conversion from x to y may cause run-time exception

    http://stackoverflow.com/questions/8704332/co-variant-array-conversion-from-x-to-y-may-cause-run-tim ...

  8. jQuery功能一览

    // Hello world!"); }); $("#btn5").click(function(){ $("#test5").val("D ...

  9. 函数lock_mode_stronger_or_eq 锁权限等级

    row代表lock HashTable的权限 column代表预加锁的权限    ulint lock_mode_stronger_or_eq( /*=====================*/ e ...

  10. ubunt下的MinimalCD

    ubuntu有MinimalCD,水平高的衍生版制作者基于MinimalCD安装并编译,定制出独特风格的ubuntu衍生版,如 crunchbang.水平不高的个人用户可以从Alternate(文字安 ...