Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2007, 19:48
niom niom is offline
Friend
 
Join Date: Jul 2004
Posts: 21
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
niom Reputation: 0
starforce 4.7 emulation detection tricks explained

sf uses atleast 2 checks to figure out if its real deal or mounted.

check 1 - device stack:

basically, it checks if the topleveldeviceobjects of 2 devices are identically.
are they identically, its a real dvdrom, arent they, its daemontools. why this works
can be easily seen in tools like DeviceTree.

the code goes like this:

Code:
first it queries the toplevel deviceobject for the current drive:
	UNICODE_STRING driveName;
	RtlInitUnicodeString(&driveName, L"\\DosDevices\\d:");
	FILE_OBJECT *driveFO;
	DEVICE_OBJECT *driveDO;
	IoGetDeviceObjectPointer(&driveName, STANDARD_RIGHTS_READ, &driveFO, &driveDO);

then it loops over all attached cdrom devices:
	wchar_t *deviceNames;
	IoGetDeviceInterfaces(&GUID_DEVINTERFACE_CDROM, NULL, 0, &deviceNames);
	for (wchar_t *deviceNamesPos = deviceNames; *deviceNamesPos; deviceNamesPos += wcslen(deviceNamesPos) + 1)
	{

and queries the matching deviceobject for each device:
		UNICODE_STRING deviceName;
		RtlInitUnicodeString(&deviceName, deviceNamesPos);

		OBJECT_ATTRIBUTES attributes;
		InitializeObjectAttributes(&attributes, &deviceName, OBJ_CASE_INSENSITIVE, NULL, NULL);

		HANDLE device;
		IO_STATUS_BLOCK status;
		ZwCreateFile(&device, SYNCHRONIZE | FILE_READ_DATA, &attributes, &status, NULL, FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN, FILE_SYNCHRONOUS_IO_NONALERT, NULL, 0);

		FILE_OBJECT *deviceFileObject;
		ObReferenceObjectByHandle(device, FILE_READ_DATA, *IoFileObjectType, KernelMode, (void **)&deviceFileObject, NULL);

then it gets the stack top of that deviceobject
		DEVICE_OBJECT *deviceTop = IoGetAttachedDeviceReference(deviceFileObject->DeviceObject);

and compares it to the drive toplevel devobj, if they are identically, its a real cdrom
		if (deviceTop == driveDO)
			DbgPrint("hi, im a real cdrom\n");
		else
			DbgPrint("hi, im fake actually\n");
	}

check 2 - DPC:
starforce raises the IRQL to super high, then it queues a DPC. the DPC proc is pretty simple: it just writes 1
to some memoryaddr. then starforce starts an atapi read command. the trick is: the IRQL gets never lowered
when its a real cdrom and without lowering the IRQL, the DPC gets never executed, so the 1 gets never written.
but if daemontools was used, the IRQL drops sooner or later and the DPC gets executed, so the 1 gets written...
Reply With Quote
  #2  
Old 03-15-2007, 00:10
MR.HAANDI
 
Posts: n/a
Thats quite interesting, but do you know if Securom does the same thing to identify Daemon-tools?
Reply With Quote
  #3  
Old 03-15-2007, 01:57
deroko's Avatar
deroko deroko is offline
cr4zyserb
 
Join Date: Nov 2005
Posts: 217
Rept. Given: 13
Rept. Rcvd 30 Times in 14 Posts
Thanks Given: 7
Thanks Rcvd at 33 Times in 16 Posts
deroko Reputation: 30
no, securom doesn't use driver.
And for all listed operations driver is required.

@niom: tnx for sharing this info. I really like DPC trick
__________________
http://accessroot.com
Reply With Quote
  #4  
Old 03-15-2007, 02:15
evlncrn8 evlncrn8 is offline
VIP
 
Join Date: Sep 2005
Posts: 179
Rept. Given: 36
Rept. Rcvd 54 Times in 24 Posts
Thanks Given: 50
Thanks Rcvd at 118 Times in 70 Posts
evlncrn8 Reputation: 54
doubt it, securom doesnt go ring 0 anymore...
Reply With Quote
  #5  
Old 03-15-2007, 04:03
MR.HAANDI
 
Posts: n/a
Sorry, I'm not fully into that reversing area (currently reading introductions into wriing drivers), but I thought Securom uses its SIntf.dll or CmdLineExt.dll and it is not possible to get as deep as it does without drivers.
But still I wonder how Securom gets its dirty job done.
Reply With Quote
  #6  
Old 03-24-2007, 01:17
souz souz is offline
Friend
 
Join Date: Jan 2005
Posts: 134
Rept. Given: 0
Rept. Rcvd 26 Times in 18 Posts
Thanks Given: 13
Thanks Rcvd at 86 Times in 35 Posts
souz Reputation: 26
is it possible to get StarForce SDK?
Reply With Quote
  #7  
Old 03-24-2007, 02:36
lord_Phoenix
 
Posts: n/a
souz :: YOu should buy SF to get SDK, or.. I dont know another way. Btw, v0ldemar posted one files from SF's SDK on this forum
Reply With Quote
  #8  
Old 03-24-2007, 16:43
evlncrn8 evlncrn8 is offline
VIP
 
Join Date: Sep 2005
Posts: 179
Rept. Given: 36
Rept. Rcvd 54 Times in 24 Posts
Thanks Given: 50
Thanks Rcvd at 118 Times in 70 Posts
evlncrn8 Reputation: 54
Quote:
Originally Posted by BUBlic
Sorry, I'm not fully into that reversing area (currently reading introductions into wriing drivers), but I thought Securom uses its SIntf.dll or CmdLineExt.dll and it is not possible to get as deep as it does without drivers.
But still I wonder how Securom gets its dirty job done.
what does cmdlineext.dll sound like its for?
commandline context menu maybe for the 'launch analysis' ?
sintf.dll is way old too

if you wonder how it gets its job done, then start debugging and not making assumptions
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Legend of Zelda Ultimate Glitch Explained [Arbitrary Code Execution] mcp General Discussion 1 09-20-2016 16:48
starforce - again... etienne General Discussion 13 02-26-2007 18:16
StarForce going down? dyn!o General Discussion 16 09-08-2004 07:37


All times are GMT +8. The time now is 13:59.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( Since 1998 )