Comments (11)
Alright, I'm making a fork for my attempt at this https://github.com/bytespy/cfr
from cfr.
I ended up going for a 'token-stream-with-semantic-info' rather than an explicit interface. I don't want to expose the internal interface, and this fits better with my aim of keeping the external API compatible in both directions.
There's an example in https://github.com/leibnitz27/cfr_client/blob/master/src/org/benf/cfr_client_example/WithTokenSink.java
from cfr.
This would be pretty useful. I've been using JavaParser's SymbolSolver for this so far. If this isn't in-scope you can always try that out.
from cfr.
@Col-E it is possible for the classes to have some weird characters that could potentially affect the symbol solver like {
for example
from cfr.
As long as the AST is built it should work. I've not tested on obfuscated code if that's what you're asking.
from cfr.
FWIW - the current internal api is https://github.com/leibnitz27/cfr/blob/master/src/org/benf/cfr/reader/util/output/Dumper.java
which is more of a literal string stream than ITextOutput. It wouldn't be too tricky to convert usages to a similar api. (note that there's some state which is used to handle how types are viewed etc).
However .....
I have a sneaky (ENTIRELY UNJUSTIFIED) feeling that the next logical step is basically to export a parse tree, rather than something like a string stream.
The issue there (yak shaving time!) is that I don't want to use standard JDK parse tree types, because I am very attached to 'any version of java' with forwards compatibility. And I don't want to export the internal AST types, because they contain a great deal of hackery that isn't locked down.
I'm tempted to bypass the intermediate stage.
from cfr.
@leibnitz27 Would it be possible for you to add an option to set a custom dumper factory in CfrDriverImpl as seen here?
from cfr.
@leibnitz27 could you add methods like "writeComment", "writeKeyword", "writeDelimiter", etc. like procyon's ITextOutput? This would be very useful for syntax highlighting
from cfr.
@leibnitz27 also would it be possible to make objects for identifier like method, fields, variables instead of string?
from cfr.
Cool - please bear in mind a few small things:
I massively prefer not to expose internal APIs, because I really appreciate the freedom to screw with them (you might have noticed). So either implement an externally visible API in dumper, or expose to the outside world via an adaptor please.
Also note that the dumper (effctively) carries a type registration burden, which really doesn't want to be exposed to the outside world.
from cfr.
How can dump the original bytecode of method code attribute when CFR failed to decompile? As Procyon decompiler does(pls refer the attachement), thanks.
from cfr.
Related Issues (20)
- CFR may perform incorrect modifications to the type of generic class variables
- CFR generates duplicate variable names inside and outside lambda expressions
- Type argument of null reference generic class variables is converted to Object
- Casting of primitive types may be decompiled as casting of corresponding wrapper classes under certain circumstances
- Type Conversion Expression Lost in Constructor
- Question: Is there any switch to specify a single class to be decompiled? HOT 1
- How can I show the class packages?
- Option to remove the file headers HOT 1
- Question: decompiling multiple files from terminal HOT 1
- How do I decompile using CFR's CFRDriver?
- Decompiling class files from Java bytecode source HOT 2
- Ternary Expression Causing Decompilation Type Error
- Incorrect Comparable Expression Produced by Ternary Expression
- CFR can't handle recent Oracle JDBC jars HOT 1
- CFR omits parentheses in expressions with mixed operators HOT 1
- CFR uses numerical literals instead of constants HOT 4
- CFR omits optional braces after if statements HOT 1
- Extractable last case doesn't follow previous, and can't clone.
- Decompiler HOT 1
- Incorrect decompilation related to certain usages of conditionals in catch blocks HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cfr.