Skip to main content
  • 95 Accesses

Abstract

In this chapter, I’ll cover how you can debug your CIL-based applications. I’ll demonstrate how you can create debug builds of your assemblies, the tools that you can use to debug them, and how to get them running in the debugger.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.95
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 49.95
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Reference

  1. And do you really want to do that in CIL?

    Google Scholar 

  2. For more information on getting these symbol files for system executables, see ms-help://MS.NETFrameworkSDK/vsdebug/html/vxtskInstallingDebugSymbols.htm.

    Google Scholar 

  3. While I won’t show any multithreaded assemblies in this chapter, you can prefix most of the cordbg commands with an asterisk (*) to apply them to every thread in the assembly.

    Google Scholar 

  4. Note that if you want to stop the current debugging session, but you don’t want to leave cordbg, enter kill.

    Google Scholar 

  5. Interested readers can download the three volumes of Intel’s Architecture Software Developer’s Manual at http://developenintel.com/design/pentium4/manuals/.

    Google Scholar 

  6. A scenario that’s highly unlikely, but you never know.

    Google Scholar 

  7. Your values will probably be completely different from mine. That’s OK—as I discuss specific register values, just focus on the register label itself and don’t try to compare your results with mine.

    Google Scholar 

  8. You may not have noticed yet, but if you don’t pass in any arguments to BadConsole, you don’t get an exception.

    Google Scholar 

  9. Readers who have done any MTS/COM+ development will be familiar with the technique I’m about to show.

    Google Scholar 

  10. break isn’t limited to in-proc assemblies; it’ll work the same in any kind of assembly.

    Google Scholar 

  11. The debugger will tell you which method the InvalidProgramException happened in, but that’s it.

    Google Scholar 

  12. See Section 21 of Partition II for metadata validation rules. Each CIL opcode in Partition III has a section that discusses the verifiability rules.

    Google Scholar 

  13. This assembly (but not its source code) is included with the book’s downloadable code.

    Google Scholar 

  14. Of course, this is a very contrived case, as there’s no reason to buy such a trivial component, but it’s not the capabilities of the assembly that matter in this case.

    Google Scholar 

  15. You could run PEVerify and tell the company that they released an assembly with two IL errors, but since there’s no way to get a hold of the vendor in this fictitious case, it doesn’t matter (although it helps you to run PEVerify so you can glean more information on BadDivider’s problems).

    Google Scholar 

  16. Whether they reimburse you financially for your heroic efforts is another story.

    Google Scholar 

  17. Full coverage of how obfuscators work is beyond the scope of one chapter. I strongly suggest reading the paper “Java Control Flow Obfuscation,” which can be downloaded at http://www.cs.auckland.ac.nz/research/theses/1998/lowdouglasthesis1998.pdf,for detailed coverage on this topic.

    Google Scholar 

  18. Note that an obfuscator can work at either the source-code or assembly level. I’m only showing the example in C# as it’s easier to follow than CIL.

    Google Scholar 

  19. And, chances are Node’s name would’ve been obfuscated as well, which makes the job of reading the reverse-engineered code much more difficult.

    Google Scholar 

Download references

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Jason Bock

About this chapter

Cite this chapter

Bock, J. (2002). Debugging CIL. In: CIL Programming: Under the Hood™ of .NET. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-0845-7_5

Download citation

  • DOI: https://doi.org/10.1007/978-1-4302-0845-7_5

  • Publisher Name: Apress, Berkeley, CA

  • Print ISBN: 978-1-4302-5156-9

  • Online ISBN: 978-1-4302-0845-7

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics