Skip to content

Commit

Permalink
chore: Update keystoneToBigEndian function to use len(data) instead o…
Browse files Browse the repository at this point in the history
…f getKeystoneInstructionLength
  • Loading branch information
suifei committed May 28, 2024
1 parent 9d8470f commit 1e0b634
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 109 deletions.
85 changes: 42 additions & 43 deletions archs/arch.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package archs

import (
Expand All @@ -9,8 +8,8 @@ import (
"github.com/suifei/asm2hex/bindings/keystone"
)


var WithRiscv = false

type Option struct {
Const uint64
Name string
Expand Down Expand Up @@ -41,17 +40,17 @@ var KeystoneModeOptions = map[uint64]OptionSlice{
uint64(keystone.ARCH_HEXAGON): {{uint64(keystone.MODE_BIG_ENDIAN), "BIG_ENDIAN"}},
}

// var KeystoneSyntaxList = OptionSlice{}
// var KeystoneSyntaxOptions = map[uint64]OptionSlice{
// uint64(keystone.ARCH_ARM): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_ARM64): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_MIPS): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_X86): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}, {uint64(keystone.OPT_SYNTAX_NASM), "NASM"}, {uint64(keystone.OPT_SYNTAX_MASM), "MASM"}, {uint64(keystone.OPT_SYNTAX_GAS), "GAS"}, {uint64(keystone.OPT_SYNTAX_RADIX16), "Radix16"}},
// uint64(keystone.ARCH_PPC): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_SPARC): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_SYSTEMZ): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
// uint64(keystone.ARCH_HEXAGON): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}},
// }
var KeystoneSyntaxList = OptionSlice{}
var KeystoneSyntaxOptions = map[uint64]OptionSlice{
uint64(keystone.ARCH_ARM): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_ARM64): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_MIPS): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_X86): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}, {uint64(keystone.OPT_SYNTAX_NASM), "NASM"}, {uint64(keystone.OPT_SYNTAX_MASM), "MASM"}, {uint64(keystone.OPT_SYNTAX_GAS), "GAS"}, {uint64(keystone.OPT_SYNTAX_RADIX16), "Radix16"}},
uint64(keystone.ARCH_PPC): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_SPARC): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_SYSTEMZ): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(keystone.OPT_SYNTAX_ATT), "ATT"}},
uint64(keystone.ARCH_HEXAGON): {{uint64(keystone.OPT_SYNTAX_INTEL), "Intel"}},
}

var CapstoneArchOptions = OptionSlice{
{uint64(capstone.ARCH_ARM), "ARM"},
Expand Down Expand Up @@ -95,29 +94,29 @@ var CapstoneModeOptions = map[uint64]OptionSlice{
uint64(capstone.ARCH_TRICORE): {{uint64(capstone.MODE_TRICORE_110), "TRICORE_110"}, {uint64(capstone.MODE_TRICORE_120), "TRICORE_120"}, {uint64(capstone.MODE_TRICORE_130), "TRICORE_130"}, {uint64(capstone.MODE_TRICORE_131), "TRICORE_131"}, {uint64(capstone.MODE_TRICORE_160), "TRICORE_160"}, {uint64(capstone.MODE_TRICORE_161), "TRICORE_161"}, {uint64(capstone.MODE_TRICORE_162), "TRICORE_162"}},
}

// var CapstoneSyntaxList = OptionSlice{}
// var CapstoneSyntaxOptions = map[uint64]OptionSlice{
// uint64(capstone.ARCH_ARM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_ARM64): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_MIPS): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_X86): {{uint64(capstone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(capstone.OPT_SYNTAX_ATT), "ATT"}, {uint64(capstone.OPT_SYNTAX_MASM), "MASM"}},
// uint64(capstone.ARCH_PPC): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_SPARC): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_SYSZ): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_XCORE): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_M68K): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
// uint64(capstone.ARCH_TMS320C64X): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
// uint64(capstone.ARCH_M680X): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
// uint64(capstone.ARCH_EVM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// uint64(capstone.ARCH_MOS65XX): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
// uint64(capstone.ARCH_WASM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// uint64(capstone.ARCH_BPF): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// uint64(capstone.ARCH_RISCV): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// uint64(capstone.ARCH_SH): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// uint64(capstone.ARCH_TRICORE): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
// }

func Disassemble(arch capstone.Architecture, mode capstone.Mode, code []byte, offset uint64, bigEndian bool /*syntaxValue capstone.OptionValue, */, addAddress bool) (string, uint64, bool, error) {
var CapstoneSyntaxList = OptionSlice{}
var CapstoneSyntaxOptions = map[uint64]OptionSlice{
uint64(capstone.ARCH_ARM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_ARM64): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_MIPS): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_X86): {{uint64(capstone.OPT_SYNTAX_INTEL), "Intel"}, {uint64(capstone.OPT_SYNTAX_ATT), "ATT"}, {uint64(capstone.OPT_SYNTAX_MASM), "MASM"}},
uint64(capstone.ARCH_PPC): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_SPARC): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_SYSZ): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_XCORE): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_M68K): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
uint64(capstone.ARCH_TMS320C64X): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}},
uint64(capstone.ARCH_M680X): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_NOREGNAME), "NOREGNAME"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
uint64(capstone.ARCH_EVM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
uint64(capstone.ARCH_MOS65XX): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}, {uint64(capstone.OPT_SYNTAX_MOTOROLA), "Motorola"}},
uint64(capstone.ARCH_WASM): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
uint64(capstone.ARCH_BPF): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
uint64(capstone.ARCH_RISCV): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
uint64(capstone.ARCH_SH): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
uint64(capstone.ARCH_TRICORE): {{uint64(capstone.OPT_SYNTAX_DEFAULT), "Default"}},
}

