Jump to content
Sign in to follow this  
E1M1

Why C# can open process but autoit can't?

Recommended Posts

E1M1

Codes are same

_WinAPI_OpenProcess(0x001F0FFF, False, ProcessExists("game.exe"))

C#

m_lpHandle = Imports.OpenProcess(Imports.ProcessAccessFlags.All , false, pProcessId);

where All = 0x001F0FFF

and

processID = Process.GetProcessesByName("game")[0].Id;

If I run compiled C# exe as admin it returns handle. if I run compiled autoit as administrator,it gets error 5.


edited

Share this post


Link to post
Share on other sites
wolf9228

Codes are same

_WinAPI_OpenProcess(0x001F0FFF, False, ProcessExists("game.exe"))

C#

m_lpHandle = Imports.OpenProcess(Imports.ProcessAccessFlags.All , false, pProcessId);

where All = 0x001F0FFF

and

processID = Process.GetProcessesByName("game")[0].Id;

If I run compiled C# exe as admin it returns handle. if I run compiled autoit as administrator,it gets error 5.

#Include <WinAPI.au3>
$SYNCHRONIZE = (0x00100000)
$STANDARD_RIGHTS_REQUIRED = (0x000F0000)
$PROCESS_ALL_ACCESS  = ($STANDARD_RIGHTS_REQUIRED + $SYNCHRONIZE + 0xFFF)
$iProcessID = Run(@WindowsDir & "\Notepad.exe", "", @SW_MAXIMIZE)
WinWait("[CLASS:Notepad]")
$Processhandle = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False, $iProcessID)
MsgBox(0,"",$Processhandle)

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites
E1M1

following replacement makes it fail

#Include <WinAPI.au3>
$SYNCHRONIZE = (0x00100000)
$STANDARD_RIGHTS_REQUIRED = (0x000F0000)
$PROCESS_ALL_ACCESS  = ($STANDARD_RIGHTS_REQUIRED + $SYNCHRONIZE + 0xFFF)
$iProcessID = ProcessExists("Game.exe")
WinWait("[CLASS:Notepad]")
$Processhandle = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False, $iProcessID)
MsgBox(0,"",$Processhandle)

edited

Share this post


Link to post
Share on other sites
wolf9228

following replacement makes it fail

#Include <WinAPI.au3>
$SYNCHRONIZE = (0x00100000)
$STANDARD_RIGHTS_REQUIRED = (0x000F0000)
$PROCESS_ALL_ACCESS  = ($STANDARD_RIGHTS_REQUIRED + $SYNCHRONIZE + 0xFFF)
$iProcessID = ProcessExists("Game.exe")
WinWait("[CLASS:Notepad]")
$Processhandle = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False, $iProcessID)
MsgBox(0,"",$Processhandle)

WinWait("[CLASS:Notepad]")

#Include <WinAPI.au3>
$SYNCHRONIZE = (0x00100000)
$STANDARD_RIGHTS_REQUIRED = (0x000F0000)
$PROCESS_ALL_ACCESS  = ($STANDARD_RIGHTS_REQUIRED + $SYNCHRONIZE + 0xFFF)
$iProcessID = ProcessExists("Game.exe")
$Processhandle = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS,False, $iProcessID)
MsgBox(0,"",$Processhandle)
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites
E1M1

Wolf9228's code also doesn't work.


edited

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.