-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/macho symbol provider #89
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
Changes from all commits
7449465
e3f64a1
e2f09d6
3779329
a7af469
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,9 +8,8 @@ | |||||
|
|
||||||
| lief.logging.disable() | ||||||
|
|
||||||
| from smda.common.labelprovider.OrdinalHelper import OrdinalHelper # noqa: E402 | ||||||
|
|
||||||
| from .AbstractLabelProvider import AbstractLabelProvider # noqa: E402 | ||||||
| from .PeSymbolProvider import PeSymbolProvider # noqa: E402 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of importing
Suggested change
|
||||||
|
|
||||||
| LOGGER = logging.getLogger(__name__) | ||||||
|
|
||||||
|
|
@@ -41,20 +40,7 @@ def update(self, binary_info): | |||||
| lief_binary = binary_info.getLiefBinary() | ||||||
| if not isinstance(lief_binary, lief.PE.Binary): | ||||||
| return | ||||||
| for imported_library in lief_binary.imports: | ||||||
| for func in imported_library.entries: | ||||||
| if func.name: | ||||||
| self._api_map["lief"][func.iat_address + binary_info.base_addr] = ( | ||||||
| imported_library.name.lower(), | ||||||
| func.name, | ||||||
| ) | ||||||
| elif func.is_ordinal: | ||||||
| resolved_ordinal = OrdinalHelper.resolveOrdinal(imported_library.name.lower(), func.ordinal) | ||||||
| ordinal_name = resolved_ordinal if resolved_ordinal else f"#{func.ordinal}" | ||||||
| self._api_map["lief"][func.iat_address + binary_info.base_addr] = ( | ||||||
| imported_library.name.lower(), | ||||||
| ordinal_name, | ||||||
| ) | ||||||
| self._api_map["lief"] = PeSymbolProvider(None).parseImports(lief_binary, binary_info.base_addr) | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Directly call
Suggested change
|
||||||
|
|
||||||
| def setOsName(self, os_name): | ||||||
| self._os_name = os_name | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When analyzing an ET_DYN/PIE ELF buffer with a nonzero
binary_info.base_addr, LIEF reportsheader.entrypointas an offset relative to the load base, not an absolute VA. This subtraction makesbinary_info.oepnegative, andRecursiveDisassemblerlater queuesbase_addr + oep, so it starts at the small file VA (for example0x1050) instead ofbase_addr + 0x1050and can miss the real entry point.Useful? React with 👍 / 👎.