func Disassemble(arch capstone.Architecture, mode capstone.Mode, code []byte, offset uint64, bigEndian bool, syntaxValue int, addAddress bool) (string, uint64, bool, error) {
defer func() {
if r := recover(); r != nil {
return
Expand All @@ -130,9 +129,9 @@ func Disassemble(arch capstone.Architecture, mode capstone.Mode, code []byte, of
}
defer engine.Close()

// if syntaxValue != 0 {
// engine.Option(capstone.OPT_SYNTAX, capstone.OptionValue(syntaxValue))
// }
if syntaxValue >= 0 {
engine.Option(capstone.OPT_SYNTAX, capstone.OptionValue(syntaxValue))
}

if bigEndian {
code, err = capstoneToBigEndian(code, arch, mode)
Expand All @@ -157,7 +156,7 @@ func Disassemble(arch capstone.Architecture, mode capstone.Mode, code []byte, of

return result, uint64(len(insns)), true, nil
}
func Assemble(arch keystone.Architecture, mode keystone.Mode, code string, offset uint64, bigEndian bool /*, syntaxValue keystone.OptionValue*/) ([]byte, uint64, bool, error) {
func Assemble(arch keystone.Architecture, mode keystone.Mode, code string, offset uint64, bigEndian bool, syntaxValue int) ([]byte, uint64, bool, error) {
defer func() {
if r := recover(); r != nil {
return
Expand All @@ -181,9 +180,9 @@ func Assemble(arch keystone.Architecture, mode keystone.Mode, code string, offse
}
defer ks.Close()

// if syntaxValue != 0 {
// ks.Option(keystone.OPT_SYNTAX, keystone.OptionValue(syntaxValue))
// }
if syntaxValue >= 0 {
ks.Option(keystone.OPT_SYNTAX, keystone.OptionValue(syntaxValue))
}

encoding, stat_count, ok := ks.Assemble(code, offset)
if err := ks.LastError(); err != nil {
Expand Down
3 changes: 1 addition & 2 deletions archs/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package archs

import (
Expand Down Expand Up @@ -43,7 +42,7 @@ func keystoneToBigEndian(data []byte, arch keystone.Architecture, mode keystone.
return nil, fmt.Errorf("input data is empty")
}

instructionLength := getKeystoneInstructionLength(arch, mode)
instructionLength := len(data) //getKeystoneInstructionLength(arch, mode)
if instructionLength == 0 {
return nil, fmt.Errorf("unsupported architecture or mode")
}
Expand Down
6 changes: 3 additions & 3 deletions bindings/capstone/capstone.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
type Architecture uint
type Mode uint
type OptionType uint
type OptionValue uint
type OptionValue C.size_t
type OperandType uint
type AccessType uint
type GroupType uint
Expand Down Expand Up @@ -177,8 +177,8 @@ func New(arch Architecture, mode Mode) (*Engine, error) {
return &Engine{handle}, nil
}

func (e *Engine) Option(opt_type OptionType, value C.size_t) error {
if cserr := C.cs_option(e.handle, C.cs_opt_type(opt_type), value); cserr != C.CS_ERR_OK {
func (e *Engine) Option(opt_type OptionType, value OptionValue) error {
if cserr := C.cs_option(e.handle, C.cs_opt_type(opt_type), C.size_t(value)); cserr != C.CS_ERR_OK {
return CsError(cserr)
}
return nil
Expand Down
121 changes: 60 additions & 61 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,36 @@ var prefix_hex bool = false
var offset uint64 = 0
var bigEndian bool = false
var addAddress bool = false

type Param struct {
Arch uint64
Mode uint64
// Syntax uint64
Info string
Arch uint64
Mode uint64
Syntax int
Info string
}

var KSSelectParam = &Param{
Arch: 0,
Mode: 0,
// Syntax: 0,
Info: "",
Arch: 0,
Mode: 0,
Syntax: -1,
Info: "",
}
var CSSelectParam = &Param{
Arch: 0,
Mode: 0,
// Syntax: 0,
Info: "",
Arch: 0,
Mode: 0,
Syntax: -1,
Info: "",
}

var status *widget.Label
var convertBtn *widget.Button
var toggleBtn *widget.Button
var keystoneArchDropdown,
keystoneModeDropdown,
// keystoneSyntaxDropdown,
keystoneSyntaxDropdown,
capstoneArchDropdown,
capstoneModeDropdown *widget.Select

// capstoneSyntaxDropdown,
capstoneModeDropdown,
capstoneSyntaxDropdown *widget.Select

var asm2hexTools *fyne.Container
var hex2asmTools *fyne.Container
Expand Down Expand Up @@ -115,20 +115,20 @@ func updateSelectParam() {
CSSelectParam.Info += " " + capstoneModeDropdown.Selected
}
}
// if keystoneSyntaxDropdown != nil && archs.KeystoneSyntaxList != nil {
// index := keystoneSyntaxDropdown.SelectedIndex()
// if index >= 0 && index < len(archs.KeystoneSyntaxList) {
// KSSelectParam.Syntax = archs.KeystoneSyntaxList[index].Const
// KSSelectParam.Info += " " + keystoneSyntaxDropdown.Selected
// }
// }
// if capstoneSyntaxDropdown != nil && archs.CapstoneSyntaxList != nil {
// index := capstoneSyntaxDropdown.SelectedIndex()
// if index >= 0 && index < len(archs.CapstoneSyntaxList) {
// CSSelectParam.Syntax = archs.CapstoneSyntaxList[index].Const
// CSSelectParam.Info += " " + capstoneSyntaxDropdown.Selected
// }
// }
if keystoneSyntaxDropdown != nil && archs.KeystoneSyntaxList != nil {
index := keystoneSyntaxDropdown.SelectedIndex()
if index >= 0 && index < len(archs.KeystoneSyntaxList) {
KSSelectParam.Syntax = int(archs.KeystoneSyntaxList[index].Const)
KSSelectParam.Info += " " + keystoneSyntaxDropdown.Selected
}
}
if capstoneSyntaxDropdown != nil && archs.CapstoneSyntaxList != nil {
index := capstoneSyntaxDropdown.SelectedIndex()
if index >= 0 && index < len(archs.CapstoneSyntaxList) {
CSSelectParam.Syntax = int(archs.CapstoneSyntaxList[index].Const)
CSSelectParam.Info += " " + capstoneSyntaxDropdown.Selected
}
}

// fmt.Println("Keystone", toJson(KSSelectParam))
// fmt.Println("Capstone", toJson(CSSelectParam))
Expand Down Expand Up @@ -159,11 +159,11 @@ func createDropdowns() *fyne.Container {
keystoneModeDropdown.SetOptions(getOptionNames(options))
keystoneModeDropdown.SetSelectedIndex(0)
}
// if options, ok := KeystoneSyntaxOptions[mapKey]; ok && keystoneSyntaxDropdown != nil {
// KeystoneSyntaxList = options
// keystoneSyntaxDropdown.SetOptions(getOptionNames(options))
// keystoneSyntaxDropdown.SetSelectedIndex(0)
// }
if options, ok := archs.KeystoneSyntaxOptions[mapKey]; ok && keystoneSyntaxDropdown != nil {
archs.KeystoneSyntaxList = options
keystoneSyntaxDropdown.SetOptions(getOptionNames(options))
keystoneSyntaxDropdown.SetSelectedIndex(0)
}
updateSelectParam()
}

Expand All @@ -174,12 +174,12 @@ func createDropdowns() *fyne.Container {
updateSelectParam()
}

// keystoneSyntaxDropdown = &widget.Select{}
// keystoneSyntaxDropdown.ExtendBaseWidget(keystoneSyntaxDropdown)
// keystoneSyntaxDropdown.OnChanged = func(s string) {
// fmt.Println("Keystone Syntax:", s)
// updateSelectParam()
// }
keystoneSyntaxDropdown = &widget.Select{}
keystoneSyntaxDropdown.ExtendBaseWidget(keystoneSyntaxDropdown)
keystoneSyntaxDropdown.OnChanged = func(s string) {
fmt.Println("Keystone Syntax:", s)
updateSelectParam()
}

capstoneArchDropdown = &widget.Select{}
capstoneArchDropdown.ExtendBaseWidget(capstoneArchDropdown)
Expand All @@ -193,11 +193,11 @@ func createDropdowns() *fyne.Container {
capstoneModeDropdown.SetOptions(getOptionNames(options))
capstoneModeDropdown.SetSelectedIndex(0)
}
// if options, ok := CapstoneSyntaxOptions[mapKey]; ok && capstoneSyntaxDropdown != nil {
// CapstoneSyntaxList = options
// capstoneSyntaxDropdown.SetOptions(getOptionNames(options))
// capstoneSyntaxDropdown.SetSelectedIndex(0)
// }
if options, ok := archs.CapstoneSyntaxOptions[mapKey]; ok && capstoneSyntaxDropdown != nil {
archs.CapstoneSyntaxList = options
capstoneSyntaxDropdown.SetOptions(getOptionNames(options))
capstoneSyntaxDropdown.SetSelectedIndex(0)
}
updateSelectParam()
}
capstoneModeDropdown = &widget.Select{}
Expand All @@ -207,25 +207,25 @@ func createDropdowns() *fyne.Container {
updateSelectParam()
}

// capstoneSyntaxDropdown = &widget.Select{}
// capstoneSyntaxDropdown.ExtendBaseWidget(capstoneSyntaxDropdown)
// capstoneSyntaxDropdown.OnChanged = func(s string) {
// fmt.Println("Capstone Syntax:", s)
// updateSelectParam()
// }
capstoneSyntaxDropdown = &widget.Select{}
capstoneSyntaxDropdown.ExtendBaseWidget(capstoneSyntaxDropdown)
capstoneSyntaxDropdown.OnChanged = func(s string) {
fmt.Println("Capstone Syntax:", s)
updateSelectParam()
}

keystoneArchDropdown.SetSelectedIndex(1)
capstoneArchDropdown.SetSelectedIndex(1)
asm2hexTools = container.NewHBox(
keystoneArchDropdown,
keystoneModeDropdown,
// keystoneSyntaxDropdown,
keystoneSyntaxDropdown,
)
hex2asmTools =
container.NewHBox(
capstoneArchDropdown,
capstoneModeDropdown,
// capstoneSyntaxDropdown,
capstoneSyntaxDropdown,
)
asm2hexTools.Show()
hex2asmTools.Hidden = true
Expand Down Expand Up @@ -396,15 +396,15 @@ cbnz r0, #0x682c4
uri, _ := url.Parse("https://github.com/suifei")
fyne.CurrentApp().OpenURL(uri)
})
openFyne := widget.NewButtonWithIcon(fmt.Sprintf("Fyne %s","v2.4.5"), theme.FyneLogo(), func() {
openFyne := widget.NewButtonWithIcon(fmt.Sprintf("Fyne %s", "v2.4.5"), theme.FyneLogo(), func() {
uri, _ := url.Parse("https://fyne.io/")
fyne.CurrentApp().OpenURL(uri)
})
openCapstone := widget.NewButtonWithIcon(fmt.Sprintf("Capstone v%d.%d",capstone.API_MAJOR, capstone.API_MINOR), icons.CAPSTONE_PNG_RES, func() {
})
openCapstone := widget.NewButtonWithIcon(fmt.Sprintf("Capstone v%d.%d", capstone.API_MAJOR, capstone.API_MINOR), icons.CAPSTONE_PNG_RES, func() {
uri, _ := url.Parse("https://www.capstone-engine.org/")
fyne.CurrentApp().OpenURL(uri)
})
openKeystone := widget.NewButtonWithIcon(fmt.Sprintf("Keystone v%d.%d",keystone.API_MAJOR, keystone.API_MINOR), icons.KEYSTONE_PNG_RES, func() {
openKeystone := widget.NewButtonWithIcon(fmt.Sprintf("Keystone v%d.%d", keystone.API_MAJOR, keystone.API_MINOR), icons.KEYSTONE_PNG_RES, func() {
uri, _ := url.Parse("https://www.keystone-engine.org/")
fyne.CurrentApp().OpenURL(uri)
})
Expand Down Expand Up @@ -591,8 +591,7 @@ func doConversion(status *widget.Label,
v,
offset,
bigEndian,
)
// keystone.OptionValue(KSSelectParam.Syntax))
int(KSSelectParam.Syntax))
if !ok {
var errMsg = "Unknown error"
if err != nil {
Expand Down Expand Up @@ -625,7 +624,7 @@ func doConversion(status *widget.Label,
encoding,
offset,
bigEndian,
// capstone.OptionValue(CSSelectParam.Syntax),
int(CSSelectParam.Syntax),
addAddress,
)
if !ok {
Expand Down

0 comments on commit 1e0b634

Please sign in to comment.