{"id":10257,"date":"2025-11-27T23:28:55","date_gmt":"2025-11-27T23:28:55","guid":{"rendered":"https:\/\/www.hexacorn.com\/blog\/?p=10257"},"modified":"2025-11-27T23:28:55","modified_gmt":"2025-11-27T23:28:55","slug":"a-silly-rundll-ish-feature-of-shellabout-function","status":"publish","type":"post","link":"https:\/\/www.hexacorn.com\/blog\/2025\/11\/27\/a-silly-rundll-ish-feature-of-shellabout-function\/","title":{"rendered":"A silly rundll-ish feature of ShellAbout function&#8230;"},"content":{"rendered":"\n<p>When you run <em>winver<\/em> it calls the shell32.dll!<a href=\"https:\/\/learn.microsoft.com\/en-us\/windows\/win32\/api\/shellapi\/nf-shellapi-shellabouta\">ShellAbout<\/a> function to display the following dialog box:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout1.png\"><img decoding=\"async\" loading=\"lazy\" width=\"460\" height=\"423\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout1.png\" alt=\"\" class=\"wp-image-10258\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout1.png 460w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout1-300x276.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout1-326x300.png 326w\" sizes=\"(max-width: 460px) 100vw, 460px\" \/><\/a><\/figure>\n\n\n\n<p>It turns out the <em>ShellAbout<\/em> function&#8217;s declaration makes it a potential target for calling it from <em>rundll32.exe<\/em>, even if its prototype doesn&#8217;t follow the rundll32 calling protocol.<\/p>\n\n\n\n<p>The function accepts the following parameters:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">INT ShellAboutA(\n  [in, optional] HWND   hWnd,\n  [in]           LPCSTR szApp,\n  [in, optional] LPCSTR szOtherStuff,\n  [in, optional] HICON  hIcon\n);<\/pre>\n\n\n\n<p>and the rundll32 callback is declared as:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">RunDll32EntryPoint(\nHWND hwnd, \nHINSTANCE hinst, \nLPSTR lpszCmdLine, \nint nCmdShow\n);<\/pre>\n\n\n\n<p>In other words, the mapping of the function arguments looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HWND   hWnd -> HWND hwnd\nLPCSTR szApp -> HINSTANCE hinst\nLPCSTR szOtherStuff -> lpszCmdLine\nHICON  hIcon -> nCmdShow<\/pre>\n\n\n\n<p>So, by calling:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rundll32.exe shell32.dll, ShellAbout Visit http:\/\/extend-windows-license-by-10-years-for-free.com now!<\/pre>\n\n\n\n<p>we fill-in the following bit:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">LPCSTR szOtherStuff -> lpszCmdLine<\/pre>\n\n\n\n<p>with a string provided via a command line.<\/p>\n\n\n\n<p>And as the API documentation describes, this parameter is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">A pointer to a null-terminated string that contains text to be displayed in the dialog box after the version and copyright information. This parameter can be NULL.<\/pre>\n\n\n\n<p>Thanks to that coincidence, the result of our rundl32 invocation is the following dialog box:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout2.png\"><img decoding=\"async\" loading=\"lazy\" width=\"460\" height=\"423\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout2.png\" alt=\"\" class=\"wp-image-10259\" srcset=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout2.png 460w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout2-300x276.png 300w, https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout2-326x300.png 326w\" sizes=\"(max-width: 460px) 100vw, 460px\" \/><\/a><\/figure>\n\n\n\n<p>If you paid attention, you probably noticed that the title of the dialog box got corrupted:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout3.png\"><img decoding=\"async\" loading=\"lazy\" width=\"69\" height=\"34\" src=\"https:\/\/www.hexacorn.com\/blog\/wp-content\/uploads\/2025\/11\/shellabout3.png\" alt=\"\" class=\"wp-image-10260\"\/><\/a><\/figure>\n\n\n\n<p>but that&#8217;s a side-effect of <em>szApp<\/em> parameter getting some random value from the stack\/rdx register (if you follow the calling conventions of x86\/x64).<\/p>\n\n\n\n<p>Rest assured that this is not a security risk, but just yet another example of using Windows API in a slightly unorthodox way, similar to this <a href=\"https:\/\/www.hexacorn.com\/blog\/2019\/04\/06\/messages-from-beyond-the-grave\/\">example<\/a> I posted about a few years back&#8230; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you run winver it calls the shell32.dll!ShellAbout function to display the following dialog box: It turns out the ShellAbout function&#8217;s declaration makes it a potential target for calling it from rundll32.exe, even if its prototype doesn&#8217;t follow the rundll32 &hellip; <a href=\"https:\/\/www.hexacorn.com\/blog\/2025\/11\/27\/a-silly-rundll-ish-feature-of-shellabout-function\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[53],"tags":[],"_links":{"self":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10257"}],"collection":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/comments?post=10257"}],"version-history":[{"count":2,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10257\/revisions"}],"predecessor-version":[{"id":10263,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/posts\/10257\/revisions\/10263"}],"wp:attachment":[{"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/media?parent=10257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/categories?post=10257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hexacorn.com\/blog\/wp-json\/wp\/v2\/tags?post=10257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}