Is there a way to avoid 00's in these assembly lea instructions?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The instructions are what the instructions are. Yes, they contain zeros, but if you really want to be a L33T H4X0R you will know how to disguise them by compression or run-length encoding.
But you will also find that, in most operating systems today, you cannot execute instructions out of the data segment, and you cannot modify the code segment.
In this case, the construct ds:0x0 will require no relocation: the correct final-value is, "zero."
But, yes, that is how a linker works. The compiler specifies the locations where address-values will need to be plugged in, and the name of the symbol whose value must be put there. The compiler does not know what address-value the symbol will eventually have, and the linker must be told by the compiler where to insert them.
Last edited by sundialsvcs; 10-01-2015 at 10:56 AM.
In this case, the construct ds:0x0 will require no relocation: the correct final-value is, "zero."
I think the OP disassembled the object file, and the placeholder zero was interpreted by the disassembler as ds:0x0. It doesn't make sense that both (or even just one of) [userpass] and [passcode] would become zero in the final executable.
Last edited by ntubski; 10-01-2015 at 11:33 AM.
Reason: add "(or even just one of)"
Indeed. I had failed to pick-up on that. Yes, what will usually be found in an object-file is either a zero, or the "offset," to which the symbol-address (once determined by the linker) is customarily added.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.