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

  • Home
  • SEARCH
  • 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 8002857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:29:42+00:00 2026-06-04T16:29:42+00:00

I disassembled the code resulting from compiling the very simple source file test.c, which

  • 0

I disassembled the code resulting from compiling the very simple source file test.c, which looked like this:

void main() {}

I ran these commands to link the main function into a static executable (editor’s note: with no CRT start code so it would just crash), then extract to a flat binary with a couple sections removed, so I could feed that to ndisasm (editor’s note: which doesn’t understand ELF metadata like objdump -drwC -Mintel does)

 gcc -c test.c 
 ld -o test -Ttext 0x0 -e main test.o 
 objcopy -R .note -R .comment -S -O binary test test.bin
 ndisasm -b 32 test.bin

And this is what I got:

00000000  55                push ebp
00000001  89E5              mov ebp,esp
00000003  5D                pop ebp
00000004  C3                ret
00000005  0000              add [eax],al
00000007  001400            add [eax+eax],dl
0000000A  0000              add [eax],al
0000000C  0000              add [eax],al
0000000E  0000              add [eax],al
00000010  017A52            add [edx+0x52],edi
00000013  0001              add [ecx],al
00000015  7C08              jl 0x1f
00000017  011B              add [ebx],ebx
00000019  0C04              or al,0x4
0000001B  0488              add al,0x88
0000001D  0100              add [eax],eax
0000001F  001C00            add [eax+eax],bl
00000022  0000              add [eax],al
00000024  1C00              sbb al,0x0
00000026  0000              add [eax],al
00000028  D8FF              fdivr st7
0000002A  FF                db 0xff
0000002B  FF05    00000000      inc dword [dword 0x0]
00000031  41                inc ecx
00000032  0E                push cs
00000033  088502420D05      or [ebp+0x50d4202],al
00000039  41                inc ecx
0000003A  0C04              or al,0x4
0000003C  04C5              add al,0xc5
0000003E  0000              add [eax],al

What is the purpose of everything past the first four lines? Why is it adding to the memory locations pointed to by eax, 2*eax, edx+0x52, comparing, and so on? Is it all about checking that the program executed correctly or something else?

  • 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-06-04T16:29:43+00:00Added an answer on June 4, 2026 at 4:29 pm

    I believe you have disassembled bits that are not code, which is why it doesn’t make a lot of sense.

    To get an idea of what the file might contain, I would recommend running objdump on the full binary (ELF), to see if you can recognize the above byte sequences in any of the sections.

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

Sidebar

Related Questions

I disassembled the .NET 'System' DLL and looked at the source code for the
I disassembled certain binary file(Linux elf). And I found this code : movsl %ds:(%esi),%es:(%edi)
I am reading from a thread local variable in my code like this, //
I noticed this interesting use of the this keyword while viewing the disassembled code
I am looking at some disassembled code obtained from Java bytecode. I see some
When I disassembled my C code, I saw the following. What does this code
so I'm using this program http://code.google.com/p/ecartcommerce/source/browse/library/Ecart/Db/Table/Select/Disassemble.php?edit=1 to generate a string that corresponds to the
First, here is the C# code and the disassembled IL: public class Program<T> {
I want see the source code of System.Web.Routing.RouteValueDictionary class. But Reflector can't disassemble it
I suppose that this is an interesting code example. We have a class --

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.