| |
|
|
- Página 1 - |
|
 | ¡Hola Personas...
El API ZwQueryVirtualMemory Yo sí todavía bien hinbekommen, pero en ZwOpenProcess stehe Yo en el Augenblick en el Schlauch. Folgender Quellcode: KompilierenMarcaSeparaciónDef @ZwOpenProcess(4) !"NTDLL.DLL","ZwOpenProcess"
DEF @LsaNtStatusToWinError(1) !"advapi32","LsaNtStatusToWinError"
Def @GetCurrentProcessID(0) !"KERNEL32","GetCurrentProcessId"
Def @CloseHandle(1) !"KERNEL32","CloseHandle"
Def @GetLastError(0) !"KERNEL32","GetLastError"
Def @SetLastError(1) !"KERNEL32","SetLastError"
DEF @AHFormatMessage(7) !"KERNEL32","FormatMessageA"
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$
Declare NT_Fehler&,WIN_FEHLER&,P_Handle&,P_ID&
Windowstyle 31
WindowTitle "ZwOpenProcess"
Window 0,0-780,440
LET P_ID&=@GetCurrentProcessID()
@SetLastError(0)
LET NT_FEHLER&=@ZwOpenProcess(@ADDR(P_Handle&),$400,0,P_ID&)
LET AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach ZwOpenProcess: "+AHGETERROR_Buffer$
LET WIN_FEHLER&=@LsaNtStatusToWinError(NT_FEHLER&)
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von ZwOpenProcess: "+AHGETERROR_Buffer$+" ("+@STR$(NT_FEHLER&)+")"
Print "ID des Prozesses: "+@STR$(P_ID&)
PRINT "Handle des Prozesses: "+@STR$(P_Handle&)
Print ""
IF P_Handle&<>0
@SetLastError(0)
LET Win_Fehler&=@CloseHandle(P_Handle&)
LET AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach CloseHandle: "+AHGETERROR_Buffer$
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von CloseHandle: "+AHGETERROR_Buffer$
Endif
While 0=0
Waitinput
wend
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@AHFormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Fehlercode in Landesspezifische Message um.
Let AHGETERROR_Buffer$=@TRIM$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
ENDPROC
Was mache Yo como para Fehler??? |
|
|
| |
|
|
|
| |
|
- Página 1 - |
|
 Sebastian König | ¡Hola Andreas,
hast Usted veces a la guten Link a Informationen encima ZwOpenProcess()?
MfG
Sebastian |
|
|
| |
|
|
|
 | ¡Hola Sebastian... Yo habe en el Augenblick sólo [...] . Def letzte Parámetro dürfte en me also no stimmen.. |
|
|
| |
|
|
|
 | |
|
| |
|
|
|
 | Der zweite Parámetro Será mejor que te va wohl ser, el ersten podría Yo tal vez en 0 conjunto. Hier Link: [...]  |
|
|
| |
|
|
|
 Sebastian König | Yo nehme a, du beziehst dich el hier: [quote:7063508387]NTSYSAPI NTSTATUS NTAPI ZwOpenProcess( OUT PHANDLE ProcessHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PCLIENT_ID ClientId OPTIONAL );
