MS Paint and Photos inivisibly watermark even locally generated output with GUID
Source: Hacker News โ
Reverse engineering reveals how Paint and Photos embed a server-issued GUID into the pixels of locally generated AI images. This research started with my curiosity about Paint. I recently had some success looking into less-explored Windows features like UCPD , WHESCVC , and I have long known that Microsoft added a bunch of AI features into the Paint app. I do not know if anyone actually uses Paint + AI to generate images, but I wanted to see how exactly the image generation works. Before I started, I expected that it simply called a remote API to do the image generation. However, after I set up Binary Ninja MCP with Codex and started the analysis, I soon realized that Microsoft actually shipped local models in Windows as part of Copilot. The Paint App is sitting in the following path (yes, they are all Windows Apps now): seg.onnxe 23.1 MB inseg_enc.onnxe 28.0 MB inseg_dec.onnxe 16.5 MB mager.onnxe 302.4 MB The format of seg.onnxe was previously known , i.e., when it is XORed with the string Microsoft_2023 , it becomes a normal ONNX file.
However, the format of the other three .onnxe files initially looked different. It turned out that Microsoft had not changed the algorithm, only the key. segapi.dll contains a small key registry: ps_enc_key.1.0.80-main -> "Microsoft_2023" ps_enc_key.1.0.81-main -> a 4,096-byte alphanumeric string After decryption, onnx.checker.check_model() works on all of them: While walking through these files, I found a Watermarker.dll : This is not super surprising to me, because while I interacted with the Paint app, I already discovered that it has a setting to embed a visible watermark to the image that it produces: The visible watermark is just a small Copilot logo at the bottom right of the image, which is totally normal. Then, out of nowhere, I decided to ask AI to analyze the DLL and see if it could also be embedding an invisible watermark. This is part of my intuition as a reverse engineer, because the file is 1.67 MB in size, which is unusually large for such trivial functionality (arguably, the visible watermark does not even require a separate DLL). Apparently, the recent Claude Code text-watermark announcement also played a role in prompting me to think about this possibility. To begin with, the visible watermark is added by Add Perceptible Watermark : CPBDoc::Save(...) | `-- perceptible-watermark save helper(bitmap, Watermark Setting) | +-- Watermark Setting::Never | `-- return the original bitmap | +-- Watermark Setting::Ask Every Time | `-- show the Yes / No confirmation popup | +-- No: return the original bitmap | `-- Yes: continue | `-- Always or confirmed Yes +-- Paint::AI::Get Perceptible Watermark Svg() `-- Paint::AI::Add Perceptible Watermark(bitmap, SVG stream) `-- composite the visible Copilot logo Then there is also a different Wmk Write Watermark function: Watermarker.dll !
Wmk Write Watermark ( output_pixels, payload, payload_length, width, height, stride, input_pixels, pixel_format); Tracing the call tree, we can see Wmk Write Watermark is called after a local Stable Diffusion image generation. And if Wmk Write Watermark fails, Paint converts the entire generation into an error rather than returning the image without it: Cocreator View Model::Generate Image Async(...) | `-- Paint::AI::Stable Diffusion Helpers::Generate Async(..., watermark Id, ...) | `-- Microsoft. Image Creation. Image Generator | `-- NPU-generated image result | +-- output safety/moderation checks | +-- Paint::AI::Add Watermark(bitmap, watermark Id) | | | `-- Watermarker.dll! Wmk Write Watermark(...) | | | +-- success: return the watermarked bitmap | `-- failure: turn generation into an error | `-- construct successful Stable Diffusion Result Then it is natural to ask what the incoming payload actually is. It quickly becomes apparent that it must be 16 bytes: if (payload_length 16 ) return - 5 ; It is funny to me that the code is using two different error codes when the payload is too short or too long.
โก Effects Interpreter
๐World Economymedium impact
What this means for you
- โถA story like this rarely stays local for long in a connected economy.
- โถWorld markets have a habit of reading between the lines of stories like this.
๐๏ธLocal Economymedium impact
What this means for you
- โถThe cost of a weekly food shop can creep up in the background.
- โถYour local economy has a way of catching these currents eventually.
๐ฆRates & Banksmedium impact
What this means for you
- โถRate decisions tend to follow data, not headlines, so patience is the norm.
- โถBase rate decisions are usually made on data trends, not single headlines.
โค๏ธHealthmedium impact
What this means for you
- โถA short walk or a chat with a friend can do wonders when headlines feel heavy.
- โถWorry has a way of spreading faster than the facts sometimes.
๐ทWealthlow impact
What this means for you
- โถYour overall wealth picture is unlikely to be defined by a single story like this.
- โถMarkets have a habit of overreacting first and settling down further down the line.
๐ Housinglow impact
What this means for you
- โถRental yields in the area could shift only slightly, if at all, from this.
- โถAny effect on bricks and mortar is likely to be slow and modest.
๐ Effects for your country
The U.S.'s central bank rate currently stands at 3.75%, so a global rates move like this could feed through to local borrowing costs. The U.S.'s economy is growing at 2.3% with inflation at 3.2%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the U.S.'s own central bank rate closely. With the U.S.'s unemployment at 4.4%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone โ the real impact in the U.S. depends more on local healthcare capacity than the figures above.
The UK's central bank rate currently stands at 3.75%, so a global rates move like this could feed through to local borrowing costs. The UK's economy is growing at 0.8% with inflation at 3.2%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the UK's own central bank rate closely. With the UK's unemployment at 5.6%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone โ the real impact in the UK depends more on local healthcare capacity than the figures above.
France's central bank rate currently stands at 2%, so a global rates move like this could feed through to local borrowing costs. France's economy is growing at 0.9% with inflation at 1.8%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track France's own central bank rate closely. With France's unemployment at 7.9%, personal-finance effects like this land on a labour market that is already under strain. Health-system effects are harder to localise from economic indicators alone โ the real impact in France depends more on local healthcare capacity than the figures above.
Romania's central bank rate currently stands at 6.5%, so a global rates move like this could feed through to local borrowing costs. Romania's economy is growing at 0.7% with inflation at 7.8%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track Romania's own central bank rate closely. With Romania's unemployment at 6%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone โ the real impact in Romania depends more on local healthcare capacity than the figures above.
The UAE's central bank rate currently stands at 3.65%, so a global rates move like this could feed through to local borrowing costs. The UAE's economy is growing at 3.1% with inflation at 2.5%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the UAE's own central bank rate closely. Health-system effects are harder to localise from economic indicators alone โ the real impact in the UAE depends more on local healthcare capacity than the figures above.