sph4ck, a quick question:
Why can't I start the Hack using the GreateProcess function?
I'm using Delphi 2010 here is the code maybe you got an Idea?
Function:
Code:
function RunProcess(FileName: string; ShowCmd: DWORD; wait: Boolean; ProcID: PCardinal): Longword;
var
StartupInfo: TStartupInfo;
ProcessInfo: TProcessInformation;
begin
FillChar(StartupInfo, SizeOf(StartupInfo), #0);
StartupInfo.cb := SizeOf(StartupInfo);
StartupInfo.dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
StartupInfo.wShowWindow := ShowCmd;
if not CreateProcess(nil,
@Filename[1],
nil,
nil,
False,
CREATE_NEW_CONSOLE or
NORMAL_PRIORITY_CLASS,
nil,
nil,
StartupInfo,
ProcessInfo)
then
Result := WAIT_FAILED
else
begin
try
if not wait then
begin
if ProcID <> nil then ProcID^ := ProcessInfo.dwProcessId;
Result := S_OK;
exit;
end;
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
GetExitCodeProcess(ProcessInfo.hProcess, Result);
finally
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
end;
end;
end;
On ButtonClick:
Code:
if OpenDialog2.Execute then RunProcess(OpenDialog2.FileName,SW_SHOWNORMAL,True,ProcID);
MessageBox(0,'DONE',@OpenDialog2.FileName[1],0);
I can start every other exe I want, only the hack won't work..the DOS prompt opens for a second with a lot of text and then closes itself again. But it's too quick I cannot read the ErrorMsg or whatever text is printed.
Also ShellExecute won't work, because:
Code:
Warning: Could not load 'config' file, reverting to defaults: [Errno 2] No such
file or directory: 'config'
Config file exists and hack is working, when I manually click the exe!
Any help is appreciated!