-
Notifications
You must be signed in to change notification settings - Fork 278
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
[jimple2cpg] Consistent & Recursive JAR/WAR Unpacking #3078
Merged
DavidBakerEffendi
merged 9 commits into
joernio:master
from
badly-drawn-wizards:reuben/jimple2cpg/recursive-archive-unpacking
Jul 11, 2023
Merged
[jimple2cpg] Consistent & Recursive JAR/WAR Unpacking #3078
DavidBakerEffendi
merged 9 commits into
joernio:master
from
badly-drawn-wizards:reuben/jimple2cpg/recursive-archive-unpacking
Jul 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Previously jimple2cpg would have two distinct code paths when importing a directory containing a jar (which would unpack the jar) compared to importing a jar directly (which would load it with soot). This change does the following - Always use the unpacking behaviour for jars - Remove jimple from the source files being processed (It can be added back if needed downstream) - Keep the .apk/.dex behaviour if imported directly (but not if contained in a directory). This maintains the existing behaviour. Some remaining work is to: - add docstrings - add unit tests for recursive unpacking - add unit tests for .apk/.dex (maybe)
badly-drawn-wizards
changed the title
Recursive jar unpacking.
[jimple2cpg] recursive jar unpacking.
Jul 11, 2023
badly-drawn-wizards
changed the title
[jimple2cpg] recursive jar unpacking.
[jimple2cpg] recursive jar unpacking
Jul 11, 2023
DavidBakerEffendi
added
enhancement
New feature or request
jvm
Relates to jimple2cpg
labels
Jul 11, 2023
DavidBakerEffendi
requested changes
Jul 11, 2023
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.
Really good PR! The suggestions are mostly about Scala style related stuff
joern-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/Jimple2Cpg.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
fabsx00
reviewed
Jul 11, 2023
fabsx00
reviewed
Jul 11, 2023
DavidBakerEffendi
changed the title
[jimple2cpg] recursive jar unpacking
[jimple2cpg] Recursive JAR/WAR Unpacking
Jul 11, 2023
DavidBakerEffendi
changed the title
[jimple2cpg] Recursive JAR/WAR Unpacking
[jimple2cpg] Consistent & Recursive JAR/WAR Unpacking
Jul 11, 2023
Since we recursively search, the class files found may include those in the original source directory, which we do not want to move. So we just copy instead.
fabsx00
reviewed
Jul 11, 2023
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Show resolved
Hide resolved
...n-cli/frontends/jimple2cpg/src/main/scala/io/joern/jimple2cpg/util/ProgramHandlingUtil.scala
Outdated
Show resolved
Hide resolved
joern-cli/frontends/jimple2cpg/src/test/scala/io/joern/jimple2cpg/unpacking/JarUnpacking.scala
Show resolved
Hide resolved
DavidBakerEffendi
approved these changes
Jul 11, 2023
fabsx00
approved these changes
Jul 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add consistent recursive jar unpacking.
Previously jimple2cpg would have two distinct
code paths when importing a directory containing a
jar (which would unpack the jar) compared to importing
a jar directly (which would load it with soot).
This led to strange names starting with
META-INF
for method nodes when importing a jar directly.This change does the following
(It can be added back if needed downstream)
in a directory). This maintains the existing behaviour.