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.

zptrace_x86_linux.go 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT.
  2. //go:build linux && (386 || amd64)
  3. package unix
  4. import "unsafe"
  5. // PtraceRegs386 is the registers used by 386 binaries.
  6. type PtraceRegs386 struct {
  7. Ebx int32
  8. Ecx int32
  9. Edx int32
  10. Esi int32
  11. Edi int32
  12. Ebp int32
  13. Eax int32
  14. Xds int32
  15. Xes int32
  16. Xfs int32
  17. Xgs int32
  18. Orig_eax int32
  19. Eip int32
  20. Xcs int32
  21. Eflags int32
  22. Esp int32
  23. Xss int32
  24. }
  25. // PtraceGetRegs386 fetches the registers used by 386 binaries.
  26. func PtraceGetRegs386(pid int, regsout *PtraceRegs386) error {
  27. return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout))
  28. }
  29. // PtraceSetRegs386 sets the registers used by 386 binaries.
  30. func PtraceSetRegs386(pid int, regs *PtraceRegs386) error {
  31. return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs))
  32. }
  33. // PtraceRegsAmd64 is the registers used by amd64 binaries.
  34. type PtraceRegsAmd64 struct {
  35. R15 uint64
  36. R14 uint64
  37. R13 uint64
  38. R12 uint64
  39. Rbp uint64
  40. Rbx uint64
  41. R11 uint64
  42. R10 uint64
  43. R9 uint64
  44. R8 uint64
  45. Rax uint64
  46. Rcx uint64
  47. Rdx uint64
  48. Rsi uint64
  49. Rdi uint64
  50. Orig_rax uint64
  51. Rip uint64
  52. Cs uint64
  53. Eflags uint64
  54. Rsp uint64
  55. Ss uint64
  56. Fs_base uint64
  57. Gs_base uint64
  58. Ds uint64
  59. Es uint64
  60. Fs uint64
  61. Gs uint64
  62. }
  63. // PtraceGetRegsAmd64 fetches the registers used by amd64 binaries.
  64. func PtraceGetRegsAmd64(pid int, regsout *PtraceRegsAmd64) error {
  65. return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout))
  66. }
  67. // PtraceSetRegsAmd64 sets the registers used by amd64 binaries.
  68. func PtraceSetRegsAmd64(pid int, regs *PtraceRegsAmd64) error {
  69. return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs))
  70. }