Autor Beitrag
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: So 26.09.04 20:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
const THREAD_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED or SYNCHRONIZE or $3FF;//$1F03FF;
var tid: cardinal;
    OpenThread: function(dwDesiredAccess: integer; bInheritHandle: boolean; dwThreadId: integer): integer; stdcall;
begin
  @OpenThread := getprocaddress(getmodulehandle('kernel32.dll'),'OpenThread');
  CreateThread(nil,0,@nane,nil,0,tid);
  ot := OpenThread(THREAD_ALL_ACCESS,true,tid);
  while SuspendThread(ot) = -1 do;
  if getthreadcontext(ot,context) then
  begin
    context.Eip := 1;
    if setthreadcontext(ot,context) then
    begin
      resumethread(ot);
    end;
  end;
end;


warum crashed das prog net?
der thread wird wieder resumed, also sollte EIP changen gefunzt haben, und demnach müsste es crashen

nane ist ne endlosschleife
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 26.09.04 23:44 
Warum sollte es denn deiner Meinung nach crashen?

Und warum importierst du OpenThread selber? Sollte in Windows.pas definiert sein.
uall@ogc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mo 27.09.04 17:53 
nein ist nicht in der windows.pas
und beim EIP changen sollte es crashen

der fehler war das ich contextflags nicht gesetzt habe
d.h. der hat nix ausgelsen und nich geändert
aber set und getcontext hatte geklappt :>

context.ContextFlags := context_full

hatte gefehlt
trotzdem thx