Replies: 2 comments
-
It would have been smarter if I’d written it that way the first time, but since now the precedent is set, it needs to customize the background color to be a fair comparison, I think.
You might be able to draw text opaque but with the same background color as the window, but I bet that’s going to need a GDI call anyway!
Good catch, but I think we have to keep the custom color. If there’s a better/smaller way to accomplish the same thing, I’d be all for it!
- Dave
… On Jan 28, 2023, at 1:06 PM, Charles Stevens ***@***.***> wrote:
The tiny app has exactly one call into GDI, specifically SetBkMode() to set the Paint DC background mode to transparent for the call to DrawText(). Removing this one call removes 48 bytes from Tiny.exe and 9 bytes on the Crinkler version and I would expect it to have an equally outsized impact on the shellcode version of the app. One approach would be to simply set the window's background brush to WHITE_BRUSH. This would make the window client area white instead of some kind of gray. Is there another way to convince DrawText() of the window's background color?
—
Reply to this email directly, view it on GitHub <#23>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA4HCF3NEC5XDLHS4OP2RRLWUWC4ZANCNFSM6AAAAAAUJ25CZA>.
You are receiving this because you are subscribed to this thread.
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I agree. That is why I started this as a discussion as opposed to a bug. I did look SetBkColor is also a GDI call so not a win. I have not thought of anything else yet. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The tiny app has exactly one call into GDI, specifically SetBkMode() to set the Paint DC background mode to transparent for the call to DrawText(). Removing this one call removes 48 bytes from Tiny.exe and 9 bytes on the Crinkler version and I would expect it to have an equally outsized impact on the shellcode version of the app. One approach would be to simply set the window's background brush to WHITE_BRUSH. This would make the window client area white instead of some kind of gray. Is there another way to convince DrawText() of the window's background color?
Beta Was this translation helpful? Give feedback.
All reactions