-
-
[原创]一个很有趣的小实验
-
发表于:
2009-1-29 01:40
9229
-
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.
貌似在直接注入的时候有些用处。比其他的处理字符串的方法要简单一些
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课