goretk / redress

Redress - A tool for analyzing stripped Go binaries

Home Page:https://go-re.tk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

panic: Unsupported architecture (ARM related?)

0xdevalias opened this issue · comments

$ /opt/homebrew/Cellar/redress/1.1.1/bin/redress info /opt/homebrew/Cellar/redress/1.1.1/bin/redress
panic: Unsupported architecture

goroutine 1 [running]:
github.com/goretk/gore.(*machoFile).getFileInfo(0x1400002c4a0)
	github.com/goretk/gore@v0.11.1/macho.go:117 +0xdc
github.com/goretk/gore.Open({0x16f1e6a84, 0x2e})
	github.com/goretk/gore@v0.11.1/file.go:86 +0x348
main.listInfo({0x16f1e6a84?, 0x0?})
	github.com/goretk/redress/info.go:50 +0x90
main.init.1.func1(0x140000e6e00?, {0x1400002c300?, 0x4?, 0x100e4f6df?})
	github.com/goretk/redress/info.go:25 +0x30
github.com/spf13/cobra.(*Command).execute(0x140000c4280, {0x1400002c2e0, 0x1, 0x1})
	github.com/spf13/cobra@v1.2.1/command.go:860 +0x53c
github.com/spf13/cobra.(*Command).ExecuteC(0x1010dd2c0)
	github.com/spf13/cobra@v1.2.1/command.go:974 +0x318
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.2.1/command.go:902
main.main()
	github.com/goretk/redress/main.go:25 +0x24

Potentially related:

Background Context

I believe the below is related to this issue (adding here particularly for context of error messages/etc since this issue didn't show up when I searched originally):


$ /opt/homebrew/Cellar/redress/1.1.1/bin/redress info /opt/homebrew/Cellar/redress/1.1.1/bin/redress
panic: Unsupported architecture

goroutine 1 [running]:
github.com/goretk/gore.(*machoFile).getFileInfo(0x1400002c4a0)
	github.com/goretk/gore@v0.11.1/macho.go:117 +0xdc
github.com/goretk/gore.Open({0x16f1e6a84, 0x2e})
	github.com/goretk/gore@v0.11.1/file.go:86 +0x348
main.listInfo({0x16f1e6a84?, 0x0?})
	github.com/goretk/redress/info.go:50 +0x90
main.init.1.func1(0x140000e6e00?, {0x1400002c300?, 0x4?, 0x100e4f6df?})
	github.com/goretk/redress/info.go:25 +0x30
github.com/spf13/cobra.(*Command).execute(0x140000c4280, {0x1400002c2e0, 0x1, 0x1})
	github.com/spf13/cobra@v1.2.1/command.go:860 +0x53c
github.com/spf13/cobra.(*Command).ExecuteC(0x1010dd2c0)
	github.com/spf13/cobra@v1.2.1/command.go:974 +0x318
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.2.1/command.go:902
main.main()
	github.com/goretk/redress/main.go:25 +0x24

is this only for x86?

Originally posted by @chenrui333 in Homebrew/homebrew-core#155724 (comment)


That seems to be coming from the gore lib that redress depends on:

https://github.com/goretk/gore/blob/78568206ae24043a24fc8bf89443ad6164a7509f/macho.go#L104-L123


What system were you trying to run it on?

Originally posted by @0xdevalias in Homebrew/homebrew-core#155724 (comment)


I am trying on ventura arm, if does not run for arm, then we probably need depends_on arch: :x86_64 as well as some upstream note on it

Originally posted by @chenrui333 in Homebrew/homebrew-core#155724 (comment)

Originally posted by @0xdevalias in goretk/gore#21 (comment)

I suspect this issue may be related:

Though based on that, I believe that the CLI can be compiled and run fine on ARM, it just can't process Golang binaries compiled for ARM currently.

@chenrui333 Are you able to confirm by running your local arm compiled version against one of the presumably non-ARM release versions (or any other non-ARM Golang binary)?

If that works.. then I guess we just need to figure out a better way to implement the test on ARM systems. Any ideas?

Originally posted by @0xdevalias in Homebrew/homebrew-core#155724 (comment)

Please check if it's still an issue with the latest release.

Please check if it's still an issue with the latest release

@TcM1911 From a quick initial test, I don't think so. I'm running the original test that failed currently, so will check if that works.

Looking at the commit changes, I didn't see where/how this would have been fixed though. Are you able to elaborate on where the expected fix came from?

I'm guessing it was probably this one:

  • 058070b
    • Sync with gore develop branch

Along with this?

Analyzing ARM binaries isn't currently fully supported. That patch added arm64 just to prevent crashes... The "basic" functionality should at least work.

Analyzing ARM binaries isn't currently fully supported. That patch added arm64 just to prevent crashes... The "basic" functionality should at least work.

@TcM1911 That makes sense. Thanks for that :)