~/talk

Hacking C# from the inside

Talkat Dotnetos Conference 2021 · 2021-10-05..10-06· [security]
slides:none on file

Claims concrete techniques: emit x86 machine code into byte[] and call it via Marshal.GetDelegateForFunctionPointer after VirtualProtect, modify JITed method pointers or MethodDesc to hijack methods in place, install VEH to catch StackOverflow and resume, implement awaiting for async void via custom SynchronizationContext/task scheduler, morph object headers to serialize a non-serializable child and fake multiple inheritance by reinterpret-casting fields. Demos run on x86 Windows/Linux, some hacks ship in production tooling and the examples shown actually work.

AI-written summary · about

  1. 0:00Start
  2. 2:50Agenda
  3. 3:49Avoiding Dynamic Dispatch
  4. 5:07Method Descriptor
  5. 7:13Lambda Expression
  6. 9:30Await Async Void Methods
  7. 10:51Internals of Asyncing Net
  8. 11:08Implement Our Custom Task Scheduler
  9. 11:42Create a Custom Synchronization Context
  10. 13:14Restore the Original Synchronization Context
  11. 14:21Run Machine Code from a Byte Array
  12. 18:11Write Machine Code
  13. 38:09Handle Stack Overflow Exceptions in C Sharp
  14. 38:24Why Would We Ever Try To Handle Stack Overflow Exception
  15. 45:10Multiple Inheritance
  16. 53:56Practical Usage
  17. 55:28Can some of Your Examples Be Run on Linux
  18. 57:12Manual Memory Management Session
  19. 1:02:46Gold Sponsor
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.