github.com/agiledragon/gomonkey/v2@v2.11.1-0.20240427155748-d56c6823ec17/jmp_386.go (about)

     1  package gomonkey
     2  
     3  func buildJmpDirective(double uintptr) []byte {
     4  	d0 := byte(double)
     5  	d1 := byte(double >> 8)
     6  	d2 := byte(double >> 16)
     7  	d3 := byte(double >> 24)
     8  
     9  	return []byte{
    10  		0xBA, d0, d1, d2, d3, // MOV edx, double
    11  		0xFF, 0x22, // JMP [edx]
    12  	}
    13  }