A shell that runs x86_64 assembly
c
x86-64
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

asmsh.s 976B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. .file "asmsh.c"
  2. .text
  3. .section .rodata
  4. .LC0:
  5. .string "Unable to fork :"
  6. .text
  7. .globl main
  8. .type main, @function
  9. main:
  10. .LFB6:
  11. .cfi_startproc
  12. pushq %rbp
  13. .cfi_def_cfa_offset 16
  14. .cfi_offset 6, -16
  15. movq %rsp, %rbp
  16. .cfi_def_cfa_register 6
  17. subq $32, %rsp
  18. movl %edi, -20(%rbp)
  19. movq %rsi, -32(%rbp)
  20. call fork@PLT
  21. movl %eax, -4(%rbp)
  22. cmpl $0, -4(%rbp)
  23. jns .L2
  24. leaq .LC0(%rip), %rdi
  25. call perror@PLT
  26. movl $1, %eax
  27. jmp .L3
  28. .L2:
  29. cmpl $0, -4(%rbp)
  30. jne .L4
  31. movl $0, %eax
  32. call child_process
  33. .L4:
  34. movl $0, %eax
  35. .L3:
  36. leave
  37. .cfi_def_cfa 7, 8
  38. ret
  39. .cfi_endproc
  40. .LFE6:
  41. .size main, .-main
  42. .globl child_process
  43. .type child_process, @function
  44. child_process:
  45. .LFB7:
  46. .cfi_startproc
  47. pushq %rbp
  48. .cfi_def_cfa_offset 16
  49. .cfi_offset 6, -16
  50. movq %rsp, %rbp
  51. .cfi_def_cfa_register 6
  52. nop
  53. popq %rbp
  54. .cfi_def_cfa 7, 8
  55. ret
  56. .cfi_endproc
  57. .LFE7:
  58. .size child_process, .-child_process
  59. .ident "GCC: (Debian 10.2.1-6) 10.2.1 20210110"
  60. .section .note.GNU-stack,"",@progbits