dotnet: consider emitting references to types
See original GitHub issuemethods interact with various types, including both primitive objects (u8) and classes. sometimes we see method/property access to the classes, which can be represented by things like API
(and maybe offset
???). we might also see direct references to class objects, such as casting instances from one class to another.
do we want to introduce a new feature to represent types/classes referenced within some scope?
e.g.
type: System.Net.FtpWebResponse
Issue Analytics
- State:
- Created a year ago
- Comments:7
Top Results From Across the Web
Nullable reference types - Microsoft Learn
This article provides an overview of nullable reference types. You'll learn how the feature provides safety against null reference ...
Read more >How to: Define a Generic Type with Reflection Emit - .NET ...
In this example, type parameter TFirst is constrained to types that have parameterless constructors, and to reference types. TFirst-> ...
Read more >Working with nullable reference types - EF Core
C# 8 introduced a new feature called nullable reference types (NRT), allowing reference types to be annotated, indicating whether it is ...
Read more >What's new in C# 9.0 - C# Guide - Microsoft Learn
Record types are reference types, so a record instance contains only a reference to the data. Positional syntax for property definition. You can ......
Read more >GenericTypeParameterBuilder.MakeByRefType Method
Returns a Type object that represents the current generic type parameter when passed as a reference parameter.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Chatted with @adamstorek offline about the ability to distinguish object instantiation in capa rules. This is especially important when analyzing scripting languages e.g.
which we see as the following in .NET CIL:
We discussed the potential of emitting an object instantiation as an
api
feature using the keywordctor
:This would allow us to capture the intended behavior without needing to add new features.
As a programmer, I get the difference between instance and class. But from a perspective of matching malware behavior, does it make enough difference to warrant a new feature?
Note also that the rule author must be competent at programming to differentiate the cases to construct accurate rules. Not sure if this is a strong or weak argument, though.