{"id":55,"date":"2008-03-05T07:52:42","date_gmt":"2008-03-05T09:52:42","guid":{"rendered":"http:\/\/www.ragestorm.net\/blogs\/?p=55"},"modified":"2008-03-05T10:20:52","modified_gmt":"2008-03-05T12:20:52","slug":"fooling-around-with-lea","status":"publish","type":"post","link":"https:\/\/www.ragestorm.net\/blogs\/?p=55","title":{"rendered":"Fooling Around With LEA"},"content":{"rendered":"<p>Yesterday it hit me. I just realized something so funny that I had to post it right here. I have been using LEA for years now and so have you I guess. Most of the times LEA is used to load an offset of a local variable in a function, for example:<\/p>\n<p>void f()<br \/>\n{<br \/>\nint x;<br \/>\ng(&amp;x);<br \/>\n}<\/p>\n<p>The parameter &amp;x for calling g will use LEA to load the address of x and pass it to g so g can change it inside. But this is nothing new.<\/p>\n<p>You can write something like this:<br \/>\nLEA EAX, [0x12345678]<br \/>\nAnd you know what?<br \/>\nEAX will be now 0x12345678<br \/>\nThis is somewhat trivial when you get to think about it, but when do you??<br \/>\nI wonder how good it is as anti-disassemblers stuff, I think it will get the disassembler a bit crazy, it worth a test&#8230; because now instead of loading immediates with MOV, you can use LEA&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday it hit me. I just realized something so funny that I had to post it right here. I have been using LEA for years now and so have you I guess. Most of the times LEA is used to load an offset of a local variable in a function, for example: void f() { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[5],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pbWKd-T","_links":{"self":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/55"}],"collection":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=55"}],"version-history":[{"count":0,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/55\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=55"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=55"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=55"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}