当前位置: 首页>>代码示例>>C++>>正文


C++ MatchResults::dump方法代码示例

本文整理汇总了C++中MatchResults::dump方法的典型用法代码示例。如果您正苦于以下问题:C++ MatchResults::dump方法的具体用法?C++ MatchResults::dump怎么用?C++ MatchResults::dump使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MatchResults的用法示例。


在下文中一共展示了MatchResults::dump方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: printf

//----------------------------------------------------------------------
// find_cstring_in_heap
//
// Finds a C string inside one or more currently valid malloc blocks.
//----------------------------------------------------------------------
malloc_match *
find_cstring_in_heap (const char *s, int check_vm_regions)
{
    g_matches.clear();
    if (s == NULL || s[0] == '\0')
    {
        printf ("error: invalid argument (empty cstring)\n");
        return NULL;
    }
    // Setup "info" to look for a malloc block that contains data
    // that is the C string passed in aligned on a 1 byte boundary
    range_contains_data_callback_info_t data_info;
    data_info.type = eDataTypeContainsData;  // Check each block for data
    data_info.data.buffer = (uint8_t *)s;    // What data? The C string passed in
    data_info.data.size = strlen(s);         // How many bytes? The length of the C string
    data_info.data.align = 1;                // Data doesn't need to be aligned, so set the alignment to 1
    data_info.match_count = 0;               // Initialize the match count to zero
    data_info.done = false;                  // Set done to false so searching doesn't stop
    data_info.unique = false;                // Set to true when iterating on the vm_regions
    range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
    foreach_zone_in_this_process (&info);
    g_matches.dump();

    return g_matches.data();
}
开发者ID:nicoster,项目名称:heap_find,代码行数:30,代码来源:heap_find_pid.cpp

示例2: sizeof

//----------------------------------------------------------------------
// find_pointer_in_heap
//
// Finds a pointer value inside one or more currently valid malloc
// blocks.
//----------------------------------------------------------------------
malloc_match *
find_pointer_in_heap (const void * addr, int check_vm_regions)
{
    g_matches.clear();
    // Setup "info" to look for a malloc block that contains data
    // that is the a pointer 
    if (addr)
    {
        range_contains_data_callback_info_t data_info;
        data_info.type = eDataTypeContainsData;      // Check each block for data
        data_info.data.buffer = (uint8_t *)&addr;    // What data? The pointer value passed in
        data_info.data.size = sizeof(addr);          // How many bytes? The byte size of a pointer
        data_info.data.align = sizeof(addr);         // Align to a pointer byte size
        data_info.match_count = 0;                   // Initialize the match count to zero
        data_info.done = false;                      // Set done to false so searching doesn't stop
        data_info.unique = false;                    // Set to true when iterating on the vm_regions
        range_callback_info_t info = { enumerate_range_in_zone, range_info_callback, &data_info, check_vm_regions };
        foreach_zone_in_this_process (&info);
    }

    g_matches.dump();
    return g_matches.data();
}
开发者ID:nicoster,项目名称:heap_find,代码行数:29,代码来源:heap_find_pid.cpp


注:本文中的MatchResults::dump方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。