Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3482116
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:31:19+00:00 2026-05-18T10:31:19+00:00

Is there anyway this can be done? I’ve used objdump but that doesn’t produce

  • 0

Is there anyway this can be done? I’ve used objdump but that doesn’t produce assembly output that will be accepted by any assembler that I know of. I’d like to be able to change instructions within an executable and then test it afterwards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:31:20+00:00Added an answer on May 18, 2026 at 10:31 am

    I don’t think there is any reliable way to do this. Machine code formats are very complicated, more complicated than assembly files. It isn’t really possible to take a compiled binary (say, in ELF format) and produce a source assembly program which will compile to the same (or similar-enough) binary. To gain an understanding of the differences, compare the output of GCC compiling direct to assembler (gcc -S) versus the output of objdump on the executable (objdump -D).

    There are two major complications I can think of. Firstly, the machine code itself is not a 1-to-1 correspondence with assembly code, because of things like pointer offsets.

    For example, consider the C code to Hello world:

    int main()
    {
        printf("Hello, world!\n");
        return 0;
    }
    

    This compiles to the x86 assembly code:

    .LC0:
        .string "hello"
        .text
    <snip>
        movl    $.LC0, %eax
        movl    %eax, (%esp)
        call    printf
    

    Where .LCO is a named constant, and printf is a symbol in a shared library symbol table. Compare to the output of objdump:

    80483cd:       b8 b0 84 04 08          mov    $0x80484b0,%eax
    80483d2:       89 04 24                mov    %eax,(%esp)
    80483d5:       e8 1a ff ff ff          call   80482f4 <printf@plt>
    

    Firstly, the constant .LC0 is now just some random offset in memory somewhere — it would be difficult to create an assembly source file which contains this constant in the correct place, since the assembler and linker are free to choose locations for these constants.

    Secondly, I’m not entirely sure about this (and it depends on things like position independent code), but I believe the reference to printf is not actually encoded at the pointer address in that code there at all, but the ELF headers contain a lookup table which dynamically replaces its address at runtime. Therefore, the disassembled code doesn’t quite correspond to the source assembly code.

    In summary, source assembly has symbols while compiled machine code has addresses which are difficult to reverse.

    The second major complication is that an assembly source file can’t contain all of the information that was present in the original ELF file headers, like which libraries to dynamically link against, and other metadata placed there by the original compiler. It would be difficult to reconstruct this.

    Like I said, it’s possible that a special tool can manipulate all of this information, but it is unlikely that one can simply produce assembly code which can be reassembled back to the executable.

    If you are interested in modifying just a small section of the executable, I recommend a much more subtle approach than recompiling the whole application. Use objdump to get the assembly code for the function(s) you are interested in. Convert it to “source assembly syntax” by hand (and here, I wish there was a tool that actually produced disassembly in the same syntax as the input), and modify it as you wish. When you are done, recompile just those function(s) and use objdump to figure out the machine code for your modified program. Then, use a hex editor to manually paste the new machine code over the top of the corresponding part of the original program, taking care that your new code is precisely the same number of bytes as the old code (or all the offsets would be wrong). If the new code is shorter, you can pad it out using NOP instructions. If it is longer, you may be in trouble, and might have to create new functions and call them instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there anyway that I can convert this to use RSA encryption? im kinda
I don't think this can be done cleanly, but I'll ask anyway. I have
Is there anyway this code can be refactored? The only difference is the order
Is there anyway I can modify this code example #include <stdlib.h> #include <iostream> class
There is some problem, i can't understand anyway. look at this code please <script
Is there any way to refactor this code so that it can omit unnecessary
is there any way I can reproduce this ruby function: def Password.hash(password,salt) Digest::SHA512.hexdigest(#{password}:#{salt}) end
Is there any way I can add this to my plugin? $this->_helper->viewRenderer->setNoRender();
I've recently come across this website. Now, is there any way I can actually
Is there anyway for this PHP script to know what are the scripts or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.