易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi下生成Map文件方法,免杀或调试用的

 以前看了 通过崩溃地址找错误行数之VC版 那时候还没用DELPHI
昨晚刚好又看到了 所以就试了一下DELPHI的,与大家共享 ^_^
什么是 MAP 文件?简单地讲, MAP 文件是程序的全局符号、源文件和代码行号信息的唯一的文本表示方法,它可以在任何地方、任何时候使用,不需要有额外的程序进行支持。而且,这是唯一能找出程序崩溃的地方的救星。
DELPHI下生成MAP文件的方法:偶只知道下面两种,如果谁知道其他的方法 敬请告知 多谢
生成详细的MAP信息的方法
1. project -> options -> Linker -> Map file 选择detailed.
2. D:\Fred\Code\DELPHI\MyPas\ErrLineByAddr2>dcc32 -GD project1.dpr
我们的代码为:
unit Unit1;
//{$D+,L+}
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
I, J: Integer;
p: PChar;
begin
I := 10;
J := 0;
//I := I div J; // 32
//ShowMessage(IntToStr(I));
p := nil;
p^ := 'A'; // 38
end;
end.
// 想必大家看到了 会有返回0地址错误....我们这里就是要让它崩溃,让我让你崩溃 ^_^
然后执行 点击 然后出错 我的机器上 崩溃地址为0044d946
如果要查找代码行号,需要使用下面的公式做一些十六进制的减法运算:
崩溃行偏移 = 崩溃地址(Crash Address) - 基地址(ImageBase Address) - 0x1000
减去后得到 0004c946 然后查找 0004c946
0044d946 - 00400000 = 0004d946 - 00001000 = 0004c946 <= 后面列出的
0004C946 就是它了 我们用ultraedit32之类的工具打开 .map文件 搜索 0004C94,找到了,然后就找
<= 0004c946的那个地址 然后看到了
Line numbers for Unit1(Unit1.pas) segment .text
    37 0001:0004C944    38 0001:0004C946    39 0001:0004C949    41 0001:0004C97C
&nbs


相关文档:

Delphi 设计模式:《HeadFirst设计模式》Delphi7代码

1.被装饰者
{《HeadFirst设计模式》之装饰模式 }
{ 本单元中的类为被装饰者 }
{ 编译工具: Delphi7.0 }
{ E-Mail : xshlife@163.com }

unit uComponent;

interface

type
TBeverage = class(TObject) //抽象饮料类
protected
FDescription: String;
public
......

Delphi 设计模式:《HeadFirst设计模式》Delphi7代码

1. 命令的接收者
{《HeadFirst设计模式》之命令模式 }
{ 本单元中的类为命令的接收者 }
{ 编译工具 :Delphi7.0 }
{ 联系方式 :xshlife@163.com }

unit uReceiveObject;

interface

type
TLight = class(TObject)
private
FLocation: String;
public
constru ......

Delphi 设计模式:《HeadFirst设计模式》Delphi7代码

命令模式可以很轻松的实现撤销(Undo)功能。
1. 命令的接受者
unit uReceiveObject;

interface

type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;

implementation

{ TLight }

procedure TLight.Off;
begin
Writeln('Light is off.'); ......

Delphi 设计模式:《HeadFirst设计模式》Delphi7代码

1. 命令的接受者
unit uReceiveObject;
interface
type
TLight = class(TObject)
public
procedure Open;
procedure Off;
end;
TGarageDoor = class(TObject)
public
procedure Up;
procedure Down;
procedure Stop;
procedure LightOn;
procedure LightOff;
end; ......

Delphi 数据类型

 一、整数类型
类型 所占字节数 取值范围
byte 1 0-255
word 2 0-65535
shortint 1 -128-127
smallint 2 -32768-32767
integer 4 -214748648-214748467
longint 4 -214748648-214748467
cordinal 4 0-2147483647
二、实数类型
类型 所点字节数 取值范围
Real 6 ±2.9×10的负39次方到1.7× ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号