Einzelnen Beitrag anzeigen

Neotracer64

Registriert seit: 27. Okt 2004
292 Beiträge
 
Delphi 7 Professional
 
#7

Re: CreateProcessWithLogonW in Verbindung mit DEBUG_PROCESS

  Alt 4. Jan 2008, 19:14
Der einzige Grund, der mich davon abhielt den Quelltext zu posten war, dass ich es in FASM geschrieben habe.

Delphi-Quellcode:
;--------------------------------------------------------------
; CreateProcessA Callback
; -------------------------------------------------------------
proc myCreateProcessA stdcall, lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles,\
                               dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation
     CMP Byte [User], NULL
     JE .proceed
     invoke MultiByteToWideChar, CP_ACP, 0, User, -1, UserW, 64
     invoke MultiByteToWideChar, CP_ACP, 0, Pass, -1, PassW, 64
     invoke MultiByteToWideChar, CP_ACP, 0, [lpCommandLine], -1, lpCommandLineW , (2*MAX_PATH)+2
     ;invoke MultiByteToWideChar, CP_ACP, 0, [lpCurrentDirectory], -1, lpCurrentDirectoryW , (2*MAX_PATH)+2

     TEST EAX, EAX
     JZ .failure
     invoke CreateProcessWithLogonW, UserW, NULL, PassW, 1, NULL, lpCommandLineW ,DEBUG_ONLY_THIS_PROCESS, [lpEnvironment],\
                                          NULL, [lpStartupInfo], [lpProcessInformation]
     ret
.proceed:
    invoke CreateProcessA, [lpApplicationName], [lpCommandLine], [lpProcessAttributes], [lpThreadAttributes],\
                           [bInheritHandles], [dwCreationFlags], [lpEnvironment], [lpCurrentDirectory], [lpStartupInfo],\
                           [lpProcessInformation]
    ret
.failure:
    invoke MessageBoxA, [MainwHandle], lpTextErrorLogon, lpTitleError, MB_ICONERROR
    XOR EAX, EAX
    ret
endp
Ich hooke die Funktion CreateProcessA und möchte nun den Prozess mit User Credentials starten.
Wenn ich statt DEBUG_ONLY_THIS_PROCESS eine 0 angebe, startet der Prozess.

Also ich bin mir angesichts dieser Tatsache sehr sicher, dass DEBUG_ONLY_THIS_PROCESS / DEBUG_PROCESS nicht mit CreateProcessWithLogonW kompatibel ist.
  Mit Zitat antworten Zitat