diff --git a/Il2CppInspector.Common/Model/AddressMap.cs b/Il2CppInspector.Common/Model/AddressMap.cs new file mode 100644 index 0000000..3f9a310 --- /dev/null +++ b/Il2CppInspector.Common/Model/AddressMap.cs @@ -0,0 +1,34 @@ +/* + Copyright 2020 Katy Coe - http://www.djkaty.com - https://github.com/djkaty + + All rights reserved. +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Il2CppInspector.Model +{ + // A map of absolutely everything in the binary we know about + // Designed to be used by static analysis disassembly frameworks such as Capstone.NET + public class AddressMap + { + public Dictionary Item { get; } = new Dictionary(); + + public AppModel Model { get; } + + public AddressMap(AppModel model) { + Model = model; + build(); + } + + private void build() { + // TODO: Build address map + } + + public object At(ulong addr) => Item.ContainsKey(addr)? Item[addr] : null; + + public bool TryAdd(ulong addr, object item) => Item.TryAdd(addr, item); + } +}