Hi Lex,
Thanks for your suggestions.
I work on memory forensics. My part of project is to locate memory of the sensitive data. For example, when I use the geany open one sensitive file, and the content will be in the memory (heap). I hope I can locate all memory related this sensitive file. And later I can do some analysis or protection.
Now, I override malloc and can log all malloc functions to get return address and size (I think g_malloc is a wrapper of malloc). But I still cannot building the mapping between the special file and related heap memory. I know each open or created file have different ID (GeanyDocument->id). However, I still cannot figure out how to trace the related memory of different ID. Assume I have open three files, so there are three windows and three different GeanyDocument->id. I write or change some things among these three windows. Meanwhile, I log all malloc/realloc/calloc functions. I try to figure out which malloc belong to window 1, which belong to window2 or window 3? Do you have any further suggestions for my case?
Thank you very much.
Best Regards,
Pengfei