Skip to content

Commit 566f435

Browse files
committed
Preparing for release
1 parent 16dd7fc commit 566f435

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) <year> <copyright holders>
1+
Copyright (c) <2023> <Jacopo Ferrigno>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# GoLang pclntab parser
22
Author: **Jacopo Ferrigno**
33

4-
_BinaryNinja plugin to parse gopclntab and restore functions names for all GoLang versions._
4+
_BinaryNinja plugin to parse GoLang binaries and restore some information, like function names._
55

66
## Description:
77

8-
This plugin will parse the gopclntab and restore the function names extracting the information from the `.gopclntab` section in the binary. If there is no section named .gopclntab it will try to search for the section.
9-
10-
It will also try to recover type information and restore them
8+
This plugin will parse a go binary and restore some information like:
9+
- Function names by parsing the `.gopclntab` section in the binary. If there is no section named .gopclntab it will try to search for it.
10+
- Recover type information by parsing specific callsbuthe gopclntab and restore the function names extracting the information from the `.gopclntab` section in the binary.
1111

1212
The plugin works for all GoLang version from 12 to 119.
1313

@@ -22,7 +22,6 @@ The plugin is based on the following resources.
2222
https://github.com/golang/go/blob/fad4a16fd43f6a72b6917eff656be27522809074/src/reflect/type.go#L317
2323

2424

25-
2625
## License
2726

2827
This plugin is released under an [MIT license](./license).

golang_parser.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def santize_gofunc_name(name):
2525

2626
def sanitize_gotype_name(name):
2727
name = santize_gofunc_name(name)
28-
name = name.replace('*', '')
2928
return name
3029

3130

@@ -320,6 +319,9 @@ def create_types(self):
320319
self.bv.add_user_data_ref(
321320
gotype.address_off('nameOff'),
322321
gotype.resolved_name_addr)
322+
323+
name_datavar = self.bv.get_data_var_at(gotype.resolved_name_addr)
324+
name_datavar.name = f"{go_data_type.name}_name"
323325
created += 1
324326

325327
log_info(f"Created {created} types")

plugin.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"pluginmetadataversion": 2,
3-
"name": "GoLang pclntab parser",
3+
"name": "GoLang binary parser",
44
"author": "Jacopo Ferrigno",
55
"type": [
66
"ui"
77
],
88
"api": [
99
"python3"
1010
],
11-
"description": "BinaryNinja plugin to parse gopclntab and restore functions names for all GoLang versions.",
12-
"longdescription": "This plugin will parse the gopclntab and restore the function names extracting the information from the `.gopclntab` section in the binary. If there is no section named .gopclntab it will try to search for the section.",
11+
"description": "BinaryNinja plugin to parse GoLang binaries and restore some information, like function names and type information",
12+
"longdescription": "This plugin will parse a go binary and restore information like the functions names, by parsing the .gopclntab, and extract typing information from the executable itself.",
1313
"license": {
1414
"name": "MIT",
1515
"text": "Copyright 2023 Jacopo Ferrigno\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
@@ -24,6 +24,6 @@
2424
"Windows": "no special instructions, package manager is recommended",
2525
"Linux": "no special instructions, package manager is recommended"
2626
},
27-
"version": "1.0",
27+
"version": "1.1",
2828
"minimumbinaryninjaversion": 3946
2929
}

0 commit comments

Comments
 (0)