1

I am developing a shared objects editor/viewer for eclipse using Preon. The editor looks like:

View of the editor

To improve it, I would like to implement a function that, once selected an entry on the top pannel, it would highlight the corresponding bytes on the bottom panel. To do that, whould be of great interest to retireve size and offset of a given field of my object with Preon.

How can I achieve that ? Are there some other alternatives ?

Marco Nanni
  • 113
  • 2
  • 6

1 Answers1

1

It's a little hard to tell what exactly you are trying to achieve (the screenshot is rather small), but it could be related to this.

enter image description here

It's done using the preon-emitter module, emitting meta data on the different snippets of data it decoded, while the decoder is running. As you can see, it allows you to build an HTML page that - while you're hovering over the bytes - gives you the information about the data structure it decoded.

In this particular case, it's showing the contents of a class file. The bold word at the left is the value decoded, the rest is where that value resides in the class files data structure.

Wilfred Springer
  • 10,869
  • 4
  • 55
  • 69
  • Yes, this is exactly what I need. In facts, I solved the problem in a similar way developping a custom codec decorator and a new annotation, but your solution is for far much more elegant. I will adopt it. Thank you. – Marco Nanni Jan 23 '13 at 23:34
  • Would love to see the outcome. Is it going to be something commercial? – Wilfred Springer Jan 24 '13 at 12:53
  • Unfortunately I step back from this undertaking. This is due to the impossibility to extract the function signature from a shared object (DLL), which was one of the main objective. This is not due to Preon, simply the DLL headers and tables do not contain such information. I lost some working days but I am looking forward to use soon Preon in another context. It is a great tool. – Marco Nanni Feb 04 '13 at 01:09