How To Remove Watermark By Programing
Sunday, May 10, 2009
Some friends asked me how to remove the watermark by programming, now, I have post a demo to google code. You can found the source code at http://code.google.com/p/removewatermark/
Main steps:
Load the user32.dll.mui into memory by API LoadLibraryEx().
Find the string table by FindResourceEx(), and load it by LoadResource(), LockResource().
Look up the watermark string in string table, we can get the string virtual address and length, then calculate the string offset base the module address, and we get the file offset.
Map the file to memory, just simple zero the watermark string.
In order to make the procedure simple, so use the simplest method.
Finally, re-check sum the file.
OK, all done.
Code snippet:
// Load string from resource with special langID
//
BOOL LoadStringExx(
HINSTANCE hInst, // Hinstance of lib
WORD wLangID, // Language ID of resource
PRES_STRING_INFO pInfo // Pointer to the string info
)
{
HRSRC hFindRes; // Handle of the resources has been found
HGLOBAL hLoadRes; // Handle of the resources has been loaded
LPVOID pRes; // Pointer to the resources
UINT nBlockID; // String block ID
pInfo->dwFileOffset = 0; // String offset in the file
pInfo->dwBytes = 0; // String length, in bytes
pInfo->pszText = NULL;
nBlockID = pInfo->uStringID / 16 + 1;
__try
{
// find the string block
hFindRes = FindResourceEx(hInst, RT_STRING, MAKEINTRESOURCE(nBlockID), wLangID);
if(!hFindRes )
{
__leave;
}
hLoadRes = LoadResource(hInst, hFindRes);
if(!hLoadRes )
{
__leave;
}
pRes = LockResource(hLoadRes);
if(!pRes )
{
__leave;
}
WCHAR* pParse = (WCHAR *)pRes; // Pointer to the String block
UINT nIndex = pInfo->uStringID % 16; // Calculate the string index
int nLen;
UINT i;
// 16 strings per block
for( i = 0; i < (nIndex & 15); i++ )
{
pParse += 1 + (int)*pParse;
}
// OK, we get it
nLen = (UINT)*pParse; // The length of the target string.
pParse += 1; // Pointer to the target string
// Main point, calculate the string offset
pInfo->dwFileOffset = (DWORD) ( (DWORD_PTR)pParse - (DWORD_PTR)hInst ) + 1;
pInfo->dwBytes = nLen * sizeof(WCHAR);
// allocate memory
pInfo->pszText = (LPWSTR)MALLOC((nLen + 1) * sizeof(WCHAR));
if (!pInfo->pszText)
__leave;
// copy string for return
CopyMemory((LPVOID)pInfo->pszText, (LPVOID)pParse, pInfo->dwBytes);
*(PWCHAR)((DWORD_PTR)pInfo->pszText + pInfo->dwBytes) = 0;
}
__finally
{
// Clean up, free memory
if (pRes)
UnlockResource(pRes);
if (hFindRes)
FreeResource(hFindRes);
}
// if pointer is null, we return a NULL string
if (!pInfo->pszText)
{
pInfo->pszText = (LPWSTR)MALLOC(sizeof(WCHAR));
pInfo->pszText[0] = 0;
}
return TRUE;
} // LoadStringExx()
Posted by deepxw at 00:10 |
Labels: Programing


How to sign an application, the easiest way (add valid own certificate to a exe by compiling)?
Sorry if this has nothing to do with your post, but your program (Universal Theme Patcher) doesn't work with my Windows 7 Build 7077, can I send you the files so you can patch them manually? Thanks-
Hi,
since I have used the program on two different pcs it seems there may be a bug. AFter installation and the watermarks are gone one cannot rename the names/titles of the desktop shortcuts. They simply vanish and one needs to immediately take it back in order to receive the shortcuticon back.
How can I undo the installation? Have tried to copy the backupfile back over the other one, but it did not change a bit. Please check that out and advise.
Kind regards (please mail to: 928773446@telefonica.net
thanks so much for providing all these utilities and updating them all the time, and always the best quality. i really appreciate it!
In 64bit Windows, you need to path 6 files (include 32/64) by Universal Theme Patcher).
You need to restart computer.
To 928773446:
This program only get rid of the string, I have not found the matter about desktop shortcuts.
This is demo program, in default, it will not replace the user32.dll.mui in system32 dolfer.
A backup file user32.dll.mui locate in the same folder, you can restoure it as user32.dll.mui.
Run mcbuilder.exe to rebuild cache.
I have several pictures on a cd that have a watermark on them and I would like to know how to remove them. It is a bunch of words all over the pictures. They are not professional and I need help so I can print them off of the computer. Anyone know how to help me?
And For more information about on this topic Visit Here
Its quiet interesting article..
Yaa i will try on some images thanks for sharing
Intimately, the post is actually the best on this laudable topic. I harmonize with your conclusions and will eagerly look forward to your future updates...
This won't really have success, I consider like this.
omg haha ok http://i13.freepicshare.com/d4.php?0h5d0o&req=Picture43.JPG
This is such a terrific and useful topic that you’re shared with. I’m satisfied by the way you brought out ideas. Thanks for sharing.
Thanks for sharing the code - I have always wondered how to do this.
Loved the whole article! Many thanks!
vrnjacka banja smestaj
vrnjacka banja privatni smestaj
I'm so excited. I really appreciate sharing this great post. Keep up your excellent work.
bojanke
bojanke za printanje
gledanje u solju
Great post. I think one of the basic things that we should know know is that we must always make sure that you are safe in every transactions you wanted to indulge with.
cheap goose jackets online sale Denmark Canada, UK,
goose trillium parka jackets online sale Denmark Canada, UK,
Canada goose freestyle vest online sale Denmark Canada, UK,
Canada Goose Chilliwack Bomber sale online sale Denmark Canada, UK,
Canada Goose Mens Citadel jackets online sale Denmark Canada, UK,
cheap Goose Expedition Parka coats online sale Denmark Canada, UK,
canada goose snow mantra parka online sale Denmark Canada, UK,
Canada Goose Yorkville Parka Jackets online sale Denmark Canada, UK,
womens Goose Chilliwack Parka online sale Denmark Canada, UK,
womens Goose Expedition Parka online sale Denmark Canada, UK,
womens Goose Kensington Parka Jackets online sale Denmark Canada, UK,
womens Goose Montebello Parka jackets online sale Denmark Canada, UK,
Canada Goose Womens Solaris Parka online sale Denmark Canada, UK.
cheap goose jackets online sale Denmark Canada, UK,
goose trillium parka jackets online sale Denmark Canada, UK,
Canada goose freestyle vest online sale Denmark Canada, UK,
Canada Goose Chilliwack Bomber sale online sale Denmark Canada, UK,
Canada Goose Mens Citadel jackets online sale Denmark Canada, UK,
cheap Goose Expedition Parka coats online sale Denmark Canada, UK,
canada goose snow mantra parka online sale Denmark Canada, UK,
Canada Goose Yorkville Parka Jackets online sale Denmark Canada, UK,
womens Goose Chilliwack Parka online sale Denmark Canada, UK,
womens Goose Expedition Parka online sale Denmark Canada, UK,
womens Goose Kensington Parka Jackets online sale Denmark Canada, UK,
womens Goose Montebello Parka jackets online sale Denmark Canada, UK,
Canada Goose Womens Solaris Parka online sale Denmark Canada, UK.
Excellent post. I want to thank you for this informative read. I will bookmark this site and visit again..
Banje u Srbiji
Banje Srbije
It's quite hard to find a good website. And I am very satisfied to have come here. The publications are doing great and full of good insights. I would be glad to keep on coming back here to check for a new update.
Brilliant post and useful information…I think this is what I read somewhere…but I don’t know with your experience
I really loved this post. You write about this topic very well. I really like your blog and I will definitely bookmark it!
I have gained a lot of new things from this post. Thanks a bunch for this incredible article. Keep blogging.
Interesting post. I have been wondering about this issue, so thanks for posting.
It is a very informative and useful post thanks it is good material to read this post increases my knowledge.
Keep Sharing such a great things always!!
Su blog es muy bueno y me impresionó mucho. Este artículo, junto con las imágenes es bastante profunda y ofrece una buena panorámica del tema.
Intersting and beautiful blog lovely presentation thanks for sharing your views...microsoft windows vista We24support tech team are available 24/7 for repairs on computers, printers, laptops, desktops. Our tech team taken to new heights with our technician’s knowledge and support.at 1-866-978-0799 Microsoft Windows Vista support
Thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.
As I just started posting comments for blog and faced a lot of rejections. I think your suggestion would be helpful for me. I will let you know if this works for me.
so helping code.
thanks so much for providing all these utilities and updating them all the time
Facebook Themes
Excellent post. Very inspiring. We need more of this. I'm personally hoping to write a book of my own media activism experiences, to help inject some more optimism and hope into the world.
The source code includes a console program for demo the patch engine.
You can migrate it to your own
Thank you very much
Nice share mas bro
Cara Mengedit Template Blogspot
Daftar Situs Penyedia Template Blogger Gratis Yang SEO Friendly
Cara Memasang Meta Tag Dinamis di Blogspot | Blogger
Cara Mengedit Template Blog Agar Seo Friendly
Cara Membuat Template Blog Valid XHTML
Cara Membuat / Memasang Menu Navigasi Breadcrumbs Terindex Google
Cara Memasang / Menampilkan Author Blog di Google SERP
Usually I don't read article on blogs, but I wish to say that this write-up very forced me to take a look at and do it! Your writing taste has been surprised me. Thanks, quite nice article.
you have written nice words for every one really nice
nice tips
Thank you for sharing to us.there are many person searching about that now they will find enough resources by your post.I would like to join your blog anyway so please continue sharing with us. Agen Bola Online Sbobet.com Bola Tangkas Gratis Tangkasgame