capa icon indicating copy to clipboard operation
capa copied to clipboard

dotnet: emit features for object instantiation via newobj instruction

Open mike-hunhoff opened this issue 2 years ago • 1 comments

sub task of #982.

for each newobj instruction emit namespace, class, and api features where api is in the format <namespace>.<class>::ctor where ctor is capa's way to identify object instantiation via a call to the object's constructor. For example,

CIL:

...
... newobj System.Threading.Mutex::.ctor
...

features:

- namespace: System.Threading
- class: System.Thread.Mutex
- api: System.Threading.Mutex::ctor

tasks:

  • [ ] namespace extraction
  • [ ] class extraction
  • [ ] api extraction
  • [ ] update documentation

mike-hunhoff avatar Aug 17 '22 18:08 mike-hunhoff

see here for more discussion

mike-hunhoff avatar Aug 17 '22 18:08 mike-hunhoff

The newobj instruction creates a new object or a new instance of a value type. Ctor is a metadata token (a methodref or methoddef that must be marked as a constructor) that indicates the name, class and signature of the constructor to call.

mike-hunhoff avatar Oct 07 '22 16:10 mike-hunhoff