Friday, July 4, 2008

Snipping Tool on Server 2008 - no love?

Short:
Problem: Snipping Tool from Vista SKUs does not start on Server 2008 Solution:
  1. Create a new directory, SnipTool
  2. Copy System32\SnippingTool.exe to SnipTool
  3. Copy System32\en-US\SnippingTool.exe.mui to SnipTool\en-US
  4. Create a file called SnippingTool.exe.local in SnipTool directory.
  5. Download this Zip file
  6. Extract the contents of the Zip file, copy slc/x86/slc.dll to SnipTool directory (replace x86 with x64 on a 64-bit OS).



Long: Eh.. So, at work we are 'blessed' with using '08 Server as a workstation. Also, at work we sometimes like to file bugs. Also, some weird people prefer including screenshots for clarity. So here's the problem: 1. Vista has a neat component called Snipping Tool (SnippingTool.exe). 2. This component does not run on Srv'08 Task: Make it run on SRV'08 Bonus: Without patching the binary (cause that would be <scary_voice>illegal</scary_voice>) So, we fire up the debugger... 1. We figure out that the program runs if CTabLicense::GetBOOLPermission (bless the symbol server) returns 1. Cool..now, we could patch this, but we'll see if there's a (more) legal way. 2. Fire up IDA (on the afterthought, IDA was an overkill, the whole function listing fits into a single screen in ntsd), CTabLicense::GetBOOLPermission calls slc!SLGetWindowsInformationDWORD - new evil API added to Vista as a part of SPP (Software Protection Platform) that is just an obfuscated (for no obvious reason) wrapper for mysterious ntdll!NtQueryLicenseValue (19 Google results, 0 relevant..there are more results for ZwQueryLicenseValue, but still nothing relevant to SLP). 3. Look at import section in IDA, find out that SLGetWindowsInformationDWORD is the only API imported from SLC. 4. Write 10 lines of C code that implement DllMain and SLGetWindowsInformationDWORD always returning 1. 5. Compile that, place in the same directory as SnippingTool, create SnippingTool.exe.local to redirect DLL loading 6. Q.E.D. Tools used: ntsd, Idag64, VS2008

22 comments:

Scott McClenaghan said...

Hi there - thanks so much for posting on a way to get the SnippingTool working under Server 2008.

It's an invaluable little tool that I have been struggling without.

Unfortunately, whilst I have followed your instructions to the letter and checked and double-checked, I cannot get the application to execute. I can't give you much feedback as nothing actually happens (no errors, no porcesses in Task Manager as far as I can see).

I can email a screenshot of the SnipTool folder if that helps - maybe identify something stupid that I have missed?

Thanks again for your effort and hopefully you can help get this working for me!

msft.guy said...

@Scott: Here are some things to double-check:
0. Directory structure:
C:\tools\ <DIR>
C:\tools\en-US\ <DIR>
C:\tools\slc.dll
C:\tools\SnippingTool.exe
C:\tools\SnippingTool.exe.local
C:\tools\en-US\SnippingTool.exe.mui
1. You have copied both Snipping Tool .exe and .mui from Vista, same architecture (x86/x64) as your target OS, to the appropriate dirs (tools\ and tools\en-US\). If you are, say, on Japanese Windows, you need to copy mui file from system32\ja-JP\ to tools\ja-JP\ directory
2. You didn't copy exe to system32 dir with real slc.dll (duh!)
3. You have created SnippingTool.exe.local file in tools\ dir.
4. You are using appropriate architecture of fake slc.dll (x86/x64).
Troubleshooting process:
1. Verify that the same files in tools\ dir work on the source computer with Vista.
2. On Vista, verify that redirection works by attaching a debugger and checking that slc.dll is loading from your working dir, not from Windows dir. Command line:
ntsd.exe c:\tools\snippingTool.exe
Look at ntsd output, search for slc
Correct: ModLoad: 000007fe`fb1b0000 000007fe`fb1b3000 C:\Tools\slc.dll
Incorrect: ModLoad: 000007fe`fcfb0000 000007fe`fcfd8000 C:\Windows\system32\slc.dll
3. Using ProcMon, verify that:
- SnippingTool.exe.local file is successfully found (NAME_INVALID is OK, NAME_NOT_FOUND is bad)
- slc is loaded from c:\tools\ and not from system32 (skip if verified this in NTSD).
- delete Snipping Tool entry in HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache and verify that mui loads correctly

Good luck!

scottmcclenaghan said...

Hi MSFT guy,

Thanks so much for coming back to me on this. I was away for the weekend so only getting a chance to work through your post now.

Everything looks fine as regards the directory structure and file locations - I was careful to check that before posting the first time.

The one thing that stuck in my head was what you said in your reply above about the correct architecture for the files.

