{"id":2741,"date":"2022-08-30T15:27:23","date_gmt":"2022-08-30T15:27:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/02\/08\/hooking-with-jmp-instruction-and-calling-convention-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:27:23","modified_gmt":"2022-08-30T15:27:23","slug":"hooking-with-jmp-instruction-and-calling-convention-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/hooking-with-jmp-instruction-and-calling-convention-collection-of-common-programming-errors\/","title":{"rendered":"Hooking with JMP instruction and calling convention?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m hooking a 32-bit C++ function by overwriting its first 6 bytes with a <code>JMP<\/code> instruction.<\/p>\n<p>When testing it sometimes (but not always) crashes if the functions don&#8217;t have the <code>__stdcall<\/code> calling convention. No crashes with <code>__stdcall<\/code>, so far.<\/p>\n<p>This made me wonder if the <code>JMP<\/code> trick works only with certain calling conventions, or does it work with all of them?<\/p>\n<p>I&#8217;m using VS2008 on Windows.<\/p>\n<p id=\"rop\"><small>Originally posted 2014-02-08 15:49:18. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m hooking a 32-bit C++ function by overwriting its first 6 bytes with a JMP instruction. When testing it sometimes (but not always) crashes if the functions don&#8217;t have the __stdcall calling convention. No crashes with __stdcall, so far. This made me wonder if the JMP trick works only with certain calling conventions, or does [&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-2741","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2741","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=2741"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2741\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2741"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2741"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2741"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}