Mono里运行C#脚本7—MonoImageStorage结构解析
Mono里运行C#脚本7—MonoImageStorage结构解析
定义一个结构来保存EXE文件加载到内存的表示。
typedef struct {
MonoRefCount ref; //引用计数,如果这个文件引用计数为0就可以删除。
/* key used for lookups. owned by this image storage. */
char *key; //HASH的键,通过键可以快速访问。
/* If the raw data was allocated from a source such as mmap, the allocator may store resource tracking information here. */
void *raw_data_handle; //使用CreateFileMappingW打开后的句柄保存在这里。
char *raw_data; //保存MapViewOfFile操作的指针,指向文件数据。
guint32 raw_data_len; //保存文件数据的长度。
/* data was allocated with mono_file_map and must be unmapped */
guint8 raw_buffer_used : 1; //是否使用mono_file_map函数打开
/* data was allocated with malloc and must be freed