Skip to content

Commit

Permalink
Merge pull request EgeBalci#2 from nugxperience/fix-architecture-state
Browse files Browse the repository at this point in the history
Pass Encoder object by pointer to SetArchitecture()
  • Loading branch information
EgeBalci authored May 30, 2020
2 parents e17111b + 89c6abd commit 3238dcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewEncoder() Encoder {
}

// SetArchitecture sets the encoder architecture
func (encoder Encoder) SetArchitecture(arch int) error {
func (encoder *Encoder) SetArchitecture(arch int) error {
switch arch {
case 32:
encoder.architecture = 32
Expand Down
4 changes: 2 additions & 2 deletions lib/instructions.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ var GarbageMnemonics = []string{
"ADD {R},{K};{G};SUB {R},{K}",
"SUB {R},{K};{G};ADD {R},{K}",
"ROR {R},{K};{G};ROL {R},{K}",
"ROL {R},{K};{G};ROR {R},{K}",
"PUSH EBP;MOV EBP,ESP;{G};MOV ESP,EBP;POP EBP"} // function prologue/apilogue
"ROL {R},{K};{G};ROR {R},{K}"}
//"PUSH EBP;MOV EBP,ESP;{G};MOV ESP,EBP;POP EBP"} // function prologue/apilogue, doesn't compile if arch == 64

// JMP 2 -> Jumps to next instruction

Expand Down

0 comments on commit 3238dcf

Please sign in to comment.