The ClientId parameter is a structure (defined en ntifs.h) that allows you to specify a process ID to open. Once the function succeeds, call ObReferenceObjectByHandle on the returned ProcessHandle to get at the PEPROCESS.[/quote:7063508387] El Definitionen para CLIENT_ID y OBJECT_ATTRIBUTES Yo schonmal gefunden: [quote:7063508387] typedef struct _OBJECT_ATTRIBUTES { ULONG Length; HANDLE RootDirectory; PUNICODE_STRING ObjectName; ULONG Attributes; PVOID SecurityDescriptor; PVOID SecurityQualityOfService; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
typedef struct _CLIENT_ID { HANDLE UniqueProcess; HANDLE UniqueThread; } CLIENT_ID, *PCLIENT_ID; [/quote:7063508387] Leider muss al todo wohl auch todavía passend füllen - zumindest el ObjectAttributes, ClientId es sí wohl optional.
Mit KompilierenMarcaSeparación kommt immerhin schonmal sólo todavía Falscher Parámetro. Irgendwie muss uno en efecto angeben, welchen Prozess uno überhaupt abierto möchte - entweder wohl en ClientId oder tal vez en ObjectName... |
|
|
| |
|
|
|
 | [quote:0009d0d868=Sebastian König]kommt immerhin schonmal sólo todavía Falscher Parámetro. Irgendwie muss uno en efecto angeben, welchen Prozess uno überhaupt abierto möchte - entweder wohl en ClientId oder tal vez en ObjectName...[/quote:0009d0d868] Angeben muß al scheinbar en ObjectName, CLIENT_ID de hecho puede 0 ser. Der Objektname podría el Name des Prozesses de el Taskmanasger ser. RootDirectory macht me algo Kopfzerbrechen - ni idea qué como hinkommt. SecurityDescriptor podría auch evtl 0 ser (a not bastele Yo incluso una), bin me como pero no bastante sicher. En SecurityQualityOfService bin Yo auch todavía no bastante sicher...
CLIENT_ID fehlte me todavía, besten Dank. |
|
|
| |
|
|
|
 | Bin zwar todavía no al Ziel, aber ya algo más: KompilierenMarcaSeparaciónDEF @MultiByteToWideChar(6) !"kernel32","MultiByteToWideChar"
Def @ZwOpenProcess(4) !"NTDLL.DLL","ZwOpenProcess"
DEF @LsaNtStatusToWinError(1) !"advapi32","LsaNtStatusToWinError"
Def @GetCurrentProcessID(0) !"KERNEL32","GetCurrentProcessId"
Def @CloseHandle(1) !"KERNEL32","CloseHandle"
Def @GetLastError(0) !"KERNEL32","GetLastError"
Def @SetLastError(1) !"KERNEL32","SetLastError"
DEF @AHFormatMessage(7) !"KERNEL32","FormatMessageA"
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$
Declare NT_Fehler&,WIN_FEHLER&,P_Handle&,P_ID&,Objekt_name$
Declare Attr#,Unicode_STR#
Windowstyle 31
WindowTitle "ZwOpenProcess"
Window 0,0-780,440
LET P_ID&=@GetCurrentProcessID()
@SetLastError(0)
Dim Attr#,24
Clear Attr#
Long Attr#,0=24
LET Objekt_name$="F:ProgrammeXProfan9PROFAN.EXE"
Dim Unicode_STR#,513
@MultiByteToWideChar(0,0,@ADDR(Objekt_name$),-1,Unicode_STR#,256)
Long Attr#,8=Unicode_STR#
Let Nt_fehler&=@Zwopenprocess(@Addr(P_handle&),$400,Attr#,0)
Dispose Attr#
LET AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach ZwOpenProcess: "+AHGETERROR_Buffer$
LET WIN_FEHLER&=@LsaNtStatusToWinError(NT_FEHLER&)
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von ZwOpenProcess: "+AHGETERROR_Buffer$+" ("+@STR$(NT_FEHLER&)+")"
Print "ID des Prozesses: "+@STR$(P_ID&)
PRINT "Handle des Prozesses: "+@STR$(P_Handle&)
Print ""
IF P_Handle&<>0
@SetLastError(0)
LET Win_Fehler&=@CloseHandle(P_Handle&)
LET AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach CloseHandle: "+AHGETERROR_Buffer$
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von CloseHandle: "+AHGETERROR_Buffer$
Endif
While 0=0
Waitinput
wend
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@AHFormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Fehlercode in Landesspezifische Message um.
Let AHGETERROR_Buffer$=@TRIM$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
/../../funktionsreferenzen/XProfan/ENDPROC/'>ENDPROC
|
|
|
| |
|
|
|
 Sebastian König | ¡Hola Andreas,
Yo [...] gerade todavía una Ejemplo gefunden. So funktioniert lo en me: KompilierenMarcaSeparación Einzufügen en Su ersten Code oben .
MfG
Sebastian |
|
|
| |
|
|
|
 | Gracias!
Tiempo schauen... |
|
|
| |
|
|
|
 | ¡Hola Sebastian...
Hier nun el komplette Code: KompilierenMarcaSeparaciónDef @ZwOpenProcess(4) !"NTDLL.DLL","ZwOpenProcess"
DEF @LsaNtStatusToWinError(1) !"advapi32","LsaNtStatusToWinError"
Def @GetCurrentProcessID(0) !"KERNEL32","GetCurrentProcessId"
Def @GetLastError(0) !"KERNEL32","GetLastError"
Def @SetLastError(1) !"KERNEL32","SetLastError"
DEF @AHFormatMessage(7) !"KERNEL32","FormatMessageA"
DEF @ZwClose(1) !"NTDLL","ZwClose"
Declare AHRückgabe&,AHGETERROR_Buffer#,AHGETERROR_Buffer$
Declare NT_Fehler&,WIN_FEHLER&,P_Handle&,P_ID&,Objekt_name$
Declare Attr#,Unicode_STR#,Id#
Windowstyle 31
WindowTitle "ZwOpenProcess"
Window 0,0-780,440
LET P_ID&=@GetCurrentProcessID()
Dim Attr#,24
DIM ID#,8
Long ID#,0=P_ID&
Clear Attr#
Long Attr#,0=24 Größe der Struktur
@SetLastError(0)
Let Nt_fehler&=@Zwopenprocess(@Addr(P_handle&),$400,Attr#,ID#)
LET AHRückgabe&=@GetLastError()
Dispose Unicode_STR#
Dispose ID#
Dispose Attr#
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach ZwOpenProcess: "+AHGETERROR_Buffer$
LET WIN_FEHLER&=@LsaNtStatusToWinError(NT_FEHLER&)
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von ZwOpenProcess: "+AHGETERROR_Buffer$+" ("+@STR$(NT_FEHLER&)+")"
Print "ID des Prozesses: "+@STR$(P_ID&)
PRINT "Handle des Prozesses: "+@STR$(P_Handle&)
Print ""
IF P_Handle&<>0
@SetLastError(0)
LET NT_Fehler&=@ZwClose(P_Handle&)
LET AHRückgabe&=@GetLastError()
Fehlercode_bestimmen
PRINT "Letzter API-Fehler nach ZwClose: "+AHGETERROR_Buffer$
LET WIN_FEHLER&=@LsaNtStatusToWinError(NT_FEHLER&)
LET AHRückgabe&=WIN_FEHLER&
Fehlercode_bestimmen
PRINT "Rückmeldung von ZwClose: "+AHGETERROR_Buffer$
Endif
While 0=0
Waitinput
wend
Proc Fehlercode_bestimmen
DIM AHGETERROR_Buffer#,32000
@AHFormatMessage($1000,0,AHRückgabe&,0,AHGETERROR_Buffer#,32000,0) Wandelt Fehlercode in Landesspezifische Message um.
Let AHGETERROR_Buffer$=@TRIM$(@STRING$(AHGETERROR_Buffer#,0))
Dispose AHGETERROR_Buffer#
/../../funktionsreferenzen/XProfan/ENDPROC/'>ENDPROC
Und Yo dir todavía sagen quería:  TOLL!  SUPER!!!  Vielen, vielen Dank  Jetzt kann Yo schauen, Yo así anfangen kann! <= Thats Windows
 |
|
|
| |
|
|
|
 Sebastian König | [quote:3d218d8a75]Jetzt kann Yo schauen, Yo así anfangen kann! <= Thats Windows[/quote:3d218d8a75] Ok, Yo bin gespannt, wofür todos bien es!  |
|
|
| |
|
|
| |
|
- Página 2 - |
|
|
 | Kann algo dauern, otra vez Nachtschicht - veces achauen, si Yo así weiterkomme. Im Augenblick scheint se el a bestätigen, Yo encima Windows denke... |
|
|
| |
|
|