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

Cannot get __Text segment from a MachO object file #696

Open
xiangqianli opened this issue Apr 14, 2022 · 0 comments
Open

Cannot get __Text segment from a MachO object file #696

xiangqianli opened this issue Apr 14, 2022 · 0 comments
Assignees

Comments

@xiangqianli
Copy link

xiangqianli commented Apr 14, 2022

Describe the bug
I have a .o file generated within a .a MachO static library, with lief, I cannot get __Text segment from object file, while with MachoView the .o file's __Text segment is clear.
wecom-temp-a819075be4aadb3939d724bb90da1157
wecom-temp-a1ba24862c3d0126f8d42397d5dade27

but with lief I can get __Text segment from an executable file, does lief not support this ability from object file?

To Reproduce
Steps to reproduce the behavior:
In Python:
企业微信截图_51ac9d46-64c4-46a1-9fe1-57cabbec7f38

if name == 'main':

fatbinary = lief.MachO.parse("./XQPerson.o", config=lief.MachO.ParserConfig.deep)
binary = lief.MachO.FatBinary.take(fatbinary, lief.MachO.CPU_TYPES.ARM64)
print_segments(binary)
print(binary.get_segment("__TEXT"))

Console Result:
企业微信截图_b06bc128-fe5a-4652-b267-44fd6504f629

Expected behavior
Get the __Text segment from .o MachO Object file correctly

Environment (please complete the following information):

  • System and Version : macOS Big Sur 11.3.1
  • Target format ( Mach-O)
  • LIEF commit version: 0.12.1-c7b3ce3b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants