{"id":2644,"date":"2010-08-05T23:13:02","date_gmt":"2010-08-06T06:13:02","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=2644"},"modified":"2020-07-25T23:55:08","modified_gmt":"2020-07-26T06:55:08","slug":"resurrecting-scd","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/","title":{"rendered":"Resurrecting SCD"},"content":{"rendered":"<p>When I became interested in reverse engineering all the way back in 2000, the first Win32 disassembler I stumbled across was simply called &#8220;Win32 Program Disassembler&#8221; authored by one Sang Cho. I took to calling it &#8216;scd&#8217; for Sang Cho&#8217;s Disassembler. <a href=\"http:\/\/hcilab.cju.ac.kr\/\">The original program versions and source code are still available for download<\/a>. I remember being able to compile v0.23 of the source code with gcc under Unix; 0.25 is no go due to extensive reliance on the Win32 development environment.<\/p>\n<p>I recently wanted to use scd again but had some trouble compiling. As was the case the first time I tried compiling the source code a decade ago, it&#8217;s necessary to transform line endings from DOS -&gt; Unix using &#8216;dos2unix&#8217; (I see that this has been renamed to\/replaced by &#8216;fromdos&#8217; on Ubuntu). <\/p>\n<p>Beyond this, it seems that there are some C constructs that used to be valid but are now rejected by gcc. The first looks like this:<\/p>\n<pre>\r\nreturn  (int) c = *(PBYTE)((int)lpFile + vCodeOffset);\r\n<\/pre>\n<p> Ahem, &#8220;error: lvalue required as left operand of assignment&#8221;. Removing the &#8220;(int)&#8221; before the &#8216;c&#8217; makes the problem go away. It&#8217;s a strange way to write a return statement in general. However, &#8216;c&#8217; is a global variable that is apparently part of some YACC\/BISON-type output.<\/p>\n<p>The second issue is when a case-switch block has a default label but with no code inside. Current gcc doesn&#8217;t like that. It&#8217;s necessary to at least provide a break statement after the default label.<\/p>\n<p>Finally, the program turns out to not be 64-bit safe. It is necessary to compile it in 32-bit mode (compile and link with the &#8216;-m32&#8217; flag or build on a 32-bit system). The static 32-bit binary should run fine under a 64-bit kernel.<\/p>\n<p><strong>Alternatively:<\/strong> What are some other Win32 disassemblers that work under Linux?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Old C programs need a little repair after a decade<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2644","post","type-post","status-publish","format-standard","hentry","category-reverse-engineering"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Old C programs need a little repair after a decade\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Multimedia Mike\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Resurrecting SCD | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta property=\"og:description\" content=\"Old C programs need a little repair after a decade\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2010-08-06T06:13:02+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-26T06:55:08+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Resurrecting SCD | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Old C programs need a little repair after a decade\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#article\",\"name\":\"Resurrecting SCD | Breaking Eggs And Making Omelettes\",\"headline\":\"Resurrecting SCD\",\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"},\"datePublished\":\"2010-08-05T23:13:02-07:00\",\"dateModified\":\"2020-07-25T23:55:08-07:00\",\"inLanguage\":\"en-US\",\"commentCount\":7,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#webpage\"},\"articleSection\":\"Reverse Engineering\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/reverse-engineering\\\/#listItem\",\"name\":\"Reverse Engineering\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/reverse-engineering\\\/#listItem\",\"position\":2,\"name\":\"Reverse Engineering\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/reverse-engineering\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#listItem\",\"name\":\"Resurrecting SCD\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#listItem\",\"position\":3,\"name\":\"Resurrecting SCD\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/reverse-engineering\\\/#listItem\",\"name\":\"Reverse Engineering\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/\",\"name\":\"Multimedia Mike\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Multimedia Mike\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#webpage\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/\",\"name\":\"Resurrecting SCD | Breaking Eggs And Making Omelettes\",\"description\":\"Old C programs need a little repair after a decade\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/resurrecting-scd\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"datePublished\":\"2010-08-05T23:13:02-07:00\",\"dateModified\":\"2020-07-25T23:55:08-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Resurrecting SCD | Breaking Eggs And Making Omelettes","description":"Old C programs need a little repair after a decade","canonical_url":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#article","name":"Resurrecting SCD | Breaking Eggs And Making Omelettes","headline":"Resurrecting SCD","author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"},"datePublished":"2010-08-05T23:13:02-07:00","dateModified":"2020-07-25T23:55:08-07:00","inLanguage":"en-US","commentCount":7,"mainEntityOfPage":{"@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#webpage"},"isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#webpage"},"articleSection":"Reverse Engineering"},{"@type":"BreadcrumbList","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","position":1,"name":"Home","item":"https:\/\/multimedia.cx\/eggs","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/#listItem","name":"Reverse Engineering"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/#listItem","position":2,"name":"Reverse Engineering","item":"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#listItem","name":"Resurrecting SCD"},"previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#listItem","position":3,"name":"Resurrecting SCD","previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/#listItem","name":"Reverse Engineering"}}]},{"@type":"Organization","@id":"https:\/\/multimedia.cx\/eggs\/#organization","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","url":"https:\/\/multimedia.cx\/eggs\/"},{"@type":"Person","@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author","url":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/","name":"Multimedia Mike","image":{"@type":"ImageObject","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Multimedia Mike"}},{"@type":"WebPage","@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#webpage","url":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/","name":"Resurrecting SCD | Breaking Eggs And Making Omelettes","description":"Old C programs need a little repair after a decade","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/#website"},"breadcrumb":{"@id":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/#breadcrumblist"},"author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"creator":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"datePublished":"2010-08-05T23:13:02-07:00","dateModified":"2020-07-25T23:55:08-07:00"},{"@type":"WebSite","@id":"https:\/\/multimedia.cx\/eggs\/#website","url":"https:\/\/multimedia.cx\/eggs\/","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","inLanguage":"en-US","publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"}}]},"og:locale":"en_US","og:site_name":"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering","og:type":"article","og:title":"Resurrecting SCD | Breaking Eggs And Making Omelettes","og:description":"Old C programs need a little repair after a decade","og:url":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/","article:published_time":"2010-08-06T06:13:02+00:00","article:modified_time":"2020-07-26T06:55:08+00:00","twitter:card":"summary","twitter:title":"Resurrecting SCD | Breaking Eggs And Making Omelettes","twitter:description":"Old C programs need a little repair after a decade"},"aioseo_meta_data":{"post_id":"2644","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-31 21:55:31","updated":"2025-12-31 19:32:03","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/\" title=\"Reverse Engineering\">Reverse Engineering<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tResurrecting SCD\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/multimedia.cx\/eggs"},{"label":"Reverse Engineering","link":"https:\/\/multimedia.cx\/eggs\/category\/reverse-engineering\/"},{"label":"Resurrecting SCD","link":"https:\/\/multimedia.cx\/eggs\/resurrecting-scd\/"}],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=2644"}],"version-history":[{"count":6,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2644\/revisions"}],"predecessor-version":[{"id":4648,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2644\/revisions\/4648"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=2644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=2644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=2644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}