Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Something
Friday, June 29th, 2012 at 2:14:00am MDT 

  1. [user@localhost return_42_code]$ cat return_42.asm
  2. section .text
  3.     global _start                       ;must be declared for linker (ld)
  4.  
  5. _start:                                 ;tell linker entry point (program entry point)
  6.  
  7.         mov     di,42   ;exit status
  8.         mov     ax,60   ;system call number (sys_exit)
  9.         syscall
  10.  
  11. ;from http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
  12.  
  13. ;nano return_42.asm && nasm -f elf64 -l return_42.s return_42.asm && nasm -f elf64 -g -o return_42_with_debug return_42.asm && echo -e "\nnasm listfile:\n"  && cat return_42.s && echo -e "\n"  && ld -s -o return_42 return_42.o && echo -e "\nasm ndisasm:\n" && ndisasm -b64 return_42 && objdump -x return_42 && objdump -M intel -d return_42 && echo -e "\n\nreadelf:\n" && readelf -a return_42 && ls -al return_42* && ./return_42 ; echo "$?"

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

fantasy-obligation