usb-ks

USB Killswitch
git clone git://git.laack.co/usb-ks.git
Log | Files | Refs | README | LICENSE

zptrace_x86_linux.go (1909B)


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