[原创]frida-ag真人国际厅网站

gummemoryaccessmonitor *

gum_memory_access_monitor_new (const gummemoryrange * ranges,

                               guint num_ranges,

                               gumpageprotection access_mask,

                               gboolean auto_reset,

                               gummemoryaccessnotify func,

                               gpointer data,

                               gdestroynotify data_destroy)

  gummemoryaccessmonitor * monitor;

  guint i;

 

  monitor = g_object_new (gum_type_memory_access_monitor, null);

  monitor->ranges = g_memdup (ranges, num_ranges * sizeof (gummemoryrange));

  monitor->num_ranges = num_ranges;

  monitor->access_mask = access_mask;

  monitor->auto_reset = auto_reset;

  monitor->pages_total = 0;

 

  for (i = 0; i != num_ranges; i )

  {

    gummemoryrange * r = &monitor->ranges[i];

    gsize aligned_start, aligned_end;

    guint num_pages;

 

    aligned_start = r->base_address & ~((gsize) monitor->page_size - 1);

    aligned_end = (r->base_address r->size monitor->page_size - 1) &

        ~((gsize) monitor->page_size - 1);

    r->base_address = aligned_start;

    r->size = aligned_end - aligned_start;

 

    num_pages = r->size / monitor->page_size;

    g_atomic_int_add (&monitor->pages_remaining, num_pages);

    monitor->pages_total = num_pages;

  }

 

  monitor->notify_func = func;

  monitor->notify_data = data;

  monitor->notify_data_destroy = data_destroy;

 

  return monitor;

原文链接:https://bbs.kanxue.com/thread-278423.htm

网络摘文,本文作者:15h,如若转载,请注明出处:https://www.15cov.cn/2023/08/27/原创frida-gum-源代码速通笔记/

发表评论

邮箱地址不会被公开。 必填项已用*标注

网站地图