How To Remove Watermark By Programing

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   |    

48 comments:

Anonymous said... May 10, 2009 at 9:30 PM  

How to sign an application, the easiest way (add valid own certificate to a exe by compiling)?

Anonymous said... May 11, 2009 at 1:02 AM  

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-

Anonymous said... May 14, 2009 at 8:26 AM  

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

hapbt said... May 16, 2009 at 1:17 PM  

thanks so much for providing all these utilities and updating them all the time, and always the best quality. i really appreciate it!

deepxw said... May 29, 2009 at 10:31 PM  

In 64bit Windows, you need to path 6 files (include 32/64) by Universal Theme Patcher).
You need to restart computer.

deepxw said... May 29, 2009 at 10:42 PM  

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.

Coolzajay said... April 15, 2010 at 7:26 PM  

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

Buy Generic Viagra Online said... March 8, 2011 at 5:04 PM  

Its quiet interesting article..
Yaa i will try on some images thanks for sharing

4d ultrasounds said... September 14, 2011 at 3:53 PM  

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...

vaginas said... October 5, 2011 at 3:10 PM  

This won't really have success, I consider like this.

low smoke zero halogen said... October 11, 2011 at 2:59 PM  

omg haha ok http://i13.freepicshare.com/d4.php?0h5d0o&req=Picture43.JPG

doctor reviews by patients said... October 19, 2011 at 8:06 PM  

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.

Gynexin Reviews said... November 6, 2011 at 12:12 AM  

Thanks for sharing the code - I have always wondered how to do this.

vrnjacka banja said... November 13, 2011 at 1:48 AM  

Loved the whole article! Many thanks!
vrnjacka banja smestaj
vrnjacka banja privatni smestaj

pepa prase igre said... November 26, 2011 at 5:29 PM  

I'm so excited. I really appreciate sharing this great post. Keep up your excellent work.
bojanke
bojanke za printanje
gledanje u solju

buy viagra said... November 29, 2011 at 7:00 AM  

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.

Anonymous said... December 3, 2011 at 4:21 PM  

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.

Anonymous said... December 3, 2011 at 4:25 PM  

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.

banja srbija said... December 11, 2011 at 7:27 PM  

Excellent post. I want to thank you for this informative read. I will bookmark this site and visit again..
Banje u Srbiji
Banje Srbije

Alarm Monitoring Atlanta said... December 23, 2011 at 3:41 PM  

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.

organic supplements said... January 2, 2012 at 6:22 PM  

Brilliant post and useful information…I think this is what I read somewhere…but I don’t know with your experience

dr sajjad khan said... January 4, 2012 at 4:55 AM  

I really loved this post. You write about this topic very well. I really like your blog and I will definitely bookmark it!

Classified Ads Goa said... January 4, 2012 at 5:32 AM  

I have gained a lot of new things from this post. Thanks a bunch for this incredible article. Keep blogging.

find doctors list said... January 17, 2012 at 2:38 PM  

Interesting post. I have been wondering about this issue, so thanks for posting.

Forzest said... January 20, 2012 at 12:17 PM  

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!!

dietas online said... January 26, 2012 at 3:57 PM  

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.

Anil Kumar Pal said... February 24, 2012 at 9:27 PM  

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

natural sleep aid said... March 6, 2012 at 7:07 PM  

Thanks for putting this together! This is obviously one great post. Thanks for the valuable information and insights you have so provided here.

curcumin said... March 12, 2012 at 9:43 PM  

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.

Plumber St Albans said... March 17, 2012 at 6:58 AM  

so helping code.

david said... April 21, 2012 at 3:02 PM  

thanks so much for providing all these utilities and updating them all the time

Facebook Themes

DIODICE AUTO said... June 11, 2012 at 3:23 AM  

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.

dissertation writing said... June 20, 2012 at 1:56 PM  

The source code includes a console program for demo the patch engine.
You can migrate it to your own

Agen Ibcbet said... August 10, 2012 at 11:40 AM  

Thank you very much

Ramzi said... August 16, 2012 at 5:44 PM  

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

sbobet said... August 28, 2012 at 4:35 PM  

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.

dissertation proposal said... September 27, 2012 at 7:54 PM  

you have written nice words for every one really nice

