Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to fix it? #20

Open
b1gcat opened this issue Nov 1, 2021 · 4 comments
Open

how to fix it? #20

b1gcat opened this issue Nov 1, 2021 · 4 comments

Comments

@b1gcat
Copy link

b1gcat commented Nov 1, 2021

IDA 7.5

File "Z:/tools/reverse/ida/IDAGolangHelper\GO_Utils\Utils.py", line 30, in relaxName
    name = name.replace('.', '_').replace("<-", '_chan_left_').replace('*', '_ptr_').replace('-', '_').replace(';','').replace('"', '').replace('\\', '')
TypeError: a bytes-like object is required, not 'str's
@BL0odz
Copy link

BL0odz commented Nov 22, 2021

Modify it to "name = name.decode().replace('.','_')...."

@Twi1ight-source
Copy link

Modify it to "name = name.decode().replace('.','_')...."

It still have error:
name = name.decode().replace('(', '').replace(')', '').replace('/', '').replace(' ', '').replace(',', 'comma').replace('{','').replace('}', '').replace('[', '').replace(']', '')
AttributeError: 'str' object has no attribute 'decode'

@BL0odz
Copy link

BL0odz commented Nov 27, 2021

The situation seems to be different between different versions. Is the sample you analyzed compiled with go1.16? After some testing, I found that in __init__.py renameFunctions, there is a variable self.is116 that will decide whether to use Gopclntab.rename16 or Gopclntab.rename when renaming the function. go1.16 should be rename16. But self.is116 is False by default, and will be assigned to True only in the tryFindGoVersion function. So before clicking Rename Functions, you should first click Try to detemine go version based on moduledata.

There may be a problem with Parse types by moduledata, but that should be another issue.

@GUANCAIBAN
Copy link

good job,man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants