{"id":1180,"date":"2022-08-30T15:13:43","date_gmt":"2022-08-30T15:13:43","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/convert-large-amount-of-code-to-data-in-ida-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:13:43","modified_gmt":"2022-08-30T15:13:43","slug":"convert-large-amount-of-code-to-data-in-ida-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/convert-large-amount-of-code-to-data-in-ida-collection-of-common-programming-errors\/","title":{"rendered":"Convert large amount of code to data in IDA-Collection of common programming errors"},"content":{"rendered":"<p>Well, Unfortunately I hit &#8216;C&#8217; on a data section of a binary i had worked a lot on and saved it as i had a lot of work unsaved. I tried converting this huge section back to data but whenever i select lines and press &#8216;D&#8217;, only the line where the cursor was gets converted to data.<\/p>\n<p>So, My question is, How do i mark\/convert a large amount of data to code in IDA (specifically 6.1)<\/p>\n<p>(The target architecture is ARM if that matters).<\/p>\n<ol>\n<li>\n<p><code>D<\/code> is to define a single data. You can go to the first instruction and use <code>U<\/code> for <code>Undefine<\/code>. It will remove more code than &#8220;Convert to data&#8221;.<\/p>\n<\/li>\n<li>\n<p>You could do it with a quick IDAPython script, e.g. enter:<\/p>\n<pre><code>for a in xrange(startaddr, endaddr): MakeCode(a)\n<\/code><\/pre>\n<p>into the &#8216;Python&#8217; field of the Output window.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:37:00. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Well, Unfortunately I hit &#8216;C&#8217; on a data section of a binary i had worked a lot on and saved it as i had a lot of work unsaved. I tried converting this huge section back to data but whenever i select lines and press &#8216;D&#8217;, only the line where the cursor was gets converted [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1180","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1180"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1180\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}