-
-
[原创]一个很有趣的小实验
-
发表于:
2009-1-29 01:40
9230
-
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
THello = function: Pchar;
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function Hello: pchar;
asm
Call @1;
@1:
Pop EAX;
JMP @2;
DB 'ElementClient';
DB 0;
@2: ADD EAX, 3;
MOV Byte PTR [EAX], '_';
end;
procedure TForm1.Button1Click(Sender: TObject);
var newHello: PChar;
begin
GetMem(newHello, 300);
Move(Hello, NewHello^, 300);
ShowMessage(THello(newHello));
FreeMem(NewHello, 300);
end;
end.
貌似在直接注入的时候有些用处。比其他的处理字符串的方法要简单一些
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)