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. Python的库和资源(转)

    Python的库和资源: http://blog.sina.com.cn/s/blog_3cb6a78c0100hpaq.html Python 常用模块: http://www.pythonclub ...

  2. Hadoop Datanode节点无法启动(All directories in dfs.data.dir are invalid)

    Hadoop Datanode节点无法启动(All directories in dfs.data.dir are invalid) java.io.IOException: All director ...

  3. BZOJ 3983 Takeover Wars 解题报告

    我猜了一个结论,能合并就合并,到了必须要敌对交易的时候才进行敌对交易. 然后合并的话,肯定是拿最大的两个去合并. 至于敌对交易,肯定是干掉对方最大的公司才是有意义的. 于是各种分类讨论...看代码好了 ...

  4. MySQL注入中load_file()函数的应用

    常用的一些Load_File()函数攻击手法:

  5. loadmore & scroll

    loadmore <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.m ...

  6. U3D版本《暗黑世界V1.0》编译——图文教程!

    原地址:http://blog.csdn.net/uxqclm/article/details/11970773 欢迎来到9秒:www.9miao.com 说明: A. 工具准备:          ...

  7. 查看jdk的位数

    public class Test { public static void main(String[] args) { System.out.println("bit of JVM is ...

  8. Java多态的体现之接口

    /** * * @author Administrator * 功能:接口体现多态 */ package com.test4; public class Test { public static vo ...

  9. Sql server decimal 和 numeric

    带固定精度和小数位数的数值数据类型. decimal[ (p[ , s] )] 和 numeric[ (p[ , s] )] 固定精度和小数位数.使用最大精度时,有效值从 - 10^38 +1 到 1 ...

  10. Spring事务管理--多个ORM框架在使用时的情况分析

    公司的项目已经接近尾声了,总结一下项目中用到的技术,我发现项目中的有些东西还是挺模糊的,只是知道这么用就行了.并不清楚其中的原理.由于公司的项目比较老,是7年前的一个项目了,中间一直有人在维护,也是在 ...