I had pinched a copy off the .mui file from a colleague in work (I didn't have my own Vista box handy) and it suddenly struck me that I wasn't entirely sure that he was running 64-bit. I replaced the .mui file I had lifted from him with a known 64-bit version and bingo - all was well!

I now have my handy little SnippingTool shortcut back on my Quicklaunch menu thanks to your efforts and your kind help at troubleshooting.

Many, many thanks for all your help...

Scott

Jdubalya said...

I am trying to make this work on a 2K8 Terminal Server. I too followed to directions but when I launch the app is reads 'The SnippingTool is not working on your computer right now, please restart your computer and try again.' Any ideas what might be wrong?

chribille said...

Hi There, wouaw, that sound very fine, i'm so used to that tool!

i followed all instructions, but there is one thing i'm not sure about :-)
i have no vista English client around. so i used an German Installation as source.
my 2008 installation is english..
do i have to make now a de-DE folder or en-US because the target installation is english, or is it only keboard-layout spesific?

i now use an entry de-DE as in the source-installation. (i tryed renaming the folder en-US without success )

when starting the application, i just receive a small windows with "white X circle icon", no additional error.

i've tried uninstalling tablet component on the vista install, copying the tools folder on it, and everything runs fine.

both x86 installation.

any idea?
or could you send me a copy of the en-US MSI file?


many thanks in advance
chris

David said...

It would appear that the download link for the slc.dll is broken. Any chance of reviving that?

Netweb said...

Thanks MSFT_Guy

Snipping tool now on Server 08 :)

Such a blessing this little tool that keeps the 'server' clean from installing other tools and the complete packages they come with.

Cheers,

Stephen

msft.guy said...

@jdubalya: works for me on 2k8 TS as a remote app.
@chribille: try getting en-us binaries from somewhere -)
@david: I fixed the link

Ben Winzenz said...

Hey msft-guy,

Thanks for the post. It worked great except for one thing. As soon as I launch the snipping tool, my mouse goes dead! I have to log out and log back on in order to use the mouse again. Any ideas? USB mouse, if it matters.

msft.guy said...

@Ben Winzenz: I can think of two things:
1. There's an app that installs a global low-level mouse hook, and that program interferes with the snipping tool. Troubleshooting: remove _everything_ from your autostart and see if it fixes the issue. Can also try safe mode.
2. There are custom mouse drivers that modify mouse behaviour/extend mouse buttons via some hook dlls that, again, interfere with the snipping tool. Troubleshooting: remove your mouse software and install generic USB HID drivers.

theloz said...

Thanks for an informative article. I thought it wasn't working, but I hadn't made the en-US folder. Very glad to have Snipping Tool!

Frederick said...

I had the same issue that some of the others were having, basically, I followed the instructions to the letter, and retried 3-4 times, rebooting in between, but no luck. This was my error "The SnippingTool is not working on your computer right now, please restart your computer and try again.". I finally figured out what was causing this error...
I was adding the Windows Server Backup feature when I noticed this other feature called "Desktop Experience"... hmmm...

So, I added it as well, rebooted, and it worked. My guess, is that the snipping tool depends on the feature, and regardless of the dll redirection, it won't work if the desktop experience is not installed.

Just my $.02

fredrik_goran said...

Hi

I´v got snippingtool working on our W2k8 x64 TS server, but the "send snip" button dosen´t work. It cant find outlook(wich is locally installed). The "send to mail recipiant" command works fine. Does snippingtool call on default mail client in another way perhaps?? any ideas??

Thanks again for a great hack :)

Regards

Fredrik

pabloch said...

Hi msft.guy
Thanks a lot!

I really appreciate that exist people like you that selflessly help us.
I use Windows Server 2008 64bits and your solution works perfectly on it.

Pablo CHEDID from Argentina

donald said...

Hmmm... When I double click on SnippingTool.exe I get an error message, saying it's not a valid Win32 application. Copied Snipping tool.exe from a Windows 7 (64 bit) machine to my working Server08 64 bit machine...
Now, when you say create a file called SnippingTool.exe.local what type of file format should that be? Thank you muchly, a lowly a- at MSFT.

msft.guy said...

@donald: Win7 version is probably incompatible with 2008 Server, try to find a Vista version (look at \\winbuilds or \\products).
Win7 Snipping Tool will probably work with Server 2008 R2 which is same codebase as 7.

donald said...

Thanks msft.guy, I'll see about doing that from a Vista machine.

Jenis Broad said...

Quite possibly the most succinct and current info I came across about this subject. Sure pleased that I discovered that site by accident. I’ll probably be subscribing for your feed so that I will get the most current updates. Like the information here.

Term Papers Essay Services

Allin Ones said...

Thanks for sharing problem fixing of snipping tool. Thanks.
Allin Once

Jack Bond said...

Thanks a lot for this beautiful post.It's very informative & knowledgeable post.I'm glad to read this post & have got some information from this post.
Friends,I've a fan blog based on Bradley vs Marquez fight.It's so interesting,exciting & enjoyable site.If you want,you can
Visit: http://marquezvsbradleyfight.net/
I'm sure that you must get more entertain & news of boxing.
Don't miss this site.

alfalakii said...

Thanks for sharing problem fixing of snipping tool. Thanks.

Rajneesh Tripathi said...

Thanks again for your effort and hopefully you can help get this working for me!
go here for best hacking tools for free http://best-hacker-tools.blogspot.com