github.com/gbl08ma/monkey@v1.1.0/monkey_386.go (about)

     1  package monkey
     2  
     3  // Assembles a jump to a function value
     4  func jmpToFunctionValue(to uintptr) []byte {
     5  	return []byte{
     6  		0xBA,
     7  		byte(to),
     8  		byte(to >> 8),
     9  		byte(to >> 16),
    10  		byte(to >> 24), // mov edx,to
    11  		0xFF, 0x22,     // jmp DWORD PTR [edx]
    12  	}
    13  }