{"id":795,"date":"2009-02-07T17:18:14","date_gmt":"2009-02-07T15:18:14","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=795"},"modified":"2009-02-07T17:24:58","modified_gmt":"2009-02-07T15:24:58","slug":"developer-goodies-listresources-to-create-an-xml-file-from-binary-resources","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/795","title":{"rendered":"Developer Goodies: ListResources to create an XML file from binary resources"},"content":{"rendered":"<p>At some point you might need to start paying special care for resources. Why? Perhaps there might be a number of reasons, I had to when I was dealing with first OEM versions of software and then internationalization. The whole idea is to let development team keep on working on regular version of software, in English language, while build OEM versions and localized versions of software by only manipulation with resources. It is an extremely important aspect of development because engineers always have full hands of work to do and there is no justification for getting extra work for them to deal with.<\/p>\n<p>The first stage is development of regular English version of software and then other people replace resources to achieve desired branding (strings, titles, messages, icons, logos, version information, digital signatures; localized version whether they are resource duplicates for other languages or satellite DLLs), synchronize translations, prepare setup and distribution files.<\/p>\n<p>One of the really simple and useful utilities on this way is the one that converts linked resources into a human readable file, so that it is possible to search for specific string through all resources of a binary (and actually all resources of the package if a batch makes such text files out of all binaries and then Find in Files Visual Studio .NET IDE feature is used).<\/p>\n<p>ListResources writes an XML formatted file and prints infomration about:<\/p>\n<ul>\n<li>resource types, identifiers and languages<\/li>\n<li>extended information about:\n<ul>\n<li>menus RT_MENU<\/li>\n<li>dialog templates RT_DIALOG<\/li>\n<li>string tables RT_STRING<\/li>\n<li>message tables RT_MESSAGETABLE<\/li>\n<li>version information RT_VERSION<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre>C:\\ListResources \"%WINDIR%\\system32\\winhttp.dll\" &gt;winhttp.xml<\/pre>\n<p><!--more--><\/p>\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em; padding-left: 30px;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceTypes<\/span><span class=\"t\"> Path<\/span><span class=\"m\">=&#8221;<\/span><strong>C:\\WINDOWS\\system32\\winhttp.dll<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div style=\"padding-left: 30px;\">\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceType<\/span><span class=\"t\"> Type<\/span><span class=\"m\">=&#8221;<\/span><strong>REGINST<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> TypeName<\/span><span class=\"m\">=&#8221;<\/span><strong>REGINST<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceName<\/span><span class=\"t\"> Name<\/span><span class=\"m\">=&#8221;<\/span><strong>REGINST<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceLanguage<\/span> <span class=\"t\">Language<\/span><span class=\"m\">=&#8221;<\/span><strong>1033<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> LanguageName<\/span><span class=\"m\">=&#8221;<\/span><strong>English<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Size<\/span><span class=\"m\">=&#8221;<\/span><strong>887<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>721e554b610a3b07538204583da411eb<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div><span class=\"b\"> <\/span> <span class=\"m\">&lt;\/<\/span><span class=\"t\">ResourceName<\/span><span class=\"m\">&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div><span class=\"b\"> <\/span> <span class=\"m\">&lt;\/<\/span><span class=\"t\">ResourceType<\/span><span class=\"m\">&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceType<\/span><span class=\"t\"> Type<\/span><span class=\"m\">=&#8221;<\/span><strong>TYPELIB<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> TypeName<\/span><span class=\"m\">=&#8221;<\/span><strong>TYPELIB<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceName<\/span><span class=\"t\"> Name<\/span><span class=\"m\">=&#8221;<\/span><strong>#1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceLanguage<\/span> <span class=\"t\">Language<\/span><span class=\"m\">=&#8221;<\/span><strong>1033<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> LanguageName<\/span><span class=\"m\">=&#8221;<\/span><strong>English<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Size<\/span><span class=\"m\">=&#8221;<\/span><strong>8460<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>249b65118804778f9ed7ae9d154f93db<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div><span class=\"b\"> <\/span> <span class=\"m\">&lt;\/<\/span><span class=\"t\">ResourceName<\/span><span class=\"m\">&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div><span class=\"b\"> <\/span> <span class=\"m\">&lt;\/<\/span><span class=\"t\">ResourceType<\/span><span class=\"m\">&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceType<\/span><span class=\"t\"> Type<\/span><span class=\"m\">=&#8221;<\/span><strong>#11<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> TypeName<\/span><span class=\"m\">=&#8221;<\/span><strong>Message Table<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceName<\/span><span class=\"t\"> Name<\/span><span class=\"m\">=&#8221;<\/span><strong>#1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div class=\"c\" style=\"margin-left: 1em; text-indent: -2em;\"><a class=\"b\" onclick=\"return false\" href=\"#\" onfocus=\"h()\">&#8211;<\/a> <span class=\"m\">&lt;<\/span><span class=\"t\">ResourceLanguage<\/span><span class=\"t\"> Language<\/span><span class=\"m\">=&#8221;<\/span><strong>1033<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> LanguageName<\/span><span class=\"m\">=&#8221;<\/span><strong>English<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Size<\/span><span class=\"m\">=&#8221;<\/span><strong>7980<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>949f0ef6cf1303c62f7fbb53f5a18465<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\">&gt;<\/span><\/div>\n<div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">Message<\/span> <span class=\"t\">HexCode<\/span><span class=\"m\">=&#8221;<\/span><strong>0x00000001<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Code<\/span><span class=\"m\">=&#8221;<\/span><strong>1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Text<\/span><span class=\"m\">=&#8221;<\/span><strong>%1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>3427795bc6ca28fa971b7f822a73b994<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">Message<\/span> <span class=\"t\">HexCode<\/span><span class=\"m\">=&#8221;<\/span><strong>0x00000002<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Code<\/span><span class=\"m\">=&#8221;<\/span><strong>2<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Text<\/span><span class=\"m\">=&#8221;<\/span><strong>%1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>3427795bc6ca28fa971b7f822a73b994<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">Message<\/span> <span class=\"t\">HexCode<\/span><span class=\"m\">=&#8221;<\/span><strong>0x00000004<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Code<\/span><span class=\"m\">=&#8221;<\/span><strong>4<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Text<\/span><span class=\"m\">=&#8221;<\/span><strong>%1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>3427795bc6ca28fa971b7f822a73b994<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">Message<\/span> <span class=\"t\">HexCode<\/span><span class=\"m\">=&#8221;<\/span><strong>0x00002ee0<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Code<\/span><span class=\"m\">=&#8221;<\/span><strong>12000<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Text<\/span><span class=\"m\">=&#8221;<\/span><strong>WINHTTP_ERROR_BASE<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>978b9da3a79491fbd3b91afaf0334db3<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<div class=\"e\">\n<div style=\"margin-left: 1em; text-indent: -2em; padding-left: 30px;\"><span class=\"b\"> <\/span> <span class=\"m\">&lt;<\/span><span class=\"t\">Message<\/span> <span class=\"t\">HexCode<\/span><span class=\"m\">=&#8221;<\/span><strong>0x00002ee1<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Code<\/span><span class=\"m\">=&#8221;<\/span><strong>12001<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Text<\/span><span class=\"m\">=&#8221;<\/span><strong>No more WinHttp handles can be  allocated<\/strong><span class=\"m\">&#8220;<\/span><span class=\"t\"> Digest<\/span><span class=\"m\">=&#8221;<\/span><strong>071649fd2596a3323e789e75d71f3422<\/strong><span class=\"m\">&#8220;<\/span><span class=\"m\"> \/&gt;<\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>One of the uses of the utility was to write all resources into XML files and search to make sure that in process of re-branding no original software title remained in the entire distribution.<\/p>\n<p>A partial Visual C++ .NET 2008 source code is <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/ListResources\">available from SVN<\/a>, release binary <a href=\"http:\/\/code.assembla.com\/roatl-utilities\/subversion\/nodes\/trunk\/ListResources\/Release\/ListResources.exe?format=raw\">included<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At some point you might need to start paying special care for resources. Why? Perhaps there might be a number of reasons, I had to when I was dealing with first OEM versions of software and then internationalization. The whole idea is to let development team keep on working on regular version of software, in&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/795\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13,2],"tags":[487,166,132,167],"class_list":["post-795","post","type-post","status-publish","format-standard","hentry","category-atl","category-source","category-utilities","tag-atl","tag-resource","tag-utility","tag-xml"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/795","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=795"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/795\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=795"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=795"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=795"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}