Click here to Skip to main content
15,916,318 members
Home / Discussions / C#
   

C#

 
GeneralRe: Thanks for reply Estys and J4amieC :rose: ! Pin
Estys14-Apr-10 1:20
Estys14-Apr-10 1:20 
GeneralRe: C# XML Atribute help? Pin
harold aptroot14-Apr-10 4:56
harold aptroot14-Apr-10 4:56 
QuestionFind and mark area in bing maps.... Pin
pranavcool13-Apr-10 22:51
pranavcool13-Apr-10 22:51 
QuestionDrag & Drop under Windows7 Pin
frommi13-Apr-10 21:40
frommi13-Apr-10 21:40 
AnswerRe: Drag & Drop under Windows7 Pin
Mycroft Holmes13-Apr-10 23:00
professionalMycroft Holmes13-Apr-10 23:00 
GeneralRe: Drag & Drop under Windows7 Pin
frommi13-Apr-10 23:13
frommi13-Apr-10 23:13 
GeneralRe: Drag & Drop under Windows7 Pin
Mycroft Holmes14-Apr-10 2:14
professionalMycroft Holmes14-Apr-10 2:14 
QuestionIs there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
blackblizzard13-Apr-10 20:43
blackblizzard13-Apr-10 20:43 
Hi.

I'd like to have access to the bytecode that is currently running or about to run in order to detect certain instructions and take specific actions (depending the instructions). In short, I'd like to monitor the bytecode in order to add safety control (see DETAILS below for explanation).

Is this possible? I know there are some AOP frameworks that notify you of specific events, like an access to a field or the invocation of a method, but I'd like to skip that extra layer and just look at all the bytecode myself, throughout the entire execution of the application.

I've already looked at several AOP frameworks (although not in great detail, since they don't seem to do quite what I need) and I'm familiar with Mono.Cecil.

I appreciate alternative suggestions, but I don't want to introduce the overhead of an AOP framework when what I actually need is access to the bytecode, without all the stuff they add on top to make it more user-friendly (... admittedly very useful stuff when you don't want to go low-level).

Thanks Smile | :)


DETAILS:


Basically, I have a C# application and I need to monitor the instructions it wants to run in order to detect read or write operations to fields (operations Ldfld and Stfld) and insert some instructions before the read/write takes place: I may need to acquire locks, or if that fails abort the operation. Also, I may need to update a read log (in case of a read) or write log (in case of a write).

In fact, what I'd really like to do is to replace the read/write instruction with my own custom code, but it that fails I think I could manage just inserting some instructions before and after.
AnswerRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
PIEBALDconsult14-Apr-10 4:31
mvePIEBALDconsult14-Apr-10 4:31 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
blackblizzard14-Apr-10 4:39
blackblizzard14-Apr-10 4:39 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
PIEBALDconsult14-Apr-10 5:08
mvePIEBALDconsult14-Apr-10 5:08 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
blackblizzard14-Apr-10 5:18
blackblizzard14-Apr-10 5:18 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
PIEBALDconsult14-Apr-10 5:29
mvePIEBALDconsult14-Apr-10 5:29 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
blackblizzard14-Apr-10 5:39
blackblizzard14-Apr-10 5:39 
AnswerRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? Pin
Daniel Grunwald14-Apr-10 6:03
Daniel Grunwald14-Apr-10 6:03 
GeneralRe: Is there a way in .NET to access the bytecode/IL/CLR that is currently running? [modified] Pin
blackblizzard14-Apr-10 6:32
blackblizzard14-Apr-10 6:32 
QuestionGet output from console window (which is a different process) Pin
Programm3r13-Apr-10 20:19
Programm3r13-Apr-10 20:19 
AnswerRe: Get output from console window (which is a different process) Pin
Martin Jarvis13-Apr-10 20:44
Martin Jarvis13-Apr-10 20:44 
GeneralRe: Get output from console window (which is a different process) Pin
Programm3r13-Apr-10 20:56
Programm3r13-Apr-10 20:56 
AnswerRe: Get output from console window (which is a different process) Pin
Programm3r13-Apr-10 21:11
Programm3r13-Apr-10 21:11 
AnswerRe: Get output from console window (which is a different process) Pin
PIEBALDconsult14-Apr-10 3:24
mvePIEBALDconsult14-Apr-10 3:24 
Questiondrawing semi transparent boxes over richtextbox Pin
NarVish13-Apr-10 20:16
NarVish13-Apr-10 20:16 
QuestionWindows Forms Application versus Web Application Pin
polycom12313-Apr-10 19:28
polycom12313-Apr-10 19:28 
AnswerRe: Windows Forms Application versus Web Application Pin
Programm3r13-Apr-10 20:23
Programm3r13-Apr-10 20:23 
GeneralRe: Windows Forms Application versus Web Application Pin
polycom12313-Apr-10 20:49
polycom12313-Apr-10 20:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.