Comments (6)
Hi @chengkenyong, congrats! So the simplest would be to have a look at how javasrc2cpg
tests a similar structure, and to check using something like dotAst
/dotCfg
/dotDdg
to determine what the differences are. My guess is, usually the equivalent data-flow is supported in Java, but that the resulting AST in C# might be a bit off and need adjusting in order to produce the same CFG/DDG that will eventually give you your flow. If your finding isn't obvious, feel free to post the comparison in this thread and I can continue to guide you
from joern.
Hi @chengkenyong, development of C# frontend has been largely funded by Privado, but they have since scaled it back a bit due to priorities on other languages. The C# frontend relies on two components (1) the Roslyn parser wrapped in a neat binary which can be found here https://github.com/joernio/DotNetAstGen, and (2) the AstCreation in Joern.
For the missing AST features you've described, it could be that they need to be filtered in on the parser. So that change would be in DotNetAstGen. One way to check is to create a JSON AST dump of the file you're interested in, and see if it is present.
If the entity is there, then it probably needs a handler in one of the classes within the astcreation
package in csharpsrc2cpg.
Regarding type information, it is not uncommon for fieldAccess
nodes to not have type info, especially if the receiver is an object, since this might have multiple types in the case of polymorphism. This may require a bit more of a "dynamic" query that looks at the fieldAccess.argument(1).evalType.baseTypeDeclTransitive
step to find all possible types, and then determine which of those types have members matching the canonicalName
of the fieldIdentifier
.
from joern.
Hi @DavidBakerEffendi , Your explanation has been very helpful to me, and I will follow your advice to learn more about the relevant topics. Thank you for your assistance.
from joern.
Hi @DavidBakerEffendi ,Based on your suggestion, I have restored the missing type of the fieldAccess node to the desired state in the first case. However, I am still unclear about how to address the third case of missing data flow. Specifically, I want to restore the data flow in the third case where the variable childSqlMapSource cannot reach sqlMapPath through the foreach loop. Could you please provide me with some more advice on how to achieve this? Thank you!
from joern.
Related Issues (20)
- [Bug][pysrc2cpg] `Invalid Code` parsing issues HOT 3
- [Bug][pysrc2cpg] Dangling node in method DDG
- [ruby] Method Bindings
- [Bug][pysrc2cpg] Type inferrence of class attributes does not propagate from nested field accesses
- [Bug] random warnings/exceptions on reachableBy operation over C source code HOT 6
- [ruby] HereDoc in Function Argument HOT 1
- [python] over-tainting dictionary literal arguments
- [Bug] The same version of joern behaves differently on different machines. HOT 7
- [Bug] Joern tab completion can freeze joern and print "exception caught when loading module class module-info$: java.lang.AssertionError: assertion failed: attempt to parse java.lang.Object from classfile" HOT 11
- [ruby] Class & Singleton Class Modelling
- [Bug] Error trying to run joern on Windows after install HOT 3
- [Bug] In JS for call node additional structure getting generated HOT 1
- [Bug] help~C# DotNetAstGenRunner:- running dotnetastgen failed! HOT 1
- [dataflowengineoss] Over-tainting inlined literals
- Release builds are broken, sonatype credentials change required HOT 2
- [ruby] `<body>` Methods for TypeDecl Statements
- [ruby] New Parser Tests HOT 1
- [Bug] Parse JNI functions in C code HOT 8
- [ruby] Add `.call` Member to Proc/Lambda Types
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 joern.