//在一个exe文件中查找指定内容,找到则返回起始位置, 否则返回0
//如果某字符串, 直接传入字符串进来
//如果要查找16进制,则用如下格式传参进来: #$1A#$2A#$3A
function FindString(FileName, FindStr: string): Int64;
var
FileStream: TFileStream;
i: Int64;
Buff: string;
begin
FileStream := TFileStream.Create(FileName, fmOpenRead);
SetLength(Buff, FileStream.Size);
FileStream.Position := ;
FileStream.ReadBuffer(PChar(Buff)^, FileStream.Size);
i := Pos(FindStr, Buff);
if i > then Result := i- else Result := ;
FileStream.Destroy;
end;
http://www.cnblogs.com/jxgxy/archive/2009/03/12/1409481.html