{"id":5389,"date":"2014-03-30T21:23:25","date_gmt":"2014-03-30T21:23:25","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/can-gdb-change-the-assembly-code-of-a-running-program-collection-of-common-programming-errors\/"},"modified":"2014-03-30T21:23:25","modified_gmt":"2014-03-30T21:23:25","slug":"can-gdb-change-the-assembly-code-of-a-running-program-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/can-gdb-change-the-assembly-code-of-a-running-program-collection-of-common-programming-errors\/","title":{"rendered":"Can GDB change the assembly code of a running program?-Collection of common programming errors"},"content":{"rendered":"<p>I want to add some extra funcionality to \/bin\/ls.<br \/>\nSo I started it on gdb and added a breakpoint at the beginning.<\/p>\n<p>Now question is: how can I change the code of a running program in memory? I can see the assembly code, but I&#8217;m not able to modify. How can I do it?<\/p>\n<p>On Windows I can easily do this with olldbg for example. How about on Linux?<\/p>\n<p>(I know that doing this I will only change the code of the process in memory. So then I can dump memory to a file, and then I&#8217;ll have my changes saved in a binary file).<\/p>\n<p>Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I want to add some extra funcionality to \/bin\/ls. So I started it on gdb and added a breakpoint at the beginning. Now question is: how can I change the code of a running program in memory? I can see the assembly code, but I&#8217;m not able to modify. How can I do it? On [&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-5389","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5389","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=5389"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5389\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}