Blizzhackers

Return of the Jedi

* Login   * Register    * FAQ    * Search

Join us on IRC: #bh@irc.synirc.net (or Mibbit Web IRC)


MuleFactory


It is currently Thu Jun 20, 2013 1:22 pm


All times are UTC [ DST ]





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 4:52 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
have a question about this api the second param'
it says it only has one SUPPORTED possibility... not that we can't obtain information and pass it on correct?
was kind of just wondering if this could be used to bypass NtQueryInformationProcess in a hook, by using this api to set proper Process Info o.O
Idk just woke up, still eh... :)
Had a long day yesterday coding syscalls which are still buggy-ish (or maybe its my write math fuck i hate console(External))
I know this api is INTENDED to set priority to memory within the workingset but, i was wondering if we could make our own ProcessInformationClass structure (modified of course) to pass on to this api.

BOOL  SetProcessInformation(
  _In_  HANDLE hProcess,
  _In_  PROCESS_INFORMATION_CLASS ProcessInformationClass,
  _In_reads_bytes_ ProcessInformation,
  _In_  DWORD ProcessInformationSize
);

Parameters

hProcess [in]

A handle to the process. This handle must have the PROCESS_SET_INFORMATION access right. For more information, see Process Security and Access Rights.
ProcessInformationClass [in]

The class of information to set. The only supported value is ProcessMemoryPriority.
ProcessInformation

Pointer to a structure that contains the type of information specified by the ProcessInformationClass parameter.

If the ProcessInformationClass parameter is ProcessMemoryPriority, this parameter must point to a MEMORY_PRIORITY_INFORMATION structure.
ProcessInformationSize [in]

The size in bytes of the structure specified by the ProcessInformation parameter.

If the ProcessInformationClass parameter is ProcessMemoryPriority, this parameter must be sizeof(MEMORY_PRIORITY_INFORMATION).

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 8:22 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
You developing for Windows 8?

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 8:46 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
You developing for Windows 8?

7 ultimate is what I am running

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 8:47 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
Says minimum supported client is 8 RP and Server 12. What are you trying to do, exactly? They probably wont fully support that function until Win8 is released.

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 9:00 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
use in anti warden routines o.O lol .

QueryInformationProcess
route code to ->
make_it_look_like_it_should(bool iswardencalling?){
if(! iswardencalling=true){
return
}
else{
SetProcessInformation(properfixupofeverything);
}
}

Jumpback

Call QueryInformationProcess ->return;
o.O

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 10:36 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
All it does is set the priority of the process. :/

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Fri Jun 22, 2012 11:34 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
if you call it with the only "supported" class info param yes...
other than that no... we can make our own structures to call it from...

Enumeration type PROCESS_INFORMATION_CLASS is used in calls to NtQueryInformationProcess and NtSetInformationProcess.

typedef enum _PROCESS_INFORMATION_CLASS {

ProcessBasicInformation, ProcessQuotaLimits, ProcessIoCounters, ProcessVmCounters, ProcessTimes, ProcessBasePriority, ProcessRaisePriority, ProcessDebugPort, ProcessExceptionPort, ProcessAccessToken, ProcessLdtInformation, ProcessLdtSize, ProcessDefaultHardErrorMode, ProcessIoPortHandlers, ProcessPooledUsageAndLimits, ProcessWorkingSetWatch, ProcessUserModeIOPL, ProcessEnableAlignmentFaultFixup, ProcessPriorityClass, ProcessWx86Information, ProcessHandleCount, ProcessAffinityMask, ProcessPriorityBoost, MaxProcessInfoClass

} PROCESS_INFORMATION_CLASS, *PPROCESS_INFORMATION_CLASS;

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Sat Jun 23, 2012 9:59 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
Looks like it is just a Win32 of the Nt function(s). For OS prior to Win8 RP, you'll probably need to call NtQuery/NtSet anyway.

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Mon Jun 25, 2012 5:05 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
Looks like it is just a Win32 of the Nt function(s). For OS prior to Win8 RP, you'll probably need to call NtQuery/NtSet anyway.

having trouble with NtQuery o.O

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Mon Jun 25, 2012 10:35 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
What kind of trouble?

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Tue Jun 26, 2012 5:08 pm 
 
User
User
User avatar

Joined: Mon May 28, 2012 12:25 pm
cant get the callgate setup proper o.O

_________________
-The greatest treason is to do the right deed, for the wrong reason-

Top
 Profile  
 Post subject: Re: SetProcessinformation [API] question
PostPosted: Tue Jun 26, 2012 5:41 pm 
 
User
User

Joined: Sat Mar 17, 2012 5:39 pm
You shouldn't need a callgate for NtQuery. All you have to do is set up a definition.

typedef NTSTATUS (WINAPI *NTQUERYINFORMATIONPROCESS)(HANDLE ProcessHandle, PROCESSINFOCLASS ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
NTQUERYINFORMATIONPROCESS NtQueryInformationProcess = (NTQUERYINFORMATIONPROCESS)GetProcAddress(LoadLibrary("Ntdll.dll"), "NtQueryInformationProcess");


If you don't have the proper headers, you can always define your own PROCESSINFOCLASS enumerations and structures. You can literally just Copy/Paste from MSDN.

Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron