本文整理汇总了C++中netnode::getblob方法的典型用法代码示例。如果您正苦于以下问题:C++ netnode::getblob方法的具体用法?C++ netnode::getblob怎么用?C++ netnode::getblob使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类netnode
的用法示例。
在下文中一共展示了netnode::getblob方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
//--------------------------------------------------------------------------
//
// Initialize.
//
// IDA will call this function only once.
// If this function returns PLGUIN_SKIP, IDA will never load it again.
// If this function returns PLUGIN_OK, IDA will unload the plugin but
// remember that the plugin agreed to work with the database.
// The plugin will be loaded again if the user invokes it by
// pressing the hotkey or selecting it from the menu.
// After the second load the plugin will stay on memory.
// If this function returns PLUGIN_KEEP, IDA will keep the plugin
// in the memory. In this case the initialization function can hook
// into the processor module and user interface notification points.
// See the hook_to_notification_point() function.
//
// In this example we check the input file format and make the decision.
// You may or may not check any other conditions to decide what you do:
// whether you agree to work with the database or not.
//
int idaapi init(void) {
unsigned char md5[MD5_LEN];
msg(PLUGIN_NAME": collabREate has been loaded\n");
//while the md5 is not used here, it has the side effect of ensuring
//that the md5 is taken at the earliest opportunity for storage in
//the database in the event that the original binary is deleted
getFileMd5(md5, sizeof(md5));
unsigned char gpid[GPID_SIZE];
ssize_t sz = getGpid(gpid, sizeof(gpid));
if (sz > 0) {
msg(PLUGIN_NAME": Operating in caching mode until connected.\n");
if (changeCache == NULL) {
size_t sz = 0;
void *tcache = cnn.getblob(NULL, &sz, 1, COLLABREATE_CACHE_TAG);
if (tcache != NULL && sz > 0) {
changeCache = new qstring((char*)tcache);
}
else {
changeCache = new qstring();
}
qfree(tcache);
hookAll();
}
}
if (msgHistory.size() == 0) {
size_t sz = 0;
void *thist = cnn.getblob(NULL, &sz, 1, COLLABREATE_MSGHISTORY_TAG);
if (thist != NULL && sz > 1) {
char *sptr, *endp;
sptr = (char*)thist;
while ((endp = strchr(sptr, '\n')) != NULL) {
msgHistory.push_back(qstring(sptr, endp - sptr));
sptr = endp + 1;
}
}
qfree(thist);
}
build_handler_map();
if (init_network()) {
return PLUGIN_KEEP;
}
else {
return PLUGIN_SKIP;
}
}