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

WIP-minor ARM ELF tweaks #290

Merged
merged 42 commits into from Aug 3, 2020
Merged

Conversation

atlas0fd00m
Copy link
Contributor

some documentation and a few things missed during the last melee

…info (we only need the first one, and sometimes there is only one)
… described as LOC_POINTER, the call to makeCode didn't include any architecture context. this doesn't work for ARM when in Thumb mode. added "previous opcode" mode.

also, rearranging "pointers" analysis module logging and error handling.
…us pointer naming. update unittests.

also, renamed my new "reprLocation()" since it already exists.  renamed to "reprLocEntry()"
@rakuy0 rakuy0 added this to the PyPi Initial Release milestone Jul 22, 2020
Copy link
Contributor

@rakuy0 rakuy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing really wild yet. Will re-review when you feel it's no longer WIP.

envi/__init__.py Show resolved Hide resolved
vivisect/tests/linux_arm_sh_data.py Show resolved Hide resolved
vivisect/__init__.py Outdated Show resolved Hide resolved
vivisect/const.py Show resolved Hide resolved
vivisect/base.py Show resolved Hide resolved
vivisect/analysis/generic/pointers.py Show resolved Hide resolved
vivisect/base.py Outdated Show resolved Hide resolved
vivisect/analysis/elf/elfplt.py Outdated Show resolved Hide resolved
print seg[2]
vwdis(vw, seg[0], 10)

linux/i386/vdir:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's starting to feel like we needs a notes directory (not a user facing docs directory, though we need that too) so we can store stuff like this in a more organized fashion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good. what do you propose? these "take into account all the millions of combinations we need to deal with" problems are kinda annoying

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly a more comprehensive writeup might belong in a docs directory (something I've been procrastinating on for a long time). Because looking at this below here with intermingled section output (there's also a couple exception print outs in there?) and opcodes, I could not tell you off the top of my head why it's all there.

So maybe not in this PR, but as part of a cleanup one, it might be good to get your thoughts on it down in some real docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

vivisect/analysis/elf/elfplt.py Show resolved Hide resolved
…ms like performing ELF/PLT analysis to "predict" where functions are is more pain than it's worth, and the code is getting more and more complex to do so. either: we'll want to simply lay down opcodes using makeCode() and let the function analysis do the rest, or we may want to refactor the codebase for simplified maintenance.

also, changing unittests to make failures more understandable.
…applies to this. the separation of analyzePLT() and analyzeFunction() is getting blurrier, as analyzePLT() appears to be requiring much more complex analysis to "get it right". going to try a couple things to see how we can reduce brittleness and complexity of the elfplt analysis module.
update unittest data for linux/arm/sh
Copy link
Contributor

@rakuy0 rakuy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More to come but I wanted to get these in fast since they pertain to fixing bugs.

vivisect/analysis/elf/elfplt.py Outdated Show resolved Hide resolved
vivisect/analysis/elf/elfplt.py Outdated Show resolved Hide resolved
vivisect/analysis/elf/elfplt.py Show resolved Hide resolved
envi/archs/arm/emu.py Outdated Show resolved Hide resolved
vivisect/analysis/elf/elfplt.py Show resolved Hide resolved
Copy link
Contributor

@rakuy0 rakuy0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few more minor nitpicks. These are the last ones, as the rest looks to be in good shape.

vivisect/__init__.py Outdated Show resolved Hide resolved
print seg[2]
vwdis(vw, seg[0], 10)

linux/i386/vdir:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly a more comprehensive writeup might belong in a docs directory (something I've been procrastinating on for a long time). Because looking at this below here with intermingled section output (there's also a couple exception print outs in there?) and opcodes, I could not tell you off the top of my head why it's all there.

So maybe not in this PR, but as part of a cleanup one, it might be good to get your thoughts on it down in some real docs.

vivisect/analysis/elf/elfplt.py Outdated Show resolved Hide resolved
vivisect/const.py Show resolved Hide resolved

def debuginfosyms(self, vw, data, fname):
# we don't currently parse debugging symbols.
# while they are seldom in hard targets, this is a weakness we should correct.
pass
return 0,0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That reminds me. I've got a dwarfinfo branch out still. I should go back and update that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@atlas0fd00m atlas0fd00m requested a review from rakuy0 July 30, 2020 03:49
@atlas0fd00m atlas0fd00m merged commit 35f2a5b into vivisect:master Aug 3, 2020
@atlas0fd00m atlas0fd00m deleted the atlas_arm_fixes branch August 3, 2020 21:07
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

Successfully merging this pull request may close these issues.

None yet

2 participants