Jefry said... January 1, 2013 at 9:14 AM  

nice tips

Agen Bola said... March 21, 2013 at 9:45 AM  

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

kysonlb vuong said... June 18, 2013 at 10:25 PM  

I love to play Friv 4 games when you have spare time and enjoys watching football on TV and the like soccer Premier League, Spanish Premier
http://www.yepi.net.in

Agen Bola Online said... June 22, 2013 at 4:29 PM  

I must admit that this is one great insight. It surely gives a company the opportunity to get in on the ground floor and really take part in creating something special and tailored to their needs. Agen Sbobet Agen Ibcbet

Keluar Nanah Dari Alat Kelamin said... September 16, 2013 at 1:09 PM  

Terima kasih informasinya gan.

Obat Sipilis Ampuh
Obat Kencing Nanah
Obat Gonore Ampuh
Obat Raja Singa Ampuh
Obat Kutil Kelamin
Obat Wasir Ampuh
Obat Kondiloma Akuminata
Obat Klamidia Ampuh
Obat Herpes Genital Ampuh
Obat Bisul Kutil Kelamin
Obat Jengger Ayam Ampuh
Obat Kutil Kelamin

Akemi said... October 16, 2013 at 11:54 AM  

weight loads as well as mental faculties dimensions. Lastly, how much racket a person get depends on the type of video game you'll want to participate in dewapoker.com

Clark Davidson said... December 6, 2013 at 12:46 PM  

As a Web App Developer, this is a basic tutorial but still I am looking for it thanks man.

Judi Bola said... December 30, 2013 at 3:17 PM  

I am truly inspired by this online journal! Extremely clear clarification of issues is given and it is open to every living soul. I have perused your post, truly you have given this extraordinary informative data about it. Agen Bola

sbobet indonesia said... February 7, 2014 at 10:02 AM  

This is a great inspiring. I am pretty much pleased with your good work. You put really very helpful information. Looking to reading your next post. judi bola online

Judi Bola said... April 2, 2014 at 6:33 PM  

Thanks the info, interesting and add insight...
SenangPoker.com Agen Judi Poker Online Terpercaya

Indonesia

SayaPoker.com Agen Judi Poker dan Domino Online

Terpercaya Indonesia

PokerKiuKiu.com Agen Judi Poker dan Domino Uang Asli Indonesia
Poker757.com Agen Judi Poker Online Terpercaya Indonesia
CMCPoker.com AGEN JUDI POKER ONLINE,AGEN JUDI DOMINO ONLINE INDONESIA TERPERCAYA
ituPoker.com JUDI POKER, AGEN POKER, AGEN SITUS TARUHAN BANDAR JUDI POKER ONLINE

INDONESIA TERPERCAYA

ituDomino.com JUDI DOMINO, AGEN

DOMINO, AGEN JUDI DOMINO ONLINE INDONESIA TERPERCAYA

ituCasino.com AGEN JUDI CASINO ONLINE SBOBET 338A

INDONESIA TERPERCAYA

ituBola.com JUDI BOLA, AGEN BOLA, AGEN JUDI BOLA PIALA DUNIA
CMCPoker.com AGEN JUDI POKER ONLINE , AGEN JUDI DOMINO ONLINE INDONESIA TERPERCAYA
ituCasino.com AGEN JUDI CASINO ONLINE

SBOBET 338A INDONESIA TERPERCAYA


Prediksi Bola | Judi Online | Agen Casino | Taruhan Bola
Casino Online | Agen Bola | Prediksi Dan Berita Sepakbola
Agen Bola Online | Bandar Bola | Agen Casino| Situs Judi
Agen Bola | Taruhan Bola Online | Agen Casino Terpercaya
Taruhan Bola | Judi Online | AgenCasino Terpercaya
Agen Bola Online, Situs Judi Casino Online, Bandar Taruhan Bola

Sbobet said... April 7, 2014 at 3:34 PM  

Thanks so much with this fantastic new web site. I’m very fired up to show it to anyone. It makes me so satisfied your vast understanding and wisdom have a new channel for trying into the world. 338A Casino

Post a Comment

Next previous home
 
Copyright 2009 deepxw | TCP-Z, Best TCP/IP Patch