This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| // a branch of keystone golang bindings which builds on linux | |
| "github.com/stevenjohnstone/keystone/bindings/go/keystone" | |
| uc "github.com/unicorn-engine/unicorn/bindings/go/unicorn" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (set-logic QF_BV) | |
| ; Convention here is add a label to the end of the register | |
| ; to mark a step in the program for which the value applies. | |
| ; e.g. | |
| ; rdx0 is the first value of rdx, rdx1 is the value at the | |
| ; next step of the program, rdxN is the value at the Nth | |
| ; step. | |
| ; | |
| ; Essentially, we're turning an assembly program into SSA form |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| static int x3(int a, int b) { | |
| int out; | |
| asm( | |
| // it's not stated in xchg rax,rax but it's | |
| // intel syntax. Note the noprefix means we | |
| // don't need % before registers | |
| ".intel_syntax noprefix;" |
NewerOlder