Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disassemble option to elf command #549

Closed
wants to merge 2 commits into from
Closed

Conversation

vinc
Copy link
Owner

@vinc vinc commented Nov 21, 2023

@vinc
Copy link
Owner Author

vinc commented Nov 21, 2023

Here is the output of the command:

> elf -d /bin/clear
ELF entry address: 0x201190

.text (addr: 0x201190, size: 74, align: 16)
0000000000201190: 50                             push rax
0000000000201191: 48 8D 35 C0 EF FF FF           lea rsi,[rel 0x200158]
0000000000201198: BF 01 00 00 00                 mov edi,1
000000000020119D: BA 0A 00 00 00                 mov edx,0xA
00000000002011A2: E8 19 00 00 00                 call 0x00000000002011C0
00000000002011A7: 31 FF                          xor edi,edi
00000000002011A9: 58                             pop rax
00000000002011AA: E9 01 00 00 00                 jmp 0x00000000002011B0
00000000002011AF: CC                             int3
00000000002011B0: 50                             push rax
00000000002011B1: 40 0F B6 FF                    movzx edi,dil
00000000002011B5: B8 01 00 00 00                 mov eax,1
00000000002011BA: CD 80                          int 0x80
00000000002011BC: 58                             pop rax
00000000002011BD: C3                             ret
00000000002011BE: CC                             int3
00000000002011BF: CC                             int3
00000000002011C0: 50                             push rax
00000000002011C1: B8 04 00 00 00                 mov eax,4
00000000002011C6: CD 80                          int 0x80
00000000002011C8: 48 89 C1                       mov rcx,rax
00000000002011CB: 48 F7 D1                       not rcx
00000000002011CE: 48 C1 E9 3F                    shr rcx,0x3F
00000000002011D2: 48 89 C2                       mov rdx,rax
00000000002011D5: 48 89 C8                       mov rax,rcx
00000000002011D8: 59                             pop rcx
00000000002011D9: C3                             ret

@vinc
Copy link
Owner Author

vinc commented Nov 21, 2023

Screenshot showing the colors:
disassemble

@vinc
Copy link
Owner Author

vinc commented Nov 21, 2023

Unfortunately the kernel is now too big to fit in the filesystem below 2MB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant