【工具】Omnivore

文章目录
  1. 1. Omnivore
    1. 1.1. 个人配置

概述:通过 Omniover 来整理碎片知识

相关链接

Omnivore

个人配置

Article Template

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# {{{title}}}
#Omnivore

[Read on Omnivore]({{{omnivoreUrl}}})
[Read Original]({{{originalUrl}}})

{{#highlights.length}}
## Highlights

{{#highlights}}
> {{{text}}} [⤴️]({{{highlightUrl}}}) {{#labels}} #{{name}} {{/labels}}
{{#note}}

{{{note}}}
{{/note}}

{{/highlights}}
{{/highlights.length}}

---

{{{content}}}

Front Matter

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
id: {{{id}}}
title: >
{{{title}}}
{{#author}}
author: >
{{{author}}}
{{/author}}
{{#labels.length}}
tags:
{{#labels}} - {{{name}}}
{{/labels}}
{{/labels.length}}
date_saved: {{{dateSaved}}}
{{#datePublished}}
date_published: {{{datePublished}}}
{{/datePublished}}
tags: [Omnivore,{{{labels}}}]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
internal static class ModuleHelper
{
private static IDictionary<IntPtr, Module>? _mapAddressToModule;
private static readonly FieldInfo m_pData;
private static readonly MethodInfo GetHInstance;

private static readonly object LoadLock = new();
private static readonly object LockSelfMapsLinux = new object();

static ModuleHelper()
{
m_pData = Type.GetType("System.Reflection.RuntimeModule")
.GetField("m_pData", BindingFlags.NonPublic | BindingFlags.Instance);
GetHInstance = typeof(Marshal).GetMethod("GetHINSTANCE", new[] { typeof(Module) })!;
LoadMapScopeToHandle();
}

public static IntPtr GetAddressFromModule(Module module)
{
return (IntPtr)m_pData.GetValue(module);
}
}