2023-07-15 14:29:14 +02:00
|
|
|
|
#pragma warning disable SYSLIB1054
|
|
|
|
|
|
|
|
|
|
using System.Drawing;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2024-03-11 21:09:45 +01:00
|
|
|
|
using System.Text;
|
2023-07-15 14:29:14 +02:00
|
|
|
|
|
|
|
|
|
namespace ImHex
|
|
|
|
|
{
|
2024-03-12 23:17:49 +01:00
|
|
|
|
public partial class Bookmarks
|
2023-07-15 14:29:14 +02:00
|
|
|
|
{
|
2024-03-12 23:17:49 +01:00
|
|
|
|
[LibraryImport("ImHex")]
|
|
|
|
|
private static partial void createBookmarkV1(UInt64 address, UInt64 size, UInt32 color, byte[] name, byte[] description);
|
2023-07-15 14:29:14 +02:00
|
|
|
|
|
|
|
|
|
public static void CreateBookmark(long address, long size, Color color, string name = "", string description = "")
|
|
|
|
|
{
|
2024-03-11 21:09:45 +01:00
|
|
|
|
createBookmarkV1((UInt64)address, (UInt64)size, (UInt32)(0xA0 << 24 | color.B << 16 | color.G << 8 | color.R), Encoding.UTF8.GetBytes(name), Encoding.UTF8.GetBytes(description));
|
2023-07-15 14:29:14 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|