Replies: 5 comments 3 replies
-
@dragonmacher Harassing you again as you seem to know the internals very well. I'm hitting a road block with this specific side of the project. I'm averse to implementing out-of-band serialization when an integrated system exists in place (ProgramDB), also because polluting the user's filesystem is bad SW engineering etiquette. |
Beta Was this translation helpful? Give feedback.
-
@ryanmkurtz Anyone else? |
Beta Was this translation helpful? Give feedback.
-
Reanimating this discussion: per #968 it seems I could rely on What are the constraints I should be aware of? What examples of Saveable(s) exist that I can use for reference? The Saveable object I need to integrate/save to the ProgramDB is defined here: A more specific question: what is the ideal/preferred way to store arrays/lists of Saveable objects when using getProgramUserData as target? (the original overarching question) The object definition itself is quite straightforward and I believe Ghidra integrates a JSON library I can easily integrate for serialization, if needed. |
Beta Was this translation helpful? Give feedback.
-
I am rather confused about what you are attempting to store and it's relationship to a Program (e.g., user-specific or stored within program, address-specific or simple string-key). We have a variety of mechanisms for possible adhoc data:
|
Beta Was this translation helpful? Give feedback.
-
Program Options are not restricted to analyzer use only and would seem to make the most sense for this if you want them to be stored within the program's database using a storage key. They provide the most flexibility, particularly if associated with a GUI Plugin which can register a complex editor to view and manipulate the Option. See If you choose to use Since a Program database is intended to be shared with other users via a Ghidra Server, deciding to expose or not expose the YARA data to other users of the Program is a key deciding factor. |
Beta Was this translation helpful? Give feedback.
-
I'm in the process of writing the session save-restore functionality into one of the classes handling data that should survive across program cycles. It's my understanding that the ObjectStorage
put*()
methods operate in a FIFO fashion duringsave()
and the inverse duringrestore()
.The overall functionality is fantastic but I have found one limitation: suppose I need to store a sequence (
List
) of bytes, which normally for a singlebyte[]
instance you can do away withputBytes()
. What's the best approach to serialize or store aList
orArray
ofbyte[]
objects?I could also imagine that storing a
Map
might be beneficial. In the case of a sequence ofbyte[]
objects I think something generic should already exist. Alas I'm either missing it or there isn't one.Suppose the extension is to be proposed for merging at a later junction, are other serialize-to-string methods acceptable? It seems like having
ObjectStorage
and all the effort behind it should at least offer a path that does not involve a kludge like serialized strings.Also: is there any documentation for extension developers on how to connect the Saveable to a Manager class? Can extensions save data without creating their own
DBAdapter
-like class? I have been reading theBookmarkTypeDBAdapter
andOldBookmarkManager
classes to have an idea on how to implement my Saveable class storage in the context of the plugin.List
(collection) of Saveable objects in theProgramUserData
orProgramDB
, without implementing custom DB types?Beta Was this translation helpful? Give feedback.
All reactions