mirror of https://github.com/WerWolv/ImHex
Compare commits
1372 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
5500faa57e | |
|
|
89004574d3 | |
|
|
c11c05a399 | |
|
|
baa3329e7f | |
|
|
e696d384c2 | |
|
|
932c281223 | |
|
|
858fe0384e | |
|
|
e904cd749f | |
|
|
6b16f39be4 | |
|
|
021c7e5fdb | |
|
|
c161a5c71b | |
|
|
76ccdbccea | |
|
|
553ee89787 | |
|
|
cb6247b16e | |
|
|
cfac7ff0ba | |
|
|
49bbe7dc77 | |
|
|
07b6fa0e2e | |
|
|
67396f2009 | |
|
|
a20ff87cc9 | |
|
|
e02e57a729 | |
|
|
225dc53795 | |
|
|
e7404376db | |
|
|
d6aec341fe | |
|
|
3a3c2fb204 | |
|
|
e9b5cdbccf | |
|
|
3f30e63d95 | |
|
|
f9c6866c7b | |
|
|
388dccfd9f | |
|
|
1676342e28 | |
|
|
62732de227 | |
|
|
63e777c84c | |
|
|
ab95cdf3e5 | |
|
|
827b5b01dd | |
|
|
bfa9788099 | |
|
|
de25ce7fbb | |
|
|
21e61bfce6 | |
|
|
82e168c438 | |
|
|
48583a2b6e | |
|
|
0db0982fa7 | |
|
|
6a28ce9e4b | |
|
|
1db79f6117 | |
|
|
f234103320 | |
|
|
45c382a19a | |
|
|
fb7ef61d06 | |
|
|
2586645d02 | |
|
|
e23cb5509d | |
|
|
5cbd53ae7a | |
|
|
a4ee590875 | |
|
|
495608ed7c | |
|
|
4d10d9a195 | |
|
|
4914a34dd9 | |
|
|
ab0fb3131d | |
|
|
7922d3b3cb | |
|
|
6427f53b5a | |
|
|
994df0a3a4 | |
|
|
e6eee55810 | |
|
|
855e4c4913 | |
|
|
c2e07bf7b2 | |
|
|
77b9e3eac8 | |
|
|
790487eea6 | |
|
|
eb83354179 | |
|
|
9ba8754f97 | |
|
|
84346119b3 | |
|
|
2b3abd06db | |
|
|
8267aad79e | |
|
|
3f9ce561b9 | |
|
|
347fc3ed9f | |
|
|
0488c996e9 | |
|
|
37bfd97d93 | |
|
|
c8652b0576 | |
|
|
1208d2eb5e | |
|
|
ab34fed0c5 | |
|
|
0906e5f9cf | |
|
|
47b1c603b3 | |
|
|
4bda321e7a | |
|
|
691ff11fbc | |
|
|
83650c908d | |
|
|
afa297bb53 | |
|
|
00986d0ea8 | |
|
|
633914316a | |
|
|
205bb81a0a | |
|
|
60a69e3a54 | |
|
|
5c629494da | |
|
|
95f010395c | |
|
|
d575d0f724 | |
|
|
bdbdb46005 | |
|
|
efc28a3177 | |
|
|
5d50653495 | |
|
|
24c55beb9c | |
|
|
04547ad6af | |
|
|
d2951d06b2 | |
|
|
926910bf6e | |
|
|
6652750044 | |
|
|
ab3853eb9d | |
|
|
4f4af83699 | |
|
|
df3200f936 | |
|
|
7374a06faa | |
|
|
22b13f5ba6 | |
|
|
031301e1bb | |
|
|
3ad508c6fc | |
|
|
c3421aef8c | |
|
|
f2e8d402dd | |
|
|
ab54acb176 | |
|
|
7585e191d0 | |
|
|
a4f6795a44 | |
|
|
3529bce009 | |
|
|
bc3afbb271 | |
|
|
a0d0621725 | |
|
|
c2d70dbd50 | |
|
|
e2fdd91956 | |
|
|
2a84534ced | |
|
|
94b53592d9 | |
|
|
09006588fc | |
|
|
9d5cdaeb33 | |
|
|
d4df465633 | |
|
|
da0c1674a6 | |
|
|
18aa11117a | |
|
|
ed32439645 | |
|
|
5c890e710e | |
|
|
d15b7862b8 | |
|
|
0e5136196a | |
|
|
46fdbd5bc0 | |
|
|
da755ec75b | |
|
|
d610f787b9 | |
|
|
1ab1f7ada0 | |
|
|
56cb1f2747 | |
|
|
413c6b5116 | |
|
|
f4753a5bd8 | |
|
|
980438008c | |
|
|
8f57dd86af | |
|
|
a2ce89af32 | |
|
|
67008288e2 | |
|
|
4caa0ce570 | |
|
|
4e2dcef7d7 | |
|
|
f47a248768 | |
|
|
862462c5bb | |
|
|
375471160f | |
|
|
4000e7c886 | |
|
|
48095671c3 | |
|
|
c96b47f345 | |
|
|
b250172bb5 | |
|
|
257b248f34 | |
|
|
a8fe63ee93 | |
|
|
d359a21a66 | |
|
|
e5cdf22753 | |
|
|
c33d53b728 | |
|
|
e5829a316b | |
|
|
569bf474bd | |
|
|
06ecd5d571 | |
|
|
9ae233a41c | |
|
|
989f7f7678 | |
|
|
a75947e611 | |
|
|
1d4233514f | |
|
|
fa780e9706 | |
|
|
cba93e87eb | |
|
|
f3a2fe5b0d | |
|
|
ebee8ff0a6 | |
|
|
34971162cb | |
|
|
58eec483c9 | |
|
|
c57f071f0c | |
|
|
b30e2bcfa4 | |
|
|
b56c3c5a46 | |
|
|
120c4202b4 | |
|
|
1f257290ab | |
|
|
4d585d17de | |
|
|
2c7da65242 | |
|
|
95ff52b025 | |
|
|
b1e2185966 | |
|
|
5d77402211 | |
|
|
f762cc2906 | |
|
|
7ca2e558c9 | |
|
|
e388d0c5e8 | |
|
|
05f8d9302d | |
|
|
8f277f00a4 | |
|
|
59f9da59e2 | |
|
|
8d4415fe15 | |
|
|
fd54b2b803 | |
|
|
ba6953fda4 | |
|
|
c0f667ce20 | |
|
|
c93c15563a | |
|
|
d0340c13dc | |
|
|
c6caa1d067 | |
|
|
2f0efa1197 | |
|
|
a76eae2c11 | |
|
|
b82c1f051c | |
|
|
1b6a150624 | |
|
|
265360229f | |
|
|
98e9729267 | |
|
|
cfe16ee2c5 | |
|
|
c9f856b219 | |
|
|
3c167c3306 | |
|
|
fedbce6f9e | |
|
|
28be4cea97 | |
|
|
05fb2bfd23 | |
|
|
3905335c53 | |
|
|
4dc3f9e033 | |
|
|
07a6a9b7d4 | |
|
|
fac7dff77f | |
|
|
60c7ced335 | |
|
|
8f981e7707 | |
|
|
725cc10a92 | |
|
|
d3896ccfda | |
|
|
de3e532a5c | |
|
|
98369600c3 | |
|
|
d9aaef29d2 | |
|
|
48f4410a2a | |
|
|
ca0b232ada | |
|
|
75efe39298 | |
|
|
84342f7a7b | |
|
|
67efea6444 | |
|
|
f08b182bf2 | |
|
|
3c83a62aef | |
|
|
821db4d2a1 | |
|
|
3c661842a2 | |
|
|
920578003e | |
|
|
22aadcc1ae | |
|
|
efc65479c6 | |
|
|
dcbba9cbfc | |
|
|
6169078c04 | |
|
|
955f48f532 | |
|
|
d7a830ca95 | |
|
|
96b27645d6 | |
|
|
8b6346ae41 | |
|
|
c1619820c7 | |
|
|
88ccb0e075 | |
|
|
12564dd78f | |
|
|
b0c4db7a64 | |
|
|
310ca6c6dc | |
|
|
32e3a4e74f | |
|
|
be66e3fe79 | |
|
|
d794734f1d | |
|
|
8661b6551d | |
|
|
a0326c4371 | |
|
|
b039bc14c6 | |
|
|
d08853df8c | |
|
|
d8dd287cdf | |
|
|
d62b64c27a | |
|
|
52952652de | |
|
|
790c19a1cd | |
|
|
9659381378 | |
|
|
4598fc098d | |
|
|
2f6fde1e61 | |
|
|
16dc199431 | |
|
|
715e970d99 | |
|
|
53535ab9be | |
|
|
24f9df90b8 | |
|
|
4cfdbb8095 | |
|
|
fe4cb8575f | |
|
|
06ac7eb85f | |
|
|
0e14ff5a3d | |
|
|
c65015fcc7 | |
|
|
c8caf6124e | |
|
|
76bb0e420d | |
|
|
d2c1b2a31b | |
|
|
e30f073809 | |
|
|
e1079d751a | |
|
|
a9d45d837f | |
|
|
bcbe5eb105 | |
|
|
6ab1f8e4e2 | |
|
|
90f26d53d3 | |
|
|
281921d1de | |
|
|
9135153dc9 | |
|
|
c70b505b3a | |
|
|
cde9dc37e5 | |
|
|
ab1e5eb359 | |
|
|
aec9f7a145 | |
|
|
bf08ed563a | |
|
|
ff70518882 | |
|
|
72364db768 | |
|
|
92fa72eac7 | |
|
|
9e2c1de0f5 | |
|
|
57ac73b9d4 | |
|
|
2757c577e4 | |
|
|
704af30421 | |
|
|
1e8a005d0e | |
|
|
8a04d2f477 | |
|
|
a7c37bfb93 | |
|
|
d1801ea438 | |
|
|
f6f856cd56 | |
|
|
8515cd43fa | |
|
|
8a4cdbb371 | |
|
|
7fef133505 | |
|
|
5f206a33e2 | |
|
|
228385ceaa | |
|
|
bd9e9a7dcf | |
|
|
abffb8c138 | |
|
|
e353802e9f | |
|
|
130055af22 | |
|
|
db573840b0 | |
|
|
e0fccacc32 | |
|
|
18890f47b6 | |
|
|
204cc1ccb3 | |
|
|
a063eb96c6 | |
|
|
145c8ff804 | |
|
|
f0d2f94aef | |
|
|
0c12cb683a | |
|
|
56b5d026df | |
|
|
40ccbd0d86 | |
|
|
c1a14cb4d4 | |
|
|
df2448e121 | |
|
|
ca323c392b | |
|
|
395dd37d33 | |
|
|
e91689a715 | |
|
|
861988f8dc | |
|
|
f26f1298cf | |
|
|
66efcf91d3 | |
|
|
0178ba014a | |
|
|
254bd88e6b | |
|
|
3808b78487 | |
|
|
a80c35aa94 | |
|
|
d0f51d0462 | |
|
|
013fa85c1c | |
|
|
fcda856198 | |
|
|
e385487a6b | |
|
|
f8fa029ee3 | |
|
|
d1a0f8ec97 | |
|
|
d02e147dc3 | |
|
|
5c481d4247 | |
|
|
f4cbdde8f6 | |
|
|
0ac09fc57b | |
|
|
99c28c93b4 | |
|
|
0e800723f5 | |
|
|
fc2ed47676 | |
|
|
5c2309bcf7 | |
|
|
ba71a300ec | |
|
|
393451eed5 | |
|
|
b0b20bcb9b | |
|
|
8e8c553da4 | |
|
|
c83173098c | |
|
|
16c52f4008 | |
|
|
d207d98a82 | |
|
|
5a1f3d40a7 | |
|
|
a667a1b6a9 | |
|
|
cfe3c5b6df | |
|
|
b49e2eeac4 | |
|
|
d012ad08f8 | |
|
|
b83f3d6cbf | |
|
|
a8be74ebb7 | |
|
|
b5bf9f1486 | |
|
|
b3d07b4573 | |
|
|
b602fcc485 | |
|
|
0908d040fa | |
|
|
530bd6dac4 | |
|
|
441dcea705 | |
|
|
c5e0951def | |
|
|
4bea8f4c65 | |
|
|
7f5ae41d8a | |
|
|
35a357f1a8 | |
|
|
8b384ef1f9 | |
|
|
7588a84e86 | |
|
|
d8f8e61a11 | |
|
|
3c9aa97f6c | |
|
|
6c28adbd24 | |
|
|
cf5b9da45e | |
|
|
01f24d2f2f | |
|
|
592eea1bfd | |
|
|
16a4a67886 | |
|
|
dd3b6a47d2 | |
|
|
fa8102f93d | |
|
|
ef3678bfaf | |
|
|
599b339e5d | |
|
|
682aae1497 | |
|
|
4ade751caf | |
|
|
9f24b35b1f | |
|
|
769087d139 | |
|
|
3b1f32d68d | |
|
|
4fc1f0491e | |
|
|
89b94ebbf9 | |
|
|
5666baf2bc | |
|
|
9d05f487e6 | |
|
|
8b72ea81c0 | |
|
|
23085372a1 | |
|
|
1761033cee | |
|
|
48af5eb10a | |
|
|
d2233af8a0 | |
|
|
a411d489c1 | |
|
|
3b48f537f1 | |
|
|
7755e95db0 | |
|
|
ac66f80a0d | |
|
|
13111e2940 | |
|
|
d0af46b175 | |
|
|
18e6a5d6d2 | |
|
|
1f1d127822 | |
|
|
8a0639ced2 | |
|
|
762eacb7c8 | |
|
|
0ebe4150ae | |
|
|
e8f799d010 | |
|
|
926cddd69f | |
|
|
ec2a01dfae | |
|
|
f921742dcc | |
|
|
ce0c97e6d5 | |
|
|
1c54e7e38b | |
|
|
9928439f4f | |
|
|
3ed7834945 | |
|
|
5853cb5ad5 | |
|
|
1b476e235b | |
|
|
ef8f5c67bd | |
|
|
0664937c1e | |
|
|
aada2c1fe6 | |
|
|
870bce2bf8 | |
|
|
908d879a1e | |
|
|
5147d8ab63 | |
|
|
8a1531fc71 | |
|
|
09918041f8 | |
|
|
165d00dad3 | |
|
|
fa99069951 | |
|
|
babd9584a6 | |
|
|
20df023137 | |
|
|
fbde2942de | |
|
|
d920718b44 | |
|
|
4ca429e389 | |
|
|
49c56e28b4 | |
|
|
3ec4f086ec | |
|
|
3cb5dd226c | |
|
|
6a1aa2c13e | |
|
|
4b73e1a184 | |
|
|
5fa9aaa6a6 | |
|
|
63711f652f | |
|
|
d07b4417d7 | |
|
|
95ae5a26ed | |
|
|
d8ad23630a | |
|
|
c03d9301e2 | |
|
|
6ec6851a8a | |
|
|
a7d3a916cc | |
|
|
e1d1c4acca | |
|
|
bd17e0edc1 | |
|
|
6e88d08c17 | |
|
|
278babe7f2 | |
|
|
b23f33ab6c | |
|
|
50b25882cd | |
|
|
28bfceab6c | |
|
|
6febe9982b | |
|
|
b5a3a8b4c2 | |
|
|
25c8f4b588 | |
|
|
09b2e20a3d | |
|
|
e9d95c78f6 | |
|
|
ad2a36676c | |
|
|
43da36a957 | |
|
|
71e9f7b239 | |
|
|
b566d31f28 | |
|
|
c4d167f8d4 | |
|
|
50f1fe2b2d | |
|
|
75e73ddcd9 | |
|
|
3616c3ad7b | |
|
|
23d673f920 | |
|
|
8c9f3fa569 | |
|
|
80003a4843 | |
|
|
12785c00bd | |
|
|
8f94b46149 | |
|
|
73a59fe5c1 | |
|
|
5028b354cc | |
|
|
3e98d0a0f8 | |
|
|
902c8dcd8d | |
|
|
66e407549e | |
|
|
0870ab4d3c | |
|
|
6be0eeff72 | |
|
|
9246d040ad | |
|
|
549866bfd9 | |
|
|
d81f0668a1 | |
|
|
6b4fef806c | |
|
|
4e5b2675a0 | |
|
|
f3d9f224b7 | |
|
|
ae8a12fa27 | |
|
|
de7d549fc6 | |
|
|
d925c8216d | |
|
|
e6f46747b6 | |
|
|
c30830a8ff | |
|
|
45b08b6010 | |
|
|
c88fc43032 | |
|
|
08a08c2b3a | |
|
|
411e971ba7 | |
|
|
dbc5819bc4 | |
|
|
93a71120d4 | |
|
|
d683c04519 | |
|
|
a403980976 | |
|
|
5c3dfa08b2 | |
|
|
fd2d50508b | |
|
|
14ee688629 | |
|
|
9e4557d90d | |
|
|
d9810982ad | |
|
|
282d950423 | |
|
|
cd5b16cce5 | |
|
|
cc1ac95af6 | |
|
|
b14fa24836 | |
|
|
59c6d3090b | |
|
|
1e809214b2 | |
|
|
56ec07e316 | |
|
|
ce66f3a98a | |
|
|
5d180bdbfb | |
|
|
d922dbe04c | |
|
|
1fc6ec28c2 | |
|
|
ec6ff1d7d5 | |
|
|
ad87f005fe | |
|
|
df1e97af0a | |
|
|
82ceb2e11f | |
|
|
9698232f69 | |
|
|
b1867aac92 | |
|
|
09bc5b92f6 | |
|
|
725462b222 | |
|
|
a9faba5cec | |
|
|
5a318da8ca | |
|
|
5bc8366749 | |
|
|
6200036014 | |
|
|
38b891bd62 | |
|
|
a22c606e42 | |
|
|
dc0473e48d | |
|
|
71f5373ea8 | |
|
|
bd4ce72800 | |
|
|
d39d33de32 | |
|
|
7c07f70afd | |
|
|
de67d5942b | |
|
|
f358069cc1 | |
|
|
cf87294a8c | |
|
|
40b48f6460 | |
|
|
31322bcc76 | |
|
|
abe13d9ff9 | |
|
|
064b21a264 | |
|
|
5be6297bac | |
|
|
dda32ef0f9 | |
|
|
9cff9043ee | |
|
|
d429424f67 | |
|
|
750f91dbbc | |
|
|
c0ee243d64 | |
|
|
e05825b9f4 | |
|
|
018c61890c | |
|
|
263c5f6830 | |
|
|
a27b10f69a | |
|
|
3cf7622707 | |
|
|
327195573e | |
|
|
baebfe96ba | |
|
|
5b06702dee | |
|
|
95465e2fc3 | |
|
|
388f5354a1 | |
|
|
c3cd4edbf9 | |
|
|
b9c36cfd2f | |
|
|
b3deeb29b3 | |
|
|
136cabedb4 | |
|
|
9fc9eb1425 | |
|
|
71a39ff2fd | |
|
|
3d01b78ba0 | |
|
|
452e7d7c5f | |
|
|
1a8e09d549 | |
|
|
ea072296cf | |
|
|
56d1e2670e | |
|
|
bc953592f0 | |
|
|
b2f188fa4b | |
|
|
7575f85bdf | |
|
|
685a2e3cf2 | |
|
|
2db85ced59 | |
|
|
693a0f2516 | |
|
|
b81328ac1a | |
|
|
2440acda07 | |
|
|
29354f0bcb | |
|
|
a9eb7b2d25 | |
|
|
05a06fe7a3 | |
|
|
f73866b86e | |
|
|
1e18abc598 | |
|
|
a2c4aefced | |
|
|
bb6ea5f1e5 | |
|
|
0e855e10db | |
|
|
1594c712a8 | |
|
|
7b6d5d2686 | |
|
|
44f12587f3 | |
|
|
fd8bdbdc90 | |
|
|
9557041c3a | |
|
|
1804caba02 | |
|
|
c1f0d60f49 | |
|
|
83d92dde35 | |
|
|
ac98e4e0b5 | |
|
|
5c99974202 | |
|
|
280dea23d0 | |
|
|
6fcc3e8cb3 | |
|
|
ec9461741c | |
|
|
896e05331c | |
|
|
4c930b190e | |
|
|
6ab3353a15 | |
|
|
a31760eecb | |
|
|
4c89a79dc3 | |
|
|
2c3d8d4c0b | |
|
|
e71e026da0 | |
|
|
f239b0c6d7 | |
|
|
8a7f232198 | |
|
|
a3c71b3955 | |
|
|
46b13b6606 | |
|
|
a40c420b70 | |
|
|
8470334d6d | |
|
|
f42ae97f14 | |
|
|
c7b2f26bd5 | |
|
|
ec424ac16e | |
|
|
72501edc9a | |
|
|
9554889964 | |
|
|
7ff1e72093 | |
|
|
3d3674d405 | |
|
|
d08152a824 | |
|
|
12087b51cb | |
|
|
66ec1de625 | |
|
|
7f09d61eb8 | |
|
|
f5c24cee67 | |
|
|
2abedbe4ad | |
|
|
80eb72c5f9 | |
|
|
88da6c10e0 | |
|
|
49771766e7 | |
|
|
9b20092428 | |
|
|
e3551b3045 | |
|
|
68d7e99a80 | |
|
|
a8d61ed534 | |
|
|
a67788ac52 | |
|
|
bc644e324a | |
|
|
8782be593d | |
|
|
2998cc0fd7 | |
|
|
e85216d9a6 | |
|
|
e22923a980 | |
|
|
be6a90675b | |
|
|
94527345b9 | |
|
|
c1545b57c9 | |
|
|
8f3d07ea69 | |
|
|
68804a357d | |
|
|
78a449d6d3 | |
|
|
366c631e26 | |
|
|
da8be3ec3c | |
|
|
820b833bbc | |
|
|
574c039cc8 | |
|
|
e0180b718f | |
|
|
ca82fafac5 | |
|
|
a9ce71c481 | |
|
|
2e200a2ab8 | |
|
|
0e720a1e02 | |
|
|
601b13cf42 | |
|
|
f6860015eb | |
|
|
99a9752ee9 | |
|
|
518ada6dae | |
|
|
3c1c9c13d8 | |
|
|
baa4e82b92 | |
|
|
116f5a57eb | |
|
|
4c8c383378 | |
|
|
e5e867db22 | |
|
|
2b72d08e39 | |
|
|
32adb99f3d | |
|
|
799175c94e | |
|
|
e79116499e | |
|
|
e1a91d179a | |
|
|
e0910cd2f4 | |
|
|
295c751b60 | |
|
|
851f7b4b8c | |
|
|
9b3a157b41 | |
|
|
8f2638be30 | |
|
|
0634b41092 | |
|
|
2ce5acb8d3 | |
|
|
48980a1e0c | |
|
|
b68d0704e7 | |
|
|
af7eaae399 | |
|
|
a3eb057215 | |
|
|
59695dcad6 | |
|
|
aa6e461340 | |
|
|
737d71ee13 | |
|
|
2b7fe26bf1 | |
|
|
8593bf5f55 | |
|
|
7bfc3f44c9 | |
|
|
b9f79833b6 | |
|
|
9bed8f792a | |
|
|
e18d583a00 | |
|
|
244f7b55ee | |
|
|
ee6d72562b | |
|
|
90c2667028 | |
|
|
9c6926a1fb | |
|
|
22c9d77909 | |
|
|
55b3b3a188 | |
|
|
c93e5ba183 | |
|
|
5df8ec78aa | |
|
|
cc6590d780 | |
|
|
9ce18d1a42 | |
|
|
9ff8d42143 | |
|
|
1ff838daa7 | |
|
|
17ab429a8c | |
|
|
5df50ef380 | |
|
|
8da007af6c | |
|
|
f053b94f68 | |
|
|
d02ea09529 | |
|
|
79333593bf | |
|
|
c635bca43d | |
|
|
de62a4c71e | |
|
|
24732b304b | |
|
|
5744ad588f | |
|
|
5ea021d57a | |
|
|
38c5868029 | |
|
|
4725bf7271 | |
|
|
de9efe6c4d | |
|
|
88ce3a2490 | |
|
|
2c47e1a135 | |
|
|
7454221b3b | |
|
|
fcc4709ed9 | |
|
|
aeb77559a7 | |
|
|
9acaf33410 | |
|
|
e13b679650 | |
|
|
4146047cdb | |
|
|
18e02fbf5c | |
|
|
b94519362c | |
|
|
1e59a82c59 | |
|
|
d570ab04b8 | |
|
|
830be0b0d3 | |
|
|
1570f379df | |
|
|
e7714df79f | |
|
|
bdc108d021 | |
|
|
a89fb542b0 | |
|
|
26de4c11e1 | |
|
|
01d0f03fdd | |
|
|
58d0d09eae | |
|
|
e7a2729d36 | |
|
|
5782236379 | |
|
|
88de5f6be4 | |
|
|
4520637aed | |
|
|
aa8235c279 | |
|
|
2432462ff3 | |
|
|
8c59684c14 | |
|
|
82c318f91d | |
|
|
3c16adf169 | |
|
|
2ab54baa2c | |
|
|
da2aa85a8a | |
|
|
e58ce527c6 | |
|
|
d1840a2184 | |
|
|
fa62a675dc | |
|
|
1aa52c634f | |
|
|
cfc364e4f1 | |
|
|
f2b6af8bdc | |
|
|
c71411a527 | |
|
|
42256a5c2f | |
|
|
f589d898ac | |
|
|
af70234519 | |
|
|
df58afe1a1 | |
|
|
6c8d87520c | |
|
|
9d0ea9f6c0 | |
|
|
053f7655c3 | |
|
|
288f8ee42f | |
|
|
2a8dd0873b | |
|
|
bd8b3f8a29 | |
|
|
57c89b4481 | |
|
|
a4ced46628 | |
|
|
0d2ea2f8c0 | |
|
|
4245cd2ad9 | |
|
|
6f42c4b3b3 | |
|
|
4c20ceb94e | |
|
|
df3b85765d | |
|
|
2b352c6d7a | |
|
|
92832d7e14 | |
|
|
10957dbbb9 | |
|
|
88eecf6624 | |
|
|
755a53f821 | |
|
|
ea4d71b26c | |
|
|
a4c0d38c53 | |
|
|
58228e0af4 | |
|
|
1d69d8fb6a | |
|
|
3445d09390 | |
|
|
78b3d3d001 | |
|
|
d8f0120698 | |
|
|
3e25bceb0c | |
|
|
1ca40481bb | |
|
|
fe1309fb3d | |
|
|
12d59ce3e4 | |
|
|
224fa83c65 | |
|
|
f591ac8780 | |
|
|
11e70511e6 | |
|
|
c1e4121d1e | |
|
|
03884ddd05 | |
|
|
ac67e985af | |
|
|
9d12cd64d3 | |
|
|
702b5f2888 | |
|
|
a5eef3f34d | |
|
|
1bc9277e3c | |
|
|
b33cb07dc0 | |
|
|
ce74915c14 | |
|
|
f341413248 | |
|
|
ed3e2f65f8 | |
|
|
6e5878b5d6 | |
|
|
39242097dd | |
|
|
0aec3fffe1 | |
|
|
38ef00548a | |
|
|
c78c8072e9 | |
|
|
7c98411abe | |
|
|
e22516662f | |
|
|
24c1f48522 | |
|
|
69b07d40e4 | |
|
|
b96692b1ba | |
|
|
53afb7cba0 | |
|
|
8e0953af1e | |
|
|
724f9aa524 | |
|
|
7067ffafe7 | |
|
|
145c88db31 | |
|
|
56615d6c06 | |
|
|
d26bcc1abe | |
|
|
04f817c042 | |
|
|
b58f97c1f1 | |
|
|
96dc386694 | |
|
|
c6c70daa5e | |
|
|
de16375903 | |
|
|
c6548d5ad1 | |
|
|
bd8c4e807c | |
|
|
553549302c | |
|
|
c69a7012c5 | |
|
|
7acc5fc02e | |
|
|
39bc165f36 | |
|
|
707a92281b | |
|
|
823013a3d9 | |
|
|
7089561b21 | |
|
|
0f0bff1685 | |
|
|
b6387c3f64 | |
|
|
ff0bcfb7da | |
|
|
f729d36214 | |
|
|
d5a07b6a5b | |
|
|
bda0b3ce18 | |
|
|
14d95a7e46 | |
|
|
2ef2cdd874 | |
|
|
57c2d84122 | |
|
|
d263962a06 | |
|
|
e32c5784af | |
|
|
1496a6e755 | |
|
|
6dab1063a1 | |
|
|
ff286f3e05 | |
|
|
6f112c2d16 | |
|
|
8f222dab99 | |
|
|
828951ffe9 | |
|
|
616f34e210 | |
|
|
fa3ed7e618 | |
|
|
a207969dec | |
|
|
7fde40b04e | |
|
|
1bce588cdd | |
|
|
5a095cc993 | |
|
|
431eab47a2 | |
|
|
e9e3d25315 | |
|
|
e2735e283e | |
|
|
3e9cb57dd6 | |
|
|
5c4cf7379f | |
|
|
8cd961596e | |
|
|
d2344418d6 | |
|
|
33aa2248d2 | |
|
|
feb5b209ed | |
|
|
34722404f4 | |
|
|
b78a234fe1 | |
|
|
f19478374f | |
|
|
51a01c860b | |
|
|
eedd044716 | |
|
|
0a327f4ad3 | |
|
|
eec6a5da0a | |
|
|
fc87bc0cf1 | |
|
|
1f213408a1 | |
|
|
bac6fd803f | |
|
|
5a74d7e3e2 | |
|
|
e289380c39 | |
|
|
8081dff6b6 | |
|
|
7dcf09118b | |
|
|
4b9a3d121d | |
|
|
cd24cba240 | |
|
|
d33fad9d23 | |
|
|
b02aa51e09 | |
|
|
36eeee5f9c | |
|
|
4883ed0e5a | |
|
|
78ad0d2592 | |
|
|
f6def74b29 | |
|
|
be44676b01 | |
|
|
60c1c22a73 | |
|
|
02cadc264e | |
|
|
a0ca5b8072 | |
|
|
31fdb73b0e | |
|
|
d2caa1859d | |
|
|
f6c25b30ae | |
|
|
379d826f18 | |
|
|
96afccc46c | |
|
|
c0a222644b | |
|
|
653173945f | |
|
|
7d09cc6d25 | |
|
|
a4360dfe76 | |
|
|
9887117e7a | |
|
|
9be7eafa39 | |
|
|
774eb18a42 | |
|
|
4e582d02f5 | |
|
|
38d11dacb7 | |
|
|
e17490ee04 | |
|
|
f3a9ca6d6f | |
|
|
2653740a36 | |
|
|
335042ec08 | |
|
|
f6944b15f3 | |
|
|
d7960dccb4 | |
|
|
c974c4257d | |
|
|
40d74dd633 | |
|
|
602c85b57d | |
|
|
f96fa596b3 | |
|
|
8c13d0096e | |
|
|
7879f8b6a4 | |
|
|
4c0e8bc1d6 | |
|
|
6644df3958 | |
|
|
2b5551d719 | |
|
|
137063dd21 | |
|
|
ca403869ab | |
|
|
daf676b277 | |
|
|
66bbdbe6ec | |
|
|
d3c2516f5f | |
|
|
c39ae84922 | |
|
|
a83843fdab | |
|
|
2d48da1c4a | |
|
|
af0c15f69d | |
|
|
7898df9c2c | |
|
|
48abdeaf6b | |
|
|
99a4979b65 | |
|
|
d8beff4f6b | |
|
|
ccaf1e33c0 | |
|
|
3f119b957e | |
|
|
abf97212fe | |
|
|
b81c3d2f75 | |
|
|
5651c4d95c | |
|
|
c83a5cc1b7 | |
|
|
0499807597 | |
|
|
f846afd8a9 | |
|
|
b822c82d18 | |
|
|
e4de551008 | |
|
|
5333d0180f | |
|
|
658d4c4d72 | |
|
|
efa50a8c39 | |
|
|
677dc6192d | |
|
|
1ed56c1b1d | |
|
|
983be04722 | |
|
|
1bd9c918f6 | |
|
|
0ba16485bb | |
|
|
1d9934830b | |
|
|
806d6148eb | |
|
|
e484587778 | |
|
|
1e4b5104b7 | |
|
|
676d2e2ef5 | |
|
|
6122d44bd9 | |
|
|
eb9f0cdf0c | |
|
|
01f4595aab | |
|
|
bf10d333cd | |
|
|
267ef37cb6 | |
|
|
879e4c9d58 | |
|
|
67340e1526 | |
|
|
6ec8f9efe5 | |
|
|
c2b0560d91 | |
|
|
388071557e | |
|
|
f6e3ede178 | |
|
|
a907550567 | |
|
|
c75a15dc3b | |
|
|
83904aa1f1 | |
|
|
7d527fd2a6 | |
|
|
007e04bf37 | |
|
|
caff49504e | |
|
|
aad38beaf5 | |
|
|
bdad733331 | |
|
|
bc26ade57e | |
|
|
ee52ff3b11 | |
|
|
40b95f02e4 | |
|
|
8777a85630 | |
|
|
870aeb34fc | |
|
|
b03be212b3 | |
|
|
c8f7dbf85e | |
|
|
9e826b4c8b | |
|
|
05d528b39a | |
|
|
6828c7c077 | |
|
|
54f3bc0262 | |
|
|
e232a2b33d | |
|
|
73a3b217a4 | |
|
|
19f925c60b | |
|
|
5fb488236b | |
|
|
c84786f9ee | |
|
|
c1925ddf8d | |
|
|
cf194e332c | |
|
|
d8877e7d8b | |
|
|
8b2184f8e3 | |
|
|
a42e4c5299 | |
|
|
419787e17c | |
|
|
2d6da52a86 | |
|
|
b46deb3fa0 | |
|
|
b70120a248 | |
|
|
3a6a4011d0 | |
|
|
999c4d07b7 | |
|
|
44b182c6ae | |
|
|
de7bec547a | |
|
|
5542c0bc00 | |
|
|
83e0ce0042 | |
|
|
4685dea075 | |
|
|
599f63bc67 | |
|
|
199f2aea77 | |
|
|
bff9b8b4b1 | |
|
|
a83610bc06 | |
|
|
b3d208e6e6 | |
|
|
e8b391c0f6 | |
|
|
02b5df03ab | |
|
|
e1580e51cf | |
|
|
3a7578879f | |
|
|
ea3d4b41a9 | |
|
|
e0c2a39ce7 | |
|
|
1fa27b7f09 | |
|
|
f980f1dae2 | |
|
|
b81ad53449 | |
|
|
a9727171e2 | |
|
|
a1634fb337 | |
|
|
94a2f9460e | |
|
|
18cd39270a | |
|
|
72c2bca363 | |
|
|
4c153dc76d | |
|
|
e63606f6bb | |
|
|
ed6da7fe14 | |
|
|
a588c96440 | |
|
|
4c284b224e | |
|
|
96afa650d1 | |
|
|
f17d0d3ae1 | |
|
|
930d2b4280 | |
|
|
f67b78bd91 | |
|
|
540e8ed602 | |
|
|
99cb51e813 | |
|
|
db000c4b12 | |
|
|
0cd557a686 | |
|
|
6142bf859b | |
|
|
b6498b5c2d | |
|
|
c15030e96e | |
|
|
cd2acd73b4 | |
|
|
cfe06ea1b6 | |
|
|
ca5c3e0e94 | |
|
|
6252fd399a | |
|
|
de571e2c2a | |
|
|
0cbd052b91 | |
|
|
aa3ec3ece8 | |
|
|
6b11028b72 | |
|
|
269c3e7398 | |
|
|
08335041f5 | |
|
|
d75b9cf942 | |
|
|
b55c40523f | |
|
|
99a2dee7a2 | |
|
|
c94265c77b | |
|
|
7ddfba1b4c | |
|
|
9ecdd28eea | |
|
|
d8b36242f6 | |
|
|
3f470aabe9 | |
|
|
1e8dd54b3e | |
|
|
0a6681ccb7 | |
|
|
0140e24822 | |
|
|
9fb38922ea | |
|
|
7752354598 | |
|
|
497670c4c3 | |
|
|
84954cd2f1 | |
|
|
8b6eab401e | |
|
|
71c11a5923 | |
|
|
f345edb252 | |
|
|
be40fd9563 | |
|
|
5ee2ebfb4f | |
|
|
cfa6b706a8 | |
|
|
42f2a62d62 | |
|
|
41b6ef930a | |
|
|
948cbe0a9c | |
|
|
18669f3230 | |
|
|
4e9f944204 | |
|
|
fe18cbaa41 | |
|
|
ed3712e1b9 | |
|
|
20dc4f31f0 | |
|
|
19f9296a40 | |
|
|
06c019387c | |
|
|
645b43e9cc | |
|
|
ed37a3711f | |
|
|
a3460de9dc | |
|
|
5084009d62 | |
|
|
e5c003d726 | |
|
|
327a02b87d | |
|
|
e9bf1a9f7a | |
|
|
0c6fa768ea | |
|
|
483468a6c7 | |
|
|
8039ae1b90 | |
|
|
466b372d41 | |
|
|
3f6b5203ca | |
|
|
8d1352ddff | |
|
|
e6ab2c3b7e | |
|
|
e603c75bd3 | |
|
|
4f28f97141 | |
|
|
d0b32e5224 | |
|
|
2062a23347 | |
|
|
8c9236a066 | |
|
|
2f981ef91e | |
|
|
6725c170ea | |
|
|
c8cf6e7c08 | |
|
|
e0b4acee12 | |
|
|
803ebe34ed | |
|
|
e981eff1e6 | |
|
|
aee7a09b6c | |
|
|
e74e4e92a0 | |
|
|
6dba15defd | |
|
|
fee7a16692 | |
|
|
141030344b | |
|
|
4fa9586206 | |
|
|
fbbc430b7c | |
|
|
bfc68c4d28 | |
|
|
53fc018ada | |
|
|
d45dd45720 | |
|
|
19a9786bbf | |
|
|
b8caf41423 | |
|
|
0b3866a56a | |
|
|
53a7577416 | |
|
|
f5515417d6 | |
|
|
24e7c2f3db | |
|
|
6e6c5bbc67 | |
|
|
f4403ff480 | |
|
|
098da20761 | |
|
|
ef2373e8c0 | |
|
|
b2c8ed17d5 | |
|
|
bb594a459f | |
|
|
7340a30650 | |
|
|
403104dda1 | |
|
|
8334fbb236 | |
|
|
0a0323ce5d | |
|
|
726d36ba3d | |
|
|
8bb1521963 | |
|
|
9457c1f2b9 | |
|
|
2b24330f9f | |
|
|
9329170e59 | |
|
|
98f3de828a | |
|
|
3f38f42259 | |
|
|
058a8cdc15 | |
|
|
d0c1213ea0 | |
|
|
30967bac6d | |
|
|
09c9bcb046 | |
|
|
93f1f5d076 | |
|
|
93e5d62782 | |
|
|
4d7021ece1 | |
|
|
f976988c75 | |
|
|
1eee31fdbb | |
|
|
048c483903 | |
|
|
b646ece14b | |
|
|
35e8acd69d | |
|
|
de4135d1ad | |
|
|
a44959ce1b | |
|
|
f4bad0053a | |
|
|
26af5987a5 | |
|
|
9cf3250751 | |
|
|
acc77205bb | |
|
|
a6b4f62d75 | |
|
|
69c5d553b5 | |
|
|
637cdd7084 | |
|
|
8978e193db | |
|
|
242b100aa3 | |
|
|
3a888d48df | |
|
|
721de39dbb | |
|
|
07e29f2030 | |
|
|
c117d9b3e5 | |
|
|
16eae89151 | |
|
|
95cb6d8ee6 | |
|
|
af27c09204 | |
|
|
5e3532267c | |
|
|
7c0331df65 | |
|
|
04ab87cd8e | |
|
|
91f5e84250 | |
|
|
b1edd95ebc | |
|
|
758738da5c | |
|
|
41c8be275b | |
|
|
117eb1e2a7 | |
|
|
3129d6e8fd | |
|
|
2ba7db184b | |
|
|
2cb0df4080 | |
|
|
3adc2c44e6 | |
|
|
6d3ff64894 | |
|
|
cf84ad6196 | |
|
|
6259190ad9 | |
|
|
181be1a58e | |
|
|
771e191f28 | |
|
|
d4d6893eb3 | |
|
|
9e75562662 | |
|
|
2b3168163b | |
|
|
252c06eb12 | |
|
|
2a51d8169a | |
|
|
7405c4b411 | |
|
|
309ae7b619 | |
|
|
64ef56a0df | |
|
|
fbfe7b0d25 | |
|
|
8c7e1a3b2d | |
|
|
bf249cdafe | |
|
|
59ba6f50cc | |
|
|
8d6e7c7d44 | |
|
|
52934ae166 | |
|
|
56c4f2aa47 | |
|
|
a1d8cbd7ba | |
|
|
63a219a32b | |
|
|
14fb256a6a | |
|
|
95df7a23c3 | |
|
|
bb17690cf5 | |
|
|
a943b02e43 | |
|
|
199f78347f | |
|
|
d3d9a42d57 | |
|
|
1fa45a8c84 | |
|
|
0b6316ea23 | |
|
|
466a843263 | |
|
|
b6ade8b101 | |
|
|
ff66b97e90 | |
|
|
c604ec8fb9 | |
|
|
7564651dd5 | |
|
|
cad17ddefd | |
|
|
25d2f209e5 | |
|
|
8d660c3ffe | |
|
|
209055d0b0 | |
|
|
599b55965a | |
|
|
69a9af5322 | |
|
|
0303cd0ad0 | |
|
|
8eb7e9fb05 | |
|
|
6a1de5fc4e | |
|
|
a4af55cb66 | |
|
|
1e17422f5e | |
|
|
8abaafab79 | |
|
|
71e1465524 | |
|
|
3d2ea3753b | |
|
|
88530eff8b | |
|
|
df3decf71b | |
|
|
565ee4cb2d | |
|
|
40fc325ba9 | |
|
|
6aca16102d | |
|
|
cb11b57ab1 | |
|
|
d504937d50 | |
|
|
6bfdb7ca4e | |
|
|
e1637824c6 | |
|
|
e36f2f2bcb | |
|
|
1a54e08f11 | |
|
|
ecc86ee429 | |
|
|
185a593bc2 | |
|
|
4a916ebb89 | |
|
|
1c305ca762 | |
|
|
17fff56fa0 | |
|
|
ec1b1c2b7d | |
|
|
7bae22f56f | |
|
|
21e5eeef16 | |
|
|
bf5eea80f6 | |
|
|
9f9a6d9827 | |
|
|
ae622e6d75 | |
|
|
68fbff631f | |
|
|
6cdce75095 | |
|
|
f699e76c56 | |
|
|
a729329cd4 | |
|
|
d5020ce9bb | |
|
|
126868c251 | |
|
|
b206e9fc95 | |
|
|
4b6ff68464 | |
|
|
b23a0febb5 | |
|
|
05ad547341 | |
|
|
f10af882a7 | |
|
|
98f32ebcad | |
|
|
e2c302836f | |
|
|
f1d9642cf6 | |
|
|
5c58e5b545 | |
|
|
803cb335e1 | |
|
|
ae4dde8255 | |
|
|
cb34f68b1b | |
|
|
96ef983cfb | |
|
|
d8c3d67dfe | |
|
|
5de5153663 | |
|
|
1e747b6831 | |
|
|
fbe9d16073 | |
|
|
d02c0073a0 | |
|
|
1090b9879c | |
|
|
5a6af976cd | |
|
|
55e39a5d30 | |
|
|
c9b1ddfb59 | |
|
|
f7dd696ffc | |
|
|
70f210ac5d | |
|
|
cad1c11f8b | |
|
|
f7fa305e82 | |
|
|
f96c51e854 | |
|
|
c19705d3e5 | |
|
|
1190511994 | |
|
|
69ee7ef63c | |
|
|
fc95e5a9a8 | |
|
|
6ecc495d43 | |
|
|
6e861001cf | |
|
|
c56af08c7e | |
|
|
e68abefe48 | |
|
|
fd0635cb82 | |
|
|
baa3cfb354 | |
|
|
aea9bab853 | |
|
|
48de609f53 | |
|
|
71f4f87288 | |
|
|
48b202c56b | |
|
|
d975019a7b | |
|
|
6009b5013b | |
|
|
24979d7fbd | |
|
|
b4bf42e377 | |
|
|
f94819351a | |
|
|
8da69c11d9 | |
|
|
635a825095 | |
|
|
bbffdbf56f | |
|
|
1c30533d19 | |
|
|
dcd80fe6ad | |
|
|
525ab8d945 | |
|
|
d8fb3f526a | |
|
|
a55df1d111 | |
|
|
2cf32ba38d | |
|
|
c82907153e | |
|
|
165403da67 | |
|
|
0e4d94946e | |
|
|
9f9c5abf35 | |
|
|
6a3b10111f | |
|
|
0a55f4bf83 | |
|
|
493d66d991 | |
|
|
268b495a29 | |
|
|
180f4926f8 | |
|
|
c853349b78 | |
|
|
ee555e0da9 | |
|
|
3dec4cc698 | |
|
|
d7b2b94cec | |
|
|
c9e88586aa | |
|
|
1d641504b1 | |
|
|
655e068b9b | |
|
|
67a9f314cc | |
|
|
ff2b58e8a3 | |
|
|
a1482cb40e | |
|
|
89111059f9 | |
|
|
0ae823716a | |
|
|
dab3f722e8 | |
|
|
0dc1af0747 | |
|
|
021206e052 | |
|
|
cb09cf3734 | |
|
|
f0525d6463 | |
|
|
e22424ffa4 | |
|
|
6e666c64e8 | |
|
|
5f5f6ac539 | |
|
|
3024c79f4f | |
|
|
ba96d86dc2 | |
|
|
40ec7195d1 | |
|
|
f10dfa0c20 | |
|
|
6a5473f6fe | |
|
|
f79de6fbe8 | |
|
|
ec4ee3132b | |
|
|
1298f2b688 | |
|
|
534a2f1d28 | |
|
|
c8e95cf3c3 | |
|
|
c4918a963c | |
|
|
bf6f738d2e | |
|
|
1605904eb1 | |
|
|
138517f116 | |
|
|
d4a4cb2e80 | |
|
|
9a9dc328e3 | |
|
|
50eea0a4f1 | |
|
|
528a8b5b46 | |
|
|
0db0bc53fa | |
|
|
0297c267e9 | |
|
|
5af85f24f6 | |
|
|
5110a7578e | |
|
|
5af28670f0 | |
|
|
efa2b781dd | |
|
|
979f151181 | |
|
|
6f125f18c3 | |
|
|
edba7051f0 | |
|
|
fa1ae8d746 | |
|
|
a476617432 | |
|
|
ffac13bfef | |
|
|
f877bf21ba | |
|
|
4bc4882b1f | |
|
|
084c17dc26 | |
|
|
26c39d6822 | |
|
|
aefc173227 | |
|
|
bf44a1cce6 | |
|
|
a76c6c653d | |
|
|
f11205bba7 | |
|
|
72d9c5019c | |
|
|
58d66e3e97 | |
|
|
43c88a2fab | |
|
|
9ce64ec6e1 | |
|
|
c749d6a7dc | |
|
|
f3e6d35c98 | |
|
|
0be539b8a5 | |
|
|
0454a369e5 | |
|
|
010025cbfa | |
|
|
61cae0a9f8 | |
|
|
9e83d9e68c | |
|
|
248acd5e26 | |
|
|
42c1f5601a | |
|
|
9c1a673047 | |
|
|
99b90f90ac | |
|
|
6ead8d8b49 | |
|
|
9b12232e9f | |
|
|
c1ed1baaad | |
|
|
ab34312089 | |
|
|
a25d92fbb7 |
1
.gdbinit
1
.gdbinit
|
|
@ -7,6 +7,7 @@ skip -rfu ^ImGui::
|
||||||
|
|
||||||
# Trigger breakpoint when execution reaches triggerSafeShutdown()
|
# Trigger breakpoint when execution reaches triggerSafeShutdown()
|
||||||
break triggerSafeShutdown
|
break triggerSafeShutdown
|
||||||
|
break __glibcxx_assert_fail
|
||||||
|
|
||||||
# Print backtrace after execution jumped to an invalid address
|
# Print backtrace after execution jumped to an invalid address
|
||||||
define fixbt
|
define fixbt
|
||||||
|
|
|
||||||
|
|
@ -49,15 +49,16 @@ jobs:
|
||||||
set -x
|
set -x
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
CC=gcc-14 CXX=g++-14 cmake \
|
CC=gcc-14 CXX=g++-14 cmake \
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||||
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
-DCMAKE_INSTALL_PREFIX="$PWD/install" \
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_C_FLAGS="-fuse-ld=lld" \
|
||||||
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
-DCMAKE_CXX_FLAGS="-fuse-ld=lld" \
|
||||||
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
-G Ninja \
|
-DIMHEX_EXCLUDE_PLUGINS="script_loader" \
|
||||||
|
-G Ninja \
|
||||||
..
|
..
|
||||||
ninja install
|
ninja install
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,79 +0,0 @@
|
||||||
name: Build for the web
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'master'
|
|
||||||
- 'releases/**'
|
|
||||||
- 'tests/**'
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
env:
|
|
||||||
BUILD_TYPE: Release
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
actions: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
name: 🌍 WebAssembly
|
|
||||||
steps:
|
|
||||||
- name: 🧰 Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: 📁 Restore docker /cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: cache
|
|
||||||
key: web-cache-${{ hashFiles('**/CMakeLists.txt') }}
|
|
||||||
|
|
||||||
- name: 🐳 Inject /cache into docker
|
|
||||||
uses: reproducible-containers/buildkit-cache-dance@v2
|
|
||||||
with:
|
|
||||||
cache-source: cache
|
|
||||||
cache-target: /cache
|
|
||||||
|
|
||||||
- name: 🛠️ Build using docker
|
|
||||||
run: |
|
|
||||||
docker buildx build . -f dist/web/Dockerfile --progress=plain --build-arg 'JOBS=4' --output out --target raw
|
|
||||||
|
|
||||||
- name: 🔨 Fix permissions
|
|
||||||
run: |
|
|
||||||
chmod -c -R +rX "out/"
|
|
||||||
|
|
||||||
- name: ⬆️ Upload artifacts
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
with:
|
|
||||||
path: out/
|
|
||||||
|
|
||||||
# See https://github.com/actions/cache/issues/342#issuecomment-1711054115
|
|
||||||
- name: 🗑️ Delete old cache
|
|
||||||
continue-on-error: true
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
gh extension install actions/gh-actions-cache || true
|
|
||||||
gh actions-cache delete "build-web-cache" --confirm || true
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
|
|
||||||
name: 📃 Deploy to GitHub Pages
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
if: ${{ github.ref == 'refs/heads/master' && github.event.repository.fork == false }}
|
|
||||||
needs: build
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: 🌍 Deploy
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
name: Nightly Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
nightly-release:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
name: 🌃 Update Nightly Release
|
||||||
|
steps:
|
||||||
|
- name: 🧰 Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: ImHex
|
||||||
|
fetch-depth: 0
|
||||||
|
fetch-tags: true
|
||||||
|
|
||||||
|
- name: 🌃 Check for new commits
|
||||||
|
id: check_commits
|
||||||
|
run: |
|
||||||
|
cd ImHex
|
||||||
|
git config --global --add safe.directory $(pwd)
|
||||||
|
if [ -z "$(git log nightly..HEAD --oneline)" ]; then
|
||||||
|
echo "No new commits since last nightly. Exiting."
|
||||||
|
echo "::set-output name=should_run::false"
|
||||||
|
else
|
||||||
|
echo "::set-output name=should_run::true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: 📜 Set version variable
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
run: |
|
||||||
|
project_version=`cat ImHex/VERSION`
|
||||||
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: ⬇️ Download artifacts from latest workflow
|
||||||
|
uses: dawidd6/action-download-artifact@v6
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
workflow: build.yml
|
||||||
|
branch: ${{ github.event.release.target_commitish }}
|
||||||
|
workflow_conclusion: success
|
||||||
|
skip_unpack: true
|
||||||
|
|
||||||
|
- name: 🗜️ Unzip files when needed
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
run: |
|
||||||
|
set -x
|
||||||
|
for zipfile in ./*.zip
|
||||||
|
do
|
||||||
|
if [ `zipinfo -1 "$zipfile" | wc -l` -eq 1 ];
|
||||||
|
then
|
||||||
|
echo "unzipping $zipfile"
|
||||||
|
unzip "$zipfile"
|
||||||
|
rm "$zipfile"
|
||||||
|
else
|
||||||
|
echo "keeping $zipfile zipped"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: 🟩 Rename artifacts when needed
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
run: |
|
||||||
|
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip
|
||||||
|
mv "Windows Portable arm64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-arm64.zip
|
||||||
|
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip
|
||||||
|
mv "ImHex Web.zip" imhex-${{ env.IMHEX_VERSION }}-Web.zip
|
||||||
|
rm artifact.tar || true
|
||||||
|
|
||||||
|
- name: 📖 Generate Release Notes
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
id: release_notes
|
||||||
|
continue-on-error: true
|
||||||
|
run: |
|
||||||
|
cd ImHex
|
||||||
|
echo "## Nightly ${GITHUB_SHA::7} Changelog" > changelog.md
|
||||||
|
git fetch --tags --recurse-submodules=no
|
||||||
|
git log nightly..origin/master --oneline --no-merges --pretty=format:'* %s' >> changelog.md
|
||||||
|
|
||||||
|
- name: ⬆️ Upload Unsigned x86_64 Windows Installer
|
||||||
|
if: false
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
id: upload-installer-x86_64
|
||||||
|
with:
|
||||||
|
if-no-files-found: error
|
||||||
|
name: Windows Installer ${{ matrix.architecture_name }}
|
||||||
|
path: |
|
||||||
|
imhex-*-x86_64.msi
|
||||||
|
|
||||||
|
- name: ⬆️ Upload Unsigned ARM64 Windows Installer
|
||||||
|
if: false
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
id: upload-installer-arm64
|
||||||
|
with:
|
||||||
|
if-no-files-found: error
|
||||||
|
name: Windows Installer ${{ matrix.architecture_name }}
|
||||||
|
path: |
|
||||||
|
imhex-*-arm64.msi
|
||||||
|
|
||||||
|
- name: 🗑️ Delete unsigned installers
|
||||||
|
if: false
|
||||||
|
run: |
|
||||||
|
rm imhex-*.msi
|
||||||
|
|
||||||
|
- name: 🗝️ Sign Installer
|
||||||
|
if: false
|
||||||
|
uses: signpath/github-action-submit-signing-request@v1
|
||||||
|
with:
|
||||||
|
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||||
|
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
|
||||||
|
project-slug: 'ImHex'
|
||||||
|
signing-policy-slug: 'release-signing'
|
||||||
|
github-artifact-id: '${{ steps.upload-installer.outputs.artifact-id }}'
|
||||||
|
wait-for-completion: true
|
||||||
|
output-artifact-directory: '.'
|
||||||
|
|
||||||
|
- name: 📦 Update Pre-Release
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd ImHex
|
||||||
|
|
||||||
|
# Move nightly tag to latest commit
|
||||||
|
git tag -f nightly origin/master
|
||||||
|
git push origin nightly --force
|
||||||
|
|
||||||
|
# Auth for GitHub CLI
|
||||||
|
echo "${{ github.token }}" | gh auth login --with-token
|
||||||
|
|
||||||
|
# Delete existing assets
|
||||||
|
for asset in $(gh release view nightly --json assets --jq '.assets[].name'); do
|
||||||
|
gh release delete-asset nightly "$asset" --yes
|
||||||
|
done
|
||||||
|
|
||||||
|
# Update release notes
|
||||||
|
gh release edit nightly --notes-file changelog.md
|
||||||
|
|
||||||
|
# Upload new assets
|
||||||
|
gh release upload nightly ../*.* --clobber
|
||||||
|
|
||||||
|
- name: ⬆️ Publish x86_64 Snap package
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
continue-on-error: true
|
||||||
|
uses: snapcore/action-publish@v1
|
||||||
|
env:
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||||
|
with:
|
||||||
|
snap: imhex-${{ env.IMHEX_VERSION }}-x86_64.snap
|
||||||
|
release: edge
|
||||||
|
|
||||||
|
- name: ⬆️ Publish arm64 Snap package
|
||||||
|
if: ${{ steps.check_commits.outputs.should_run == 'true' }}
|
||||||
|
continue-on-error: true
|
||||||
|
uses: snapcore/action-publish@v1
|
||||||
|
env:
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||||
|
with:
|
||||||
|
snap: imhex-${{ env.IMHEX_VERSION }}-arm64.snap
|
||||||
|
release: edge
|
||||||
|
|
@ -7,6 +7,12 @@ on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
commit_hash:
|
||||||
|
type: string
|
||||||
|
description: 'The commit hash to build (defaults to the latest commit on the default branch)'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-update-repos:
|
release-update-repos:
|
||||||
|
|
@ -41,6 +47,7 @@ jobs:
|
||||||
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
||||||
repo: PatternLanguage
|
repo: PatternLanguage
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
skipIfReleaseExists: true
|
||||||
|
|
||||||
- name: 🎫 Create ImHex-Patterns release
|
- name: 🎫 Create ImHex-Patterns release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
|
|
@ -51,6 +58,7 @@ jobs:
|
||||||
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
tag: ImHex-v${{ env.IMHEX_VERSION }}
|
||||||
repo: ImHex-Patterns
|
repo: ImHex-Patterns
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
skipIfReleaseExists: true
|
||||||
|
|
||||||
- name: 🎫 Create imhex-download-sdk release
|
- name: 🎫 Create imhex-download-sdk release
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
|
|
@ -61,11 +69,13 @@ jobs:
|
||||||
tag: v${{ env.IMHEX_VERSION }}
|
tag: v${{ env.IMHEX_VERSION }}
|
||||||
repo: imhex-download-sdk
|
repo: imhex-download-sdk
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
token: ${{ secrets.RELEASE_TOKEN }}
|
||||||
|
skipIfReleaseExists: true
|
||||||
|
|
||||||
release-upload-artifacts:
|
release-upload-artifacts:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
name: Release Upload Artifacts
|
name: Release Upload Artifacts
|
||||||
|
outputs:
|
||||||
|
IMHEX_VERSION: ${{ steps.verify_version.outputs.IMHEX_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: 🧰 Checkout
|
- name: 🧰 Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
@ -74,6 +84,7 @@ jobs:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- name: 📜 Verify version and set version variable
|
- name: 📜 Verify version and set version variable
|
||||||
|
id: verify_version
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
project_version=`cat ImHex/VERSION`
|
project_version=`cat ImHex/VERSION`
|
||||||
|
|
@ -85,6 +96,7 @@ jobs:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_ENV
|
||||||
|
echo "IMHEX_VERSION=$project_version" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: 🗜️ Create tarball from sources with dependencies
|
- name: 🗜️ Create tarball from sources with dependencies
|
||||||
run: tar --exclude-vcs -czvf Full.Sources.tar.gz ImHex
|
run: tar --exclude-vcs -czvf Full.Sources.tar.gz ImHex
|
||||||
|
|
@ -92,11 +104,12 @@ jobs:
|
||||||
- name: ⬇️ Download artifacts from latest workflow
|
- name: ⬇️ Download artifacts from latest workflow
|
||||||
uses: dawidd6/action-download-artifact@v6
|
uses: dawidd6/action-download-artifact@v6
|
||||||
with:
|
with:
|
||||||
github_token: ${{secrets.GITHUB_TOKEN}}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
workflow: build.yml
|
workflow: build.yml
|
||||||
branch: ${{ github.event.release.target_commitish }}
|
branch: ${{ github.event.release.target_commitish }}
|
||||||
workflow_conclusion: success
|
workflow_conclusion: success
|
||||||
skip_unpack: true
|
skip_unpack: true
|
||||||
|
commit: ${{ github.event.inputs.commit_hash }}
|
||||||
|
|
||||||
- name: 🗜️ Unzip files when needed
|
- name: 🗜️ Unzip files when needed
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -115,22 +128,80 @@ jobs:
|
||||||
|
|
||||||
- name: 🟩 Rename artifacts when needed
|
- name: 🟩 Rename artifacts when needed
|
||||||
run: |
|
run: |
|
||||||
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip
|
mv "Windows Portable x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-x86_64.zip || true
|
||||||
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip
|
mv "Windows Portable arm64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-arm64.zip || true
|
||||||
|
mv "Windows Portable NoGPU x86_64.zip" imhex-${{ env.IMHEX_VERSION }}-Windows-Portable-NoGPU-x86_64.zip || true
|
||||||
|
mv "ImHex Web.zip" imhex-${{ env.IMHEX_VERSION }}-Web.zip || true
|
||||||
|
rm artifact.tar || true
|
||||||
|
|
||||||
|
- name: ⬆️ Upload Unsigned x86_64 Windows Installer
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
id: upload-installer-x86_64
|
||||||
|
with:
|
||||||
|
if-no-files-found: error
|
||||||
|
name: Windows Installer ${{ matrix.architecture_name }}
|
||||||
|
path: |
|
||||||
|
imhex-*-x86_64.msi
|
||||||
|
|
||||||
|
- name: ⬆️ Upload Unsigned ARM64 Windows Installer
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
id: upload-installer-arm64
|
||||||
|
with:
|
||||||
|
if-no-files-found: error
|
||||||
|
name: Windows Installer ${{ matrix.architecture_name }}
|
||||||
|
path: |
|
||||||
|
imhex-*-arm64.msi
|
||||||
|
|
||||||
|
- name: 🗑️ Delete unsigned installers
|
||||||
|
run: |
|
||||||
|
rm imhex-*.msi
|
||||||
|
|
||||||
|
- name: 🗝️ Sign x86_64 Installer
|
||||||
|
uses: signpath/github-action-submit-signing-request@v1
|
||||||
|
with:
|
||||||
|
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||||
|
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
|
||||||
|
project-slug: 'ImHex'
|
||||||
|
signing-policy-slug: 'release-signing'
|
||||||
|
github-artifact-id: '${{ steps.upload-installer-x86_64.outputs.artifact-id }}'
|
||||||
|
wait-for-completion: true
|
||||||
|
output-artifact-directory: '.'
|
||||||
|
|
||||||
|
- name: 🗝️ Sign ARM64 Installer
|
||||||
|
uses: signpath/github-action-submit-signing-request@v1
|
||||||
|
with:
|
||||||
|
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
|
||||||
|
organization-id: 'f605a0e8-86cd-411c-bb6f-e05025afcc33'
|
||||||
|
project-slug: 'ImHex'
|
||||||
|
signing-policy-slug: 'release-signing'
|
||||||
|
github-artifact-id: '${{ steps.upload-installer-arm64.outputs.artifact-id }}'
|
||||||
|
wait-for-completion: true
|
||||||
|
output-artifact-directory: '.'
|
||||||
|
|
||||||
- name: ⬆️ Upload everything to release
|
- name: ⬆️ Upload everything to release
|
||||||
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
|
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
|
||||||
with:
|
with:
|
||||||
files: '*'
|
files: '*'
|
||||||
|
|
||||||
|
release-update-aur:
|
||||||
|
name: Release update AUR package
|
||||||
|
needs: release-upload-artifacts
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: ⬇️ Download artifacts
|
||||||
|
run: |
|
||||||
|
tagname=${GITHUB_REF#refs/tags/}
|
||||||
|
version=${tagname#v}
|
||||||
|
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-ArchLinux-x86_64.pkg.tar.zst
|
||||||
|
|
||||||
- name: ✒️ Prepare PKGBUILD
|
- name: ✒️ Prepare PKGBUILD
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
cp ImHex/dist/Arch/PKGBUILD .
|
cp ImHex/dist/Arch/PKGBUILD .
|
||||||
|
|
||||||
hash=`md5sum imhex-${{ env.IMHEX_VERSION }}-ArchLinux-x86_64.pkg.tar.zst | cut -d ' ' -f 1`
|
hash=`md5sum imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-ArchLinux-x86_64.pkg.tar.zst | cut -d ' ' -f 1`
|
||||||
|
|
||||||
sed -i 's/%version%/${{ env.IMHEX_VERSION }}/g' PKGBUILD
|
sed -i 's/%version%/${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}/g' PKGBUILD
|
||||||
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
|
sed -i "s/(SKIP)/($hash)/g" PKGBUILD
|
||||||
|
|
||||||
- name: ⬆️ Publish AUR package
|
- name: ⬆️ Publish AUR package
|
||||||
|
|
@ -146,7 +217,7 @@ jobs:
|
||||||
commit_username: iTrooz
|
commit_username: iTrooz
|
||||||
commit_email: itrooz@protonmail.com
|
commit_email: itrooz@protonmail.com
|
||||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||||
commit_message: Bump to version ${{ env.IMHEX_VERSION }}
|
commit_message: Bump to version ${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}
|
||||||
ssh_keyscan_types: rsa,ecdsa,ed25519
|
ssh_keyscan_types: rsa,ecdsa,ed25519
|
||||||
|
|
||||||
release-update-winget:
|
release-update-winget:
|
||||||
|
|
@ -158,6 +229,7 @@ jobs:
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
||||||
|
|
||||||
- name: ⬆️ Update winget manifest
|
- name: ⬆️ Update winget manifest
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
env:
|
env:
|
||||||
|
|
@ -171,3 +243,33 @@ jobs:
|
||||||
if ($version -notmatch "-") {
|
if ($version -notmatch "-") {
|
||||||
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN
|
.\wingetcreate.exe submit .\manifests\w\WerWolv\ImHex\${version}\ --token $env:WINGET_GITHUB_TOKEN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
release-update-snapstore:
|
||||||
|
name: Release update snapstore package
|
||||||
|
needs: release-upload-artifacts
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- name: ⬇️ Download artifacts
|
||||||
|
run: |
|
||||||
|
tagname=${GITHUB_REF#refs/tags/}
|
||||||
|
version=${tagname#v}
|
||||||
|
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-x86_64.snap
|
||||||
|
wget https://github.com/WerWolv/ImHex/releases/download/${tagname}/imhex-${version}-arm64.snap
|
||||||
|
|
||||||
|
- name: ⬆️ Publish x86_64 Snap package
|
||||||
|
continue-on-error: true
|
||||||
|
uses: snapcore/action-publish@v1
|
||||||
|
env:
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||||
|
with:
|
||||||
|
snap: imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-x86_64.snap
|
||||||
|
release: stable
|
||||||
|
|
||||||
|
- name: ⬆️ Publish arm64 Snap package
|
||||||
|
continue-on-error: true
|
||||||
|
uses: snapcore/action-publish@v1
|
||||||
|
env:
|
||||||
|
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
|
||||||
|
with:
|
||||||
|
snap: imhex-${{ needs.release-upload-artifacts.outputs.IMHEX_VERSION }}-arm64.snap
|
||||||
|
release: stable
|
||||||
|
|
@ -6,7 +6,8 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
close-issues:
|
close-issues:
|
||||||
runs-on: ubuntu-latest
|
if: false # Disabled for now until I actually have time to take care of all these issues
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
permissions:
|
permissions:
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ on:
|
||||||
- 'master'
|
- 'master'
|
||||||
- 'releases/**'
|
- 'releases/**'
|
||||||
- 'tests/**'
|
- 'tests/**'
|
||||||
|
- 'feature/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,18 @@
|
||||||
.vscode/
|
/.vscode/
|
||||||
.idea/
|
/.idea/
|
||||||
.kdev4/
|
/.kdev4/
|
||||||
|
/.vs/
|
||||||
|
.venv/
|
||||||
|
|
||||||
cmake-build-*/
|
/cmake-build-*/
|
||||||
build*/
|
/build*/
|
||||||
local/
|
/local/
|
||||||
venv/
|
/venv/
|
||||||
.cache/
|
/.cache/
|
||||||
|
/install/
|
||||||
|
/out/
|
||||||
|
|
||||||
|
/dist/ImHex.run.xml
|
||||||
|
|
||||||
*.mgc
|
*.mgc
|
||||||
*.kdev4
|
*.kdev4
|
||||||
|
|
@ -14,3 +20,5 @@ imgui.ini
|
||||||
.DS_Store
|
.DS_Store
|
||||||
CMakeUserPresets.json
|
CMakeUserPresets.json
|
||||||
Brewfile.lock.json
|
Brewfile.lock.json
|
||||||
|
|
||||||
|
vcpkg.json
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,13 @@
|
||||||
path = lib/third_party/capstone
|
path = lib/third_party/capstone
|
||||||
url = https://github.com/capstone-engine/capstone
|
url = https://github.com/capstone-engine/capstone
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "lib/third_party/jthread/jthread"]
|
|
||||||
path = lib/third_party/jthread/jthread
|
|
||||||
url = https://github.com/josuttis/jthread
|
|
||||||
ignore = dirty
|
|
||||||
[submodule "lib/third_party/edlib"]
|
[submodule "lib/third_party/edlib"]
|
||||||
path = lib/third_party/edlib
|
path = lib/third_party/edlib
|
||||||
url = https://github.com/Martinsos/edlib
|
url = https://github.com/Martinsos/edlib
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
[submodule "lib/third_party/lunasvg"]
|
[submodule "lib/third_party/lunasvg"]
|
||||||
path = lib/third_party/lunasvg
|
path = lib/third_party/lunasvg
|
||||||
url = https://github.com/WerWolv/lunasvg
|
url = https://github.com/sammycage/lunasvg
|
||||||
ignore = dirty
|
ignore = dirty
|
||||||
|
|
||||||
[submodule "lib/external/libromfs"]
|
[submodule "lib/external/libromfs"]
|
||||||
|
|
@ -43,4 +39,10 @@
|
||||||
|
|
||||||
[submodule "lib/third_party/HashLibPlus"]
|
[submodule "lib/third_party/HashLibPlus"]
|
||||||
path = lib/third_party/HashLibPlus
|
path = lib/third_party/HashLibPlus
|
||||||
url = https://github.com/WerWolv/HashLibPlus
|
url = https://github.com/WerWolv/HashLibPlus
|
||||||
|
[submodule "lib/external/disassembler"]
|
||||||
|
path = lib/external/disassembler
|
||||||
|
url = https://github.com/WerWolv/Disassembler
|
||||||
|
[submodule "lib/third_party/md4c"]
|
||||||
|
path = lib/third_party/md4c
|
||||||
|
url = https://github.com/mity/md4c
|
||||||
|
|
@ -1,27 +1,38 @@
|
||||||
cmake_minimum_required(VERSION 3.20)
|
cmake_minimum_required(VERSION 3.25)
|
||||||
|
|
||||||
# Options
|
# Options
|
||||||
option(IMHEX_PLUGINS_IN_SHARE "Put the plugins in share/imhex/plugins instead of lib[..]/imhex/plugins (Linux only)" OFF)
|
## General
|
||||||
option(IMHEX_STRIP_RELEASE "Strip the release builds" ON )
|
option(IMHEX_STRIP_RELEASE "Strip the release builds" ON )
|
||||||
option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF)
|
option(IMHEX_OFFLINE_BUILD "Enable offline build" OFF)
|
||||||
option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF)
|
option(IMHEX_IGNORE_BAD_CLONE "Disable the bad clone prevention checks" OFF)
|
||||||
option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF)
|
option(IMHEX_PATTERNS_PULL_MASTER "Download latest files from master branch of the ImHex-Patterns repo" OFF)
|
||||||
option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF)
|
option(IMHEX_IGNORE_BAD_COMPILER "Allow compiling with an unsupported compiler" OFF)
|
||||||
option(IMHEX_USE_GTK_FILE_PICKER "Use GTK file picker instead of xdg-desktop-portals (Linux only)" OFF)
|
option(IMHEX_USE_GTK_FILE_PICKER "Use GTK file picker instead of xdg-desktop-portals (Linux only)" OFF)
|
||||||
option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF)
|
|
||||||
option(IMHEX_BUNDLE_DOTNET "Bundle .NET runtime" ON )
|
option(IMHEX_BUNDLE_DOTNET "Bundle .NET runtime" ON )
|
||||||
option(IMHEX_ENABLE_LTO "Enables Link Time Optimizations if possible" OFF)
|
option(IMHEX_ENABLE_LTO "Enables Link Time Optimizations if possible" OFF)
|
||||||
option(IMHEX_USE_DEFAULT_BUILD_SETTINGS "Use default build settings" OFF)
|
option(IMHEX_USE_DEFAULT_BUILD_SETTINGS "Use default build settings" OFF)
|
||||||
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON )
|
option(IMHEX_BUILD_HARDENING "Enable hardening flags for build" ON )
|
||||||
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
|
|
||||||
option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. (Windows and MacOS only)" OFF)
|
option(IMHEX_GENERATE_PACKAGE "Specify if a native package should be built. (Windows and MacOS only)" OFF)
|
||||||
option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF)
|
option(IMHEX_ENABLE_UNITY_BUILD "Enables building ImHex as a unity build." OFF)
|
||||||
|
option(IMHEX_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers" OFF)
|
||||||
|
option(IMHEX_ENABLE_CXX_MODULES "Enable C++20 Module compilation. Testing only!" OFF)
|
||||||
|
option(IMHEX_ENABLE_CPPCHECK "Enable cppcheck static analysis" OFF)
|
||||||
|
option(IMHEX_BUNDLE_PLUGIN_SDK "Enable bundling of Plugin SDK into install package" ON )
|
||||||
|
## Testing
|
||||||
|
option(IMHEX_ENABLE_UNIT_TESTS "Enable building unit tests" ON )
|
||||||
|
option(IMHEX_ENABLE_IMGUI_TEST_ENGINE "Enable the ImGui Test Engine" OFF)
|
||||||
|
option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF)
|
||||||
|
## Debug info
|
||||||
|
option(IMHEX_COMPRESS_DEBUG_INFO "Compress debug information" ON )
|
||||||
option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds (Windows only)" OFF)
|
option(IMHEX_GENERATE_PDBS "Enable generating PDB files in non-debug builds (Windows only)" OFF)
|
||||||
option(IMHEX_REPLACE_DWARF_WITH_PDB "Remove DWARF information from binaries when generating PDBS (Windows only)" OFF)
|
option(IMHEX_REPLACE_DWARF_WITH_PDB "Remove DWARF information from binaries when generating PDBS (Windows only)" OFF)
|
||||||
option(IMHEX_ENABLE_STD_ASSERTS "Enable debug asserts in the C++ std library. (Breaks Plugin ABI!)" OFF)
|
option(IMHEX_STRICT_WARNINGS "Enable most available warnings and treat them as errors" ON )
|
||||||
option(IMHEX_ENABLE_UNIT_TESTS "Enable building unit tests" OFF)
|
option(IMHEX_DISABLE_STACKTRACE "Disables support for printing stack traces" OFF)
|
||||||
option(IMHEX_ENABLE_PRECOMPILED_HEADERS "Enable precompiled headers" OFF)
|
## Plugins
|
||||||
option(IMHEX_COMPRESS_DEBUG_INFO "Compress debug information" ON )
|
option(IMHEX_STATIC_LINK_PLUGINS "Statically link all plugins into the main executable" OFF)
|
||||||
|
option(IMHEX_ENABLE_PLUGIN_TESTS "Enable building plugin tests" ON )
|
||||||
|
option(IMHEX_INCLUDE_PLUGINS "Semicolon-separated list of plugins to include in the build (empty = build all)" "" )
|
||||||
|
option(IMHEX_EXCLUDE_PLUGINS "Semicolon-separated list of plugins to exclude from the build" "" )
|
||||||
|
|
||||||
set(IMHEX_BASE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}")
|
set(IMHEX_BASE_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
|
set(CMAKE_MODULE_PATH "${IMHEX_BASE_FOLDER}/cmake/modules")
|
||||||
|
|
@ -31,6 +42,7 @@ include("${IMHEX_BASE_FOLDER}/cmake/ide_helpers.cmake")
|
||||||
|
|
||||||
# Basic compiler and cmake configurations
|
# Basic compiler and cmake configurations
|
||||||
set(CMAKE_CXX_STANDARD 23)
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_SCAN_FOR_MODULES ${IMHEX_ENABLE_CXX_MODULES})
|
||||||
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
|
set(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")
|
include("${IMHEX_BASE_FOLDER}/cmake/build_helpers.cmake")
|
||||||
|
|
@ -40,7 +52,7 @@ loadVersion(IMHEX_VERSION IMHEX_VERSION_PLAIN)
|
||||||
setVariableInParent(IMHEX_VERSION ${IMHEX_VERSION})
|
setVariableInParent(IMHEX_VERSION ${IMHEX_VERSION})
|
||||||
|
|
||||||
configureCMake()
|
configureCMake()
|
||||||
project(imhex
|
project(ImHex
|
||||||
LANGUAGES C CXX
|
LANGUAGES C CXX
|
||||||
VERSION ${IMHEX_VERSION_PLAIN}
|
VERSION ${IMHEX_VERSION_PLAIN}
|
||||||
DESCRIPTION "The ImHex Hex Editor"
|
DESCRIPTION "The ImHex Hex Editor"
|
||||||
|
|
@ -70,6 +82,7 @@ addBundledLibraries()
|
||||||
add_subdirectory(lib/libimhex)
|
add_subdirectory(lib/libimhex)
|
||||||
add_subdirectory(main)
|
add_subdirectory(main)
|
||||||
addPluginDirectories()
|
addPluginDirectories()
|
||||||
|
add_subdirectory(lib/trace)
|
||||||
|
|
||||||
# Add unit tests
|
# Add unit tests
|
||||||
if (IMHEX_ENABLE_UNIT_TESTS)
|
if (IMHEX_ENABLE_UNIT_TESTS)
|
||||||
|
|
@ -81,8 +94,9 @@ if (IMHEX_ENABLE_UNIT_TESTS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Configure more resources that will be added to the install package
|
# Configure more resources that will be added to the install package
|
||||||
generatePDBs()
|
if (IMHEX_BUNDLE_PLUGIN_SDK)
|
||||||
generateSDKDirectory()
|
generateSDKDirectory()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Handle package generation
|
# Handle package generation
|
||||||
createPackage()
|
createPackage()
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,30 @@
|
||||||
|
|
||||||
"IMHEX_IDE_HELPERS_OVERRIDE_XCODE_COMPILER": "ON"
|
"IMHEX_IDE_HELPERS_OVERRIDE_XCODE_COMPILER": "ON"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "vs2022",
|
||||||
|
"displayName": "Visual Studio 2022",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||||
|
"VCPKG_MANIFEST_DIR": "${sourceDir}/dist"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs2022-x86",
|
||||||
|
"displayName": "Visual Studio 2022 x86",
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||||
|
"VCPKG_MANIFEST_DIR": "${sourceDir}/dist"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"VSCMD_ARG_TGT_ARCH": "x86"
|
||||||
|
}
|
||||||
|
}
|
||||||
],
|
],
|
||||||
"buildPresets": [
|
"buildPresets": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,7 @@ This document is a guide for developers who want to contribute to ImHex in any w
|
||||||
|
|
||||||
If you'd like to add new features, the best way to start is by joining our Discord and telling us about your idea. We can then discuss the best way to implement it and how it should be integrated into ImHex or if it should be done in a separate plugin.
|
If you'd like to add new features, the best way to start is by joining our Discord and telling us about your idea. We can then discuss the best way to implement it and how it should be integrated into ImHex or if it should be done in a separate plugin.
|
||||||
|
|
||||||
There are standalone plugin templates that use ImHex as a submodule. You can find them here:
|
There are standalone plugin templates that use ImHex as a submodule. You can find them located in the README's [Plugin Development](README.md#plugin-development) section.
|
||||||
- https://github.com/WerWolv/ImHex-Cpp-Plugin-Template
|
|
||||||
- https://github.com/WerWolv/ImHex-Rust-Plugin-Template
|
|
||||||
|
|
||||||
### Adding a new language
|
### Adding a new language
|
||||||
|
|
||||||
|
|
@ -32,18 +30,18 @@ ImHex is written in C++ and usually uses the latest compiler and standard librar
|
||||||
### Structure
|
### Structure
|
||||||
|
|
||||||
- `main`: Contains the main application code
|
- `main`: Contains the main application code
|
||||||
- Important to understand here is that the main ImHex application is basically just an empty shell.
|
- Important to understand here is that the main ImHex application is basically just an empty shell.
|
||||||
- All it does is create a Window and a OpenGL context using GLFW, load all available plugins, properly configure ImGui and render it to the screen.
|
- All it does is create a Window and a OpenGL context using GLFW, load all available plugins, properly configure ImGui and render it to the screen.
|
||||||
- Everything else is done inside of plugins. ImHex comes with a few plugins by default, most notably the `builtin` plugin which contains the majority of the application code.
|
- Everything else is done inside of plugins. ImHex comes with a few plugins by default, most notably the `builtin` plugin which contains the majority of the application code.
|
||||||
- In most cases, this code doesn't need to be modified. Most features should be self-contained inside a plugin.
|
- In most cases, this code doesn't need to be modified. Most features should be self-contained inside a plugin.
|
||||||
- `lib`
|
- `lib`
|
||||||
- `libimhex`: Contains all helper utilities as well as various APIs for plugins to interact with ImHex.
|
- `libimhex`: Contains all helper utilities as well as various APIs for plugins to interact with ImHex.
|
||||||
- The library's main purpose is for Dependency Inversion. The ImHex main application as well as libimhex do not know about the existence of plugins at build time. Plugins and the main application instead link against libimhex and use it as a common API to interact with each other.
|
- The library's main purpose is for Dependency Inversion. The ImHex main application as well as libimhex do not know about the existence of plugins at build time. Plugins and the main application instead link against libimhex and use it as a common API to interact with each other.
|
||||||
- Since libimhex is a doesn't know about the existence of plugins, it cannot depend on any of them. This includes localizations and things that get registered by plugins after launch.
|
- Since libimhex itself doesn't know about the existence of plugins, it cannot depend on any of them. This includes localizations and things that get registered by plugins after launch.
|
||||||
- Even if the builtin plugin is technically always available, it is still a plugin and should be treated that way.
|
- Even if the builtin plugin is technically always available, it is still a plugin and should be treated that way.
|
||||||
- All important APIs can be found in the `hex/api` include directory and are documented in the respective header file.
|
- All important APIs can be found in the `hex/api` include directory and are documented in the respective header file.
|
||||||
- `external`: All libraries that need custom patches or aren't typically available in package managers go into here.
|
- `external`: All libraries that need custom patches or aren't typically available in package managers go into here.
|
||||||
- If you'd like to add new features to the Pattern language, please make a PR to https://github.com/WerWolv/PatternLanguage instead. ImHex usually depends on the latest commit of the master branch of this repo.
|
- If you'd like to add new features to the Pattern language, please make a PR to https://github.com/WerWolv/PatternLanguage instead. ImHex usually depends on the latest commit of the master branch of this repo.
|
||||||
- `plugins`
|
- `plugins`
|
||||||
- `builtin`: The builtin plugin. Contains the majority of the application code.
|
- `builtin`: The builtin plugin. Contains the majority of the application code.
|
||||||
- It's the heart of ImHex's functionality. It contains most of the default views, providers, etc. so if you want to add new functionality to ImHex, this is the place to start.
|
- It's the heart of ImHex's functionality. It contains most of the default views, providers, etc. so if you want to add new functionality to ImHex, this is the place to start.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,13 @@ To install the Flatpak, make sure you have the Flathub repository added to your
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
flatpak install flathub net.werwolv.ImHex
|
flatpak install flathub net.werwolv.ImHex
|
||||||
|
# or install the file directly
|
||||||
|
flatpak install ./imhex-*.flatpak
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Snap
|
||||||
|
```bash
|
||||||
|
snap install ./imhex-*.snap
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Ubuntu DEB Package
|
#### Ubuntu DEB Package
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
# Privacy Policy
|
||||||
|
|
||||||
|
ImHex collects **anonymous** user statistics based on the user's preferences which are set on first launch and can be opted in or out at any moment through the settings interface.
|
||||||
|
These statistics contain basic system information such as: ImHex Version, System Architecture, OS, OS Version or Linux Distro version of the GPU in use. This information is linked to a randomly generated ID which cannot be used to identify a specific user.
|
||||||
|
|
||||||
|
Additionally, we allow uploading of anonymized crash log files in case of an error. These are never uploaded automatically but only after explicit consent by the user. This decision is not saved so logs can be uploaded on a per-error basis.
|
||||||
|
|
||||||
|
Information collected may be analyzed by members of our development team and will never be shared with third parties outside of the team. We may occasionally share general usage statistics publically in a summarized manner (For example a graph stating 70% of users are using a specific OS). We will never share information about individual users, even if they are anonymous.
|
||||||
72
README.md
72
README.md
|
|
@ -37,9 +37,18 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
|
||||||
<a href="https://werwolv.net/donate"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /></a>
|
<a href="https://werwolv.net/donate"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
### Notable Sponsors
|
||||||
|
| | |
|
||||||
|
|:---------------------------------------------------------------------------------------------------:|-----------------------------------------------------------------------------------|
|
||||||
|
| [](https://www.jetbrains.com) | JetBrains, providing us with free All Products Pack licenses for development |
|
||||||
|
| [](https://signpath.io/) | SignPath, providing us with free Code Signing Certificates for our Windows builds |
|
||||||
|
| [](https://aws.amazon.com) | Amazon, providing us with free AWS Cloud Credits for our CI |
|
||||||
|
|
||||||
|
Would you like to appear here as well? Contact us at [imhex@werwolv.net](mailto:imhex@werwolv.net)!
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>More Screenshots</strong></summary>
|
<summary><strong>More Screenshots</strong></summary>
|
||||||
|
|
@ -107,6 +116,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
|
||||||
- Base64 files
|
- Base64 files
|
||||||
- IPS and IPS32 patches
|
- IPS and IPS32 patches
|
||||||
- Markdown reports
|
- Markdown reports
|
||||||
|
- Binary arrays for various programming languages
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>Data Inspector</strong></summary>
|
<summary><strong>Data Inspector</strong></summary>
|
||||||
|
|
@ -140,8 +150,13 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
|
||||||
- GDB Server
|
- GDB Server
|
||||||
- Access the RAM of a running process or embedded devices through GDB
|
- Access the RAM of a running process or embedded devices through GDB
|
||||||
- Intel Hex and Motorola SREC data
|
- Intel Hex and Motorola SREC data
|
||||||
|
- Base64 encoded data
|
||||||
|
- UDP Packets
|
||||||
|
- Support for displaying raw data received over UDP
|
||||||
- Process Memory
|
- Process Memory
|
||||||
- Inspect the entire address space of a running process
|
- Inspect the entire address space of a running process
|
||||||
|
- Remote Files over SSH with SFTP
|
||||||
|
- Support for loading files from remote servers using SSH and SFTP
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>Data searching</strong></summary>
|
<summary><strong>Data searching</strong></summary>
|
||||||
|
|
@ -212,6 +227,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
|
||||||
- WebAssembly
|
- WebAssembly
|
||||||
- MOS65XX
|
- MOS65XX
|
||||||
- Berkeley Packet Filter
|
- Berkeley Packet Filter
|
||||||
|
- Support for writing custom disassemblers for your own architectures
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>Bookmarks</strong></summary>
|
<summary><strong>Bookmarks</strong></summary>
|
||||||
|
|
@ -261,6 +277,7 @@ If you like my work, please consider supporting me on GitHub Sponsors, Patreon o
|
||||||
- Division by invariant multiplication calculator
|
- Division by invariant multiplication calculator
|
||||||
- TCP Client/Server
|
- TCP Client/Server
|
||||||
- Euclidean algorithm calculator
|
- Euclidean algorithm calculator
|
||||||
|
- HTTP Requests
|
||||||
</details>
|
</details>
|
||||||
<details>
|
<details>
|
||||||
<summary><strong>Built-in Content updater</strong></summary>
|
<summary><strong>Built-in Content updater</strong></summary>
|
||||||
|
|
@ -319,21 +336,23 @@ To use ImHex, the following minimal system requirements need to be met.
|
||||||
|
|
||||||
- **OS**:
|
- **OS**:
|
||||||
- **Windows**: Windows 7 or higher (Windows 10/11 recommended)
|
- **Windows**: Windows 7 or higher (Windows 10/11 recommended)
|
||||||
- **macOS**: macOS 13 (Ventura) or higher,
|
- **macOS**: macOS 15 (Sequoia) or higher,
|
||||||
- Lower versions should still work too, but you'll need to compile ImHex yourself. The release binaries will NOT work.
|
- Lower versions should still work too, but you'll need to compile ImHex yourself. The release binaries will NOT work due to GitHub not having any macOS 15 or lower CI runners available.
|
||||||
- The macOS build is not signed and will require you to manually allow them in the Security & Privacy settings.
|
- The macOS build is not signed and will require you to manually allow them in the Security & Privacy settings.
|
||||||
- **Linux**: "Modern" Linux. The following distributions have official releases available. Other distros are supported through the AppImage and Flatpak releases.
|
- **Linux**: "Modern" Linux. The following distributions have official releases available. Other distros are supported through the AppImage, Flatpak and Snap releases.
|
||||||
- Ubuntu and Debian
|
- Ubuntu and Debian
|
||||||
- Fedora
|
- Fedora
|
||||||
- RHEL/AlmaLinux
|
- RHEL/AlmaLinux
|
||||||
- Arch Linux
|
- Arch Linux
|
||||||
- Basically any other distro will work as well when compiling ImHex from sources.
|
- Basically any other distro will work as well when compiling ImHex from sources.
|
||||||
- **CPU**: x86_64 (64 Bit)
|
- **FreeBSD**: Tested on FreeBSD 14.3
|
||||||
|
- Other versions will most likely work too but are untested
|
||||||
|
- **CPU**: Officially supported are x86, AMD64 and ARM64, though any Little Endian CPU should work.
|
||||||
- **GPU**: OpenGL 3.0 or higher
|
- **GPU**: OpenGL 3.0 or higher
|
||||||
- Integrated Intel HD iGPUs are supported, however certain drivers are known to cause various graphical artifacts, especially on Windows. Use at your own risk.
|
- Integrated Intel HD iGPUs are supported, however certain drivers are known to cause various graphical artifacts, especially on Windows. Use at your own risk.
|
||||||
- In case you don't have a GPU available, there are software rendered releases available for Windows and macOS
|
- In case you don't have a GPU available, there are software rendered releases available for Windows and macOS
|
||||||
- **RAM**: 256MB, more may be required for more complicated analysis
|
- **RAM**: ~50MiB, more is required for more complex analysis
|
||||||
- **Storage**: 150MB
|
- **Storage**: ~100MiB
|
||||||
|
|
||||||
## Installing
|
## Installing
|
||||||
|
|
||||||
|
|
@ -342,8 +361,10 @@ Information on how to install ImHex can be found in the [Install](/INSTALL.md) g
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
To compile ImHex on any platform, GCC (or Clang) is required with a version that supports C++23 or higher.
|
To compile ImHex on any platform, GCC (or Clang) is required with a version that supports C++23 or higher.
|
||||||
On macOS, Clang is also required to compile some ObjC code.
|
Windows and Linux releases are being built using latest available GCC.
|
||||||
All releases are being built using latest available GCC.
|
MacOS releases are being built using latest available LLVM Clang.
|
||||||
|
|
||||||
|
Important to note is, the MSVC and AppleClang compilers are both **NOT** supported since they're both generally severely outdated and lack features GCC and LLVM Clang have.
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Many dependencies are bundled into the repository using submodules so make sure to clone it using the `--recurse-submodules` option.
|
> Many dependencies are bundled into the repository using submodules so make sure to clone it using the `--recurse-submodules` option.
|
||||||
|
|
@ -354,9 +375,20 @@ For more information, check out the [Compiling](/dist/compiling) guide.
|
||||||
## Contributing
|
## Contributing
|
||||||
See [Contributing](/CONTRIBUTING.md)
|
See [Contributing](/CONTRIBUTING.md)
|
||||||
|
|
||||||
## Plugin development
|
|
||||||
|
|
||||||
|
## Plugin development
|
||||||
To develop plugins for ImHex, use the following template project to get started. You then have access to the entirety of libimhex as well as the ImHex API and the Content Registry to interact with ImHex or to add new content.
|
To develop plugins for ImHex, use the following template project to get started. You then have access to the entirety of libimhex as well as the ImHex API and the Content Registry to interact with ImHex or to add new content.
|
||||||
|
To build a plugin, you will need to use our SDK
|
||||||
|
|
||||||
|
### Getting the SDK locally
|
||||||
|
You can build the SDK by compiling ImHex like this:
|
||||||
|
- `cmake -G Ninja -DIMHEX_BUNDLE_PLUGIN_SDK=ON -B build`
|
||||||
|
- `cd build`
|
||||||
|
- `DESTDIR=install ninja install`
|
||||||
|
The SDK will then be available at `install/usr/local/share/imhex/sdk`. You will need to set the variable `IMHEX_SDK_PATH` to that (absolute) path.
|
||||||
|
|
||||||
|
### Getting the SDK in a Github Actions CI
|
||||||
|
You can use [this action](https://github.com/WerWolv/imhex-download-sdk) to automatically download the SDK to your Github Runner
|
||||||
- [ImHex Plugin Template](https://github.com/WerWolv/ImHex-Plugin-Template)
|
- [ImHex Plugin Template](https://github.com/WerWolv/ImHex-Plugin-Template)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -364,9 +396,10 @@ To develop plugins for ImHex, use the following template project to get started.
|
||||||
|
|
||||||
### Contributors
|
### Contributors
|
||||||
|
|
||||||
|
- [AxCut](https://github.com/paxcut) for a gigantic amount of contributions to the Pattern Text Editor and tons of other parts of ImHex
|
||||||
- [iTrooz](https://github.com/iTrooz) for getting ImHex onto the Web as well as hundreds of contributions in every part of the project
|
- [iTrooz](https://github.com/iTrooz) for getting ImHex onto the Web as well as hundreds of contributions in every part of the project
|
||||||
- [jumanji144](https://github.com/jumanji144) for huge contributions to the Pattern Language and ImHex's infrastructure
|
- [jumanji144](https://github.com/jumanji144) for huge contributions to the Pattern Language and ImHex's infrastructure
|
||||||
- [Mary](https://github.com/marysaka) for her immense help porting ImHex to MacOS and help during development
|
- [Mary](https://github.com/marysaka) for her immense help porting ImHex to macOS and help during development
|
||||||
- [Roblabla](https://github.com/Roblabla) for adding MSI Installer support to ImHex
|
- [Roblabla](https://github.com/Roblabla) for adding MSI Installer support to ImHex
|
||||||
- [Mailaender](https://github.com/Mailaender) for getting ImHex onto Flathub
|
- [Mailaender](https://github.com/Mailaender) for getting ImHex onto Flathub
|
||||||
- Everybody else who has reported issues on Discord or GitHub that I had great conversations with :)
|
- Everybody else who has reported issues on Discord or GitHub that I had great conversations with :)
|
||||||
|
|
@ -397,3 +430,18 @@ Notable exceptions to this are the following parts which are under the LGPLv2.1
|
||||||
- **/plugins/ui**: The UI plugin library that contains some common UI elements that can be used by other plugins
|
- **/plugins/ui**: The UI plugin library that contains some common UI elements that can be used by other plugins
|
||||||
|
|
||||||
The reason for this is to allow for proprietary plugins to be developed for ImHex.
|
The reason for this is to allow for proprietary plugins to be developed for ImHex.
|
||||||
|
|
||||||
|
### Code Signing Policy
|
||||||
|
|
||||||
|
Free code signing provided by [SignPath.io](https://about.signpath.io/),
|
||||||
|
certificate by [SignPath Foundation](https://signpath.org/).
|
||||||
|
|
||||||
|
This program will not transfer any information to other networked systems
|
||||||
|
unless specifically requested by the user or the person installing or
|
||||||
|
operating it.
|
||||||
|
|
||||||
|
#### People with direct push access
|
||||||
|
- [WerWolv](https://github.com/WerWolv)
|
||||||
|
- [iTrooz](https://github.com/iTrooz)
|
||||||
|
- [jumanji144](https://github.com/jumanji144)
|
||||||
|
- [AxCut](https://github.com/paxcut)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,100 @@
|
||||||
|
# Some libraries we use set the BUILD_SHARED_LIBS variable to ON, which causes CMake to
|
||||||
|
# display a warning about options being set using set() instead of option().
|
||||||
|
# Explicitly set the policy to NEW to suppress the warning.
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
||||||
|
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0141 NEW)
|
||||||
|
|
||||||
|
if (POLICY CMP0177)
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0177 OLD)
|
||||||
|
cmake_policy(SET CMP0177 OLD)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
function(getTarget target type)
|
||||||
|
get_target_property(IMPORTED_TARGET ${target} IMPORTED)
|
||||||
|
if (IMPORTED_TARGET)
|
||||||
|
set(${type} INTERFACE PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${type} PRIVATE PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addCFlag)
|
||||||
|
if (ARGC EQUAL 1)
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:C>:${ARGV0}>)
|
||||||
|
elseif (ARGC EQUAL 2)
|
||||||
|
getTarget(${ARGV1} TYPE)
|
||||||
|
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:C>:${ARGV0}>)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addCXXFlag)
|
||||||
|
if (ARGC EQUAL 1)
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:${ARGV0}>)
|
||||||
|
elseif (ARGC EQUAL 2)
|
||||||
|
getTarget(${ARGV1} TYPE)
|
||||||
|
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:CXX>:${ARGV0}>)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addObjCFlag)
|
||||||
|
if (ARGC EQUAL 1)
|
||||||
|
add_compile_options($<$<COMPILE_LANGUAGE:OBJC>:${ARGV0}>)
|
||||||
|
elseif (ARGC EQUAL 2)
|
||||||
|
getTarget(${ARGV1} TYPE)
|
||||||
|
target_compile_options(${ARGV1} ${TYPE} $<$<COMPILE_LANGUAGE:OBJC>:${ARGV0}>)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addLinkerFlag)
|
||||||
|
if (ARGC EQUAL 1)
|
||||||
|
add_link_options(${ARGV0})
|
||||||
|
elseif (ARGC EQUAL 2)
|
||||||
|
getTarget(${ARGV1} TYPE)
|
||||||
|
target_link_options(${ARGV1} ${TYPE} ${ARGV0})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addCCXXFlag)
|
||||||
|
addCFlag(${ARGV0} ${ARGV1})
|
||||||
|
addCXXFlag(${ARGV0} ${ARGV1})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addCommonFlag)
|
||||||
|
addCFlag(${ARGV0} ${ARGV1})
|
||||||
|
addCXXFlag(${ARGV0} ${ARGV1})
|
||||||
|
addObjCFlag(${ARGV0} ${ARGV1})
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(addCppCheck target)
|
||||||
|
if (NOT IMHEX_ENABLE_CPPCHECK)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_program(cppcheck_exe NAMES cppcheck REQUIRED)
|
||||||
|
if (NOT cppcheck_exe)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(target_build_dir $<TARGET_FILE_DIR:${target}>)
|
||||||
|
set(cppcheck_opts
|
||||||
|
--enable=all
|
||||||
|
--inline-suppr
|
||||||
|
--quiet
|
||||||
|
--std=c++23
|
||||||
|
--check-level=exhaustive
|
||||||
|
--error-exitcode=10
|
||||||
|
--suppressions-list=${CMAKE_SOURCE_DIR}/dist/cppcheck.supp
|
||||||
|
--checkers-report=${target_build_dir}/cppcheck-report.txt
|
||||||
|
)
|
||||||
|
set_target_properties(${target} PROPERTIES
|
||||||
|
CXX_CPPCHECK "${cppcheck_exe};${cppcheck_opts}"
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Disable deprecated warnings" FORCE)
|
||||||
|
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
|
|
||||||
if(IMHEX_STRIP_RELEASE)
|
if(IMHEX_STRIP_RELEASE)
|
||||||
|
|
@ -59,7 +156,9 @@ macro(detectOS)
|
||||||
set(CMAKE_INSTALL_LIBDIR ".")
|
set(CMAKE_INSTALL_LIBDIR ".")
|
||||||
set(PLUGINS_INSTALL_LOCATION "plugins")
|
set(PLUGINS_INSTALL_LOCATION "plugins")
|
||||||
add_compile_definitions(WIN32_LEAN_AND_MEAN)
|
add_compile_definitions(WIN32_LEAN_AND_MEAN)
|
||||||
|
add_compile_definitions(NOMINMAX)
|
||||||
add_compile_definitions(UNICODE)
|
add_compile_definitions(UNICODE)
|
||||||
|
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
add_compile_definitions(OS_MACOS)
|
add_compile_definitions(OS_MACOS)
|
||||||
set(CMAKE_INSTALL_BINDIR ".")
|
set(CMAKE_INSTALL_BINDIR ".")
|
||||||
|
|
@ -76,15 +175,11 @@ macro(detectOS)
|
||||||
endif()
|
endif()
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
if(IMHEX_PLUGINS_IN_SHARE)
|
set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins")
|
||||||
set(PLUGINS_INSTALL_LOCATION "share/imhex/plugins")
|
|
||||||
else()
|
|
||||||
set(PLUGINS_INSTALL_LOCATION "${CMAKE_INSTALL_LIBDIR}/imhex/plugins")
|
|
||||||
|
|
||||||
# Add System plugin location for plugins to be loaded from
|
# Add System plugin location for plugins to be loaded from
|
||||||
# IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release
|
# IMPORTANT: This does not work for Sandboxed or portable builds such as the Flatpak or AppImage release
|
||||||
add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex")
|
add_compile_definitions(SYSTEM_PLUGINS_LOCATION="${CMAKE_INSTALL_FULL_LIBDIR}/imhex")
|
||||||
endif()
|
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
message(FATAL_ERROR "Unknown / unsupported system!")
|
message(FATAL_ERROR "Unknown / unsupported system!")
|
||||||
|
|
@ -106,11 +201,14 @@ macro(configurePackingResources)
|
||||||
set(CPACK_GENERATOR "WIX")
|
set(CPACK_GENERATOR "WIX")
|
||||||
set(CPACK_PACKAGE_NAME "ImHex")
|
set(CPACK_PACKAGE_NAME "ImHex")
|
||||||
set(CPACK_PACKAGE_VENDOR "WerWolv")
|
set(CPACK_PACKAGE_VENDOR "WerWolv")
|
||||||
|
set(CPACK_WIX_VERSION 4)
|
||||||
set(CPACK_WIX_UPGRADE_GUID "05000E99-9659-42FD-A1CF-05C554B39285")
|
set(CPACK_WIX_UPGRADE_GUID "05000E99-9659-42FD-A1CF-05C554B39285")
|
||||||
set(CPACK_WIX_PRODUCT_ICON "${PROJECT_SOURCE_DIR}/resources/dist/windows/icon.ico")
|
set(CPACK_WIX_PRODUCT_ICON "${PROJECT_SOURCE_DIR}/resources/dist/windows/icon.ico")
|
||||||
set(CPACK_WIX_UI_BANNER "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_banner.png")
|
set(CPACK_WIX_UI_BANNER "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_banner.png")
|
||||||
set(CPACK_WIX_UI_DIALOG "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_dialog.png")
|
set(CPACK_WIX_UI_DIALOG "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_dialog.png")
|
||||||
set(CPACK_WIX_CULTURES "en-US;de-DE;ja-JP;it-IT;pt-BR;zh-CN;zh-TW")
|
set(CPACK_WIX_CULTURES "en-US;de-DE;ja-JP;it-IT;pt-BR;zh-CN;zh-TW;ru-RU")
|
||||||
|
set(CPACK_WIX_PATCH_FILE "${PROJECT_SOURCE_DIR}/resources/dist/windows/wix_patch.xml")
|
||||||
|
|
||||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ImHex")
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "ImHex")
|
||||||
set_property(INSTALL "$<TARGET_FILE_NAME:main>"
|
set_property(INSTALL "$<TARGET_FILE_NAME:main>"
|
||||||
PROPERTY CPACK_START_MENU_SHORTCUTS "ImHex"
|
PROPERTY CPACK_START_MENU_SHORTCUTS "ImHex"
|
||||||
|
|
@ -189,6 +287,17 @@ macro(createPackage)
|
||||||
list(APPEND PLUGIN_TARGET_FILES "$<TARGET_FILE:${plugin}>")
|
list(APPEND PLUGIN_TARGET_FILES "$<TARGET_FILE:${plugin}>")
|
||||||
endforeach ()
|
endforeach ()
|
||||||
|
|
||||||
|
if (DEFINED VCPKG_TARGET_TRIPLET)
|
||||||
|
set(VCPKG_DEPS_FOLDER "")
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
set(VCPKG_DEPS_FOLDER "${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/debug/bin")
|
||||||
|
else()
|
||||||
|
set(VCPKG_DEPS_FOLDER "${CMAKE_BINARY_DIR}/vcpkg_installed/${VCPKG_TARGET_TRIPLET}/bin")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(CODE "set(VCPKG_DEPS_FOLDER \"${VCPKG_DEPS_FOLDER}\")")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Grab all dynamically linked dependencies.
|
# Grab all dynamically linked dependencies.
|
||||||
install(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
|
install(CODE "set(CMAKE_INSTALL_BINDIR \"${CMAKE_INSTALL_BINDIR}\")")
|
||||||
install(CODE "set(PLUGIN_TARGET_FILES \"${PLUGIN_TARGET_FILES}\")")
|
install(CODE "set(PLUGIN_TARGET_FILES \"${PLUGIN_TARGET_FILES}\")")
|
||||||
|
|
@ -202,10 +311,15 @@ macro(createPackage)
|
||||||
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
|
POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
|
||||||
)
|
)
|
||||||
|
|
||||||
if(_c_deps_FILENAMES)
|
if(_c_deps_FILENAMES AND _c_deps AND NOT (_c_deps STREQUAL ""))
|
||||||
message(WARNING "Conflicting dependencies for library: \"${_c_deps}\"!")
|
message(WARNING "Conflicting dependencies for library: \"${_c_deps}\"!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (DEFINED VCPKG_DEPS_FOLDER)
|
||||||
|
file(GLOB VCPKG_DEPS "${VCPKG_DEPS_FOLDER}/*.dll")
|
||||||
|
list(APPEND _r_deps ${VCPKG_DEPS})
|
||||||
|
endif()
|
||||||
|
|
||||||
foreach(_file ${_r_deps})
|
foreach(_file ${_r_deps})
|
||||||
file(INSTALL
|
file(INSTALL
|
||||||
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}"
|
||||||
|
|
@ -216,26 +330,20 @@ macro(createPackage)
|
||||||
endforeach()
|
endforeach()
|
||||||
]])
|
]])
|
||||||
|
|
||||||
downloadImHexPatternsFiles("./")
|
downloadImHexPatternsFiles(".")
|
||||||
elseif(UNIX AND NOT APPLE)
|
elseif(UNIX AND NOT APPLE)
|
||||||
|
|
||||||
set_target_properties(libimhex PROPERTIES SOVERSION ${IMHEX_VERSION})
|
set_target_properties(libimhex PROPERTIES SOVERSION ${IMHEX_VERSION})
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
|
configure_file(${IMHEX_BASE_FOLDER}/dist/DEBIAN/control.in ${CMAKE_BINARY_DIR}/DEBIAN/control)
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/imhex)
|
install(FILES ${IMHEX_BASE_FOLDER}/LICENSE DESTINATION ${CMAKE_INSTALL_PREFIX}/share/licenses/imhex)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
install(FILES ${IMHEX_BASE_FOLDER}/dist/imhex.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/imhex.mime.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages RENAME imhex.xml)
|
install(FILES ${IMHEX_BASE_FOLDER}/dist/imhex.mime.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/mime/packages RENAME imhex.xml)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.png)
|
install(FILES ${IMHEX_BASE_FOLDER}/resources/icon.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps RENAME imhex.svg)
|
||||||
downloadImHexPatternsFiles("./share/imhex")
|
downloadImHexPatternsFiles("./share/imhex")
|
||||||
|
|
||||||
# install AppStream file
|
# install AppStream file
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/dist/net.werwolv.imhex.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
|
install(FILES ${IMHEX_BASE_FOLDER}/dist/net.werwolv.ImHex.metainfo.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
|
||||||
|
|
||||||
# install symlink for the old standard name
|
|
||||||
file(CREATE_LINK net.werwolv.imhex.metainfo.xml ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml SYMBOLIC)
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/net.werwolv.imhex.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/metainfo)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
|
|
@ -249,6 +357,7 @@ macro(createPackage)
|
||||||
|
|
||||||
# Fix rpath
|
# Fix rpath
|
||||||
install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\" $<TARGET_FILE:main>)")
|
install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\" $<TARGET_FILE:main>)")
|
||||||
|
install(CODE "execute_process(COMMAND ${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@executable_path/../Frameworks/\" $<TARGET_FILE:updater>)")
|
||||||
|
|
||||||
add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/MacOS/plugins")
|
add_custom_target(build-time-make-plugins-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/MacOS/plugins")
|
||||||
add_custom_target(build-time-make-resources-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/Resources")
|
add_custom_target(build-time-make-resources-directory ALL COMMAND ${CMAKE_COMMAND} -E make_directory "${IMHEX_BUNDLE_PATH}/Contents/Resources")
|
||||||
|
|
@ -257,6 +366,16 @@ macro(createPackage)
|
||||||
|
|
||||||
install(FILES ${IMHEX_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources")
|
install(FILES ${IMHEX_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources")
|
||||||
install(TARGETS main BUNDLE DESTINATION ".")
|
install(TARGETS main BUNDLE DESTINATION ".")
|
||||||
|
install(TARGETS updater DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/MacOS")
|
||||||
|
install(
|
||||||
|
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.sh
|
||||||
|
DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/MacOS/cli"
|
||||||
|
RENAME imhex
|
||||||
|
PERMISSIONS
|
||||||
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||||
|
GROUP_READ GROUP_EXECUTE
|
||||||
|
WORLD_READ WORLD_EXECUTE
|
||||||
|
)
|
||||||
|
|
||||||
# Update library references to make the bundle portable
|
# Update library references to make the bundle portable
|
||||||
postprocess_bundle(imhex_all main)
|
postprocess_bundle(imhex_all main)
|
||||||
|
|
@ -287,6 +406,28 @@ macro(createPackage)
|
||||||
if (TARGET main-forwarder)
|
if (TARGET main-forwarder)
|
||||||
install(TARGETS main-forwarder BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS main-forwarder BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
install(
|
||||||
|
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.bat
|
||||||
|
DESTINATION ${CMAKE_INSTALL_BINDIR}/cli
|
||||||
|
RENAME imhex.bat
|
||||||
|
PERMISSIONS
|
||||||
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||||
|
GROUP_READ GROUP_EXECUTE
|
||||||
|
WORLD_READ WORLD_EXECUTE
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
install(
|
||||||
|
FILES ${IMHEX_BASE_FOLDER}/dist/cli/imhex.sh
|
||||||
|
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/imhex
|
||||||
|
RENAME imhex
|
||||||
|
PERMISSIONS
|
||||||
|
OWNER_READ OWNER_WRITE OWNER_EXECUTE
|
||||||
|
GROUP_READ GROUP_EXECUTE
|
||||||
|
WORLD_READ WORLD_EXECUTE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (IMHEX_GENERATE_PACKAGE)
|
if (IMHEX_GENERATE_PACKAGE)
|
||||||
|
|
@ -309,8 +450,14 @@ endfunction()
|
||||||
macro(configureCMake)
|
macro(configureCMake)
|
||||||
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
|
message(STATUS "Configuring ImHex v${IMHEX_VERSION}")
|
||||||
|
|
||||||
|
if (DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
|
message(STATUS "Using toolchain file: \"${CMAKE_TOOLCHAIN_FILE}\"")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON CACHE BOOL "Enable position independent code for all targets" FORCE)
|
||||||
|
|
||||||
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$<CONFIG:Debug,RelWithDebInfo>:Embedded>")
|
||||||
|
|
||||||
# Configure use of recommended build tools
|
# Configure use of recommended build tools
|
||||||
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
|
if (IMHEX_USE_DEFAULT_BUILD_SETTINGS)
|
||||||
message(STATUS "Configuring CMake to use recommended build tools...")
|
message(STATUS "Configuring CMake to use recommended build tools...")
|
||||||
|
|
@ -343,9 +490,9 @@ macro(configureCMake)
|
||||||
if (LD_LLD_PATH)
|
if (LD_LLD_PATH)
|
||||||
set(CMAKE_LINKER ${LD_LLD_PATH})
|
set(CMAKE_LINKER ${LD_LLD_PATH})
|
||||||
|
|
||||||
if (NOT XCODE)
|
if (NOT XCODE AND NOT MSVC)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld")
|
add_link_options("-fuse-ld=lld")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld")
|
add_link_options("-fuse-ld=lld")
|
||||||
endif()
|
endif()
|
||||||
else ()
|
else ()
|
||||||
message(WARNING "lld not found, using default linker!")
|
message(WARNING "lld not found, using default linker!")
|
||||||
|
|
@ -357,28 +504,6 @@ macro(configureCMake)
|
||||||
message(WARNING "ninja not found, using default generator!")
|
message(WARNING "ninja not found, using default generator!")
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Enable LTO if desired and supported
|
|
||||||
if (IMHEX_ENABLE_LTO)
|
|
||||||
include(CheckIPOSupported)
|
|
||||||
|
|
||||||
check_ipo_supported(RESULT result OUTPUT output_error)
|
|
||||||
if (result)
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
|
||||||
message(STATUS "LTO enabled!")
|
|
||||||
else ()
|
|
||||||
message(WARNING "LTO is not supported: ${output_error}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Some libraries we use set the BUILD_SHARED_LIBS variable to ON, which causes CMake to
|
|
||||||
# display a warning about options being set using set() instead of option().
|
|
||||||
# Explicitly set the policy to NEW to suppress the warning.
|
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
|
|
||||||
|
|
||||||
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
|
|
||||||
|
|
||||||
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Disable deprecated warnings" FORCE)
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
function(configureProject)
|
function(configureProject)
|
||||||
|
|
@ -391,6 +516,19 @@ function(configureProject)
|
||||||
else()
|
else()
|
||||||
set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
|
set(IMHEX_MAIN_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Enable LTO if desired and supported
|
||||||
|
if (IMHEX_ENABLE_LTO)
|
||||||
|
include(CheckIPOSupported)
|
||||||
|
|
||||||
|
check_ipo_supported(RESULT result OUTPUT output_error)
|
||||||
|
if (result OR WIN32)
|
||||||
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION $<$<CONFIG:Release,RelWithDebInfo,MinSizeRel>:ON>)
|
||||||
|
message(STATUS "LTO enabled!")
|
||||||
|
else ()
|
||||||
|
message(WARNING "LTO is not supported: ${output_error}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
macro(setDefaultBuiltTypeIfUnset)
|
macro(setDefaultBuiltTypeIfUnset)
|
||||||
|
|
@ -408,6 +546,10 @@ function(loadVersion version plain_version)
|
||||||
string(REPLACE ".WIP" "" read_version_plain ${read_version})
|
string(REPLACE ".WIP" "" read_version_plain ${read_version})
|
||||||
set(${version} ${read_version} PARENT_SCOPE)
|
set(${version} ${read_version} PARENT_SCOPE)
|
||||||
set(${plain_version} ${read_version_plain} PARENT_SCOPE)
|
set(${plain_version} ${read_version_plain} PARENT_SCOPE)
|
||||||
|
|
||||||
|
if (read_version MATCHES ".+\.WIP")
|
||||||
|
set(IMHEX_PATTERNS_PULL_MASTER ON PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(detectBadClone)
|
function(detectBadClone)
|
||||||
|
|
@ -434,6 +576,8 @@ function(verifyCompiler)
|
||||||
message(FATAL_ERROR "ImHex requires GCC 12.0.0 or newer. Please use the latest GCC version.")
|
message(FATAL_ERROR "ImHex requires GCC 12.0.0 or newer. Please use the latest GCC version.")
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "17.0.0")
|
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "17.0.0")
|
||||||
message(FATAL_ERROR "ImHex requires Clang 17.0.0 or newer. Please use the latest Clang version.")
|
message(FATAL_ERROR "ImHex requires Clang 17.0.0 or newer. Please use the latest Clang version.")
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
|
||||||
elseif (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
|
elseif (NOT (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
|
||||||
message(FATAL_ERROR "ImHex can only be compiled with GCC or Clang. ${CMAKE_CXX_COMPILER_ID} is not supported.")
|
message(FATAL_ERROR "ImHex can only be compiled with GCC or Clang. ${CMAKE_CXX_COMPILER_ID} is not supported.")
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -442,7 +586,9 @@ endfunction()
|
||||||
macro(detectBundledPlugins)
|
macro(detectBundledPlugins)
|
||||||
file(GLOB PLUGINS_DIRS "plugins/*")
|
file(GLOB PLUGINS_DIRS "plugins/*")
|
||||||
|
|
||||||
if (NOT DEFINED IMHEX_INCLUDE_PLUGINS)
|
if (IMHEX_INCLUDE_PLUGINS)
|
||||||
|
set(PLUGINS ${IMHEX_INCLUDE_PLUGINS})
|
||||||
|
else()
|
||||||
foreach(PLUGIN_DIR ${PLUGINS_DIRS})
|
foreach(PLUGIN_DIR ${PLUGINS_DIRS})
|
||||||
if (EXISTS "${PLUGIN_DIR}/CMakeLists.txt")
|
if (EXISTS "${PLUGIN_DIR}/CMakeLists.txt")
|
||||||
get_filename_component(PLUGIN_NAME ${PLUGIN_DIR} NAME)
|
get_filename_component(PLUGIN_NAME ${PLUGIN_DIR} NAME)
|
||||||
|
|
@ -451,8 +597,6 @@ macro(detectBundledPlugins)
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
else()
|
|
||||||
set(PLUGINS ${IMHEX_INCLUDE_PLUGINS})
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach(PLUGIN_NAME ${PLUGINS})
|
foreach(PLUGIN_NAME ${PLUGINS})
|
||||||
|
|
@ -463,9 +607,13 @@ macro(detectBundledPlugins)
|
||||||
message(FATAL_ERROR "No bundled plugins enabled")
|
message(FATAL_ERROR "No bundled plugins enabled")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT ("builtin" IN_LIST PLUGINS))
|
set(REQUIRED_PLUGINS builtin fonts ui)
|
||||||
message(FATAL_ERROR "The 'builtin' plugin is required for ImHex to work!")
|
foreach(PLUGIN ${REQUIRED_PLUGINS})
|
||||||
endif ()
|
list(FIND PLUGINS ${PLUGIN} PLUGIN_INDEX)
|
||||||
|
if (PLUGIN_INDEX EQUAL -1)
|
||||||
|
message(FATAL_ERROR "Required plugin '${PLUGIN}' is not enabled!")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(setVariableInParent variable value)
|
macro(setVariableInParent variable value)
|
||||||
|
|
@ -486,52 +634,61 @@ function(downloadImHexPatternsFiles dest)
|
||||||
set(PATTERNS_BRANCH ImHex-v${IMHEX_VERSION})
|
set(PATTERNS_BRANCH ImHex-v${IMHEX_VERSION})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
FetchContent_Declare(
|
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/ImHex-Patterns")
|
||||||
imhex_patterns
|
install(CODE "set(PATTERNS_BRANCH \"${PATTERNS_BRANCH}\")")
|
||||||
GIT_REPOSITORY https://github.com/WerWolv/ImHex-Patterns.git
|
install(CODE "set(imhex_patterns_SOURCE_DIR \"${imhex_patterns_SOURCE_DIR}\")")
|
||||||
GIT_TAG origin/master
|
install(CODE [[
|
||||||
)
|
message(STATUS "Downloading ImHex patterns from branch '${PATTERNS_BRANCH}'...")
|
||||||
|
if (NOT EXISTS "${imhex_patterns_SOURCE_DIR}")
|
||||||
message(STATUS "Downloading ImHex-Patterns repo branch ${PATTERNS_BRANCH}...")
|
file(MAKE_DIRECTORY "${imhex_patterns_SOURCE_DIR}")
|
||||||
FetchContent_MakeAvailable(imhex_patterns)
|
|
||||||
message(STATUS "Finished downloading ImHex-Patterns")
|
execute_process(
|
||||||
|
COMMAND
|
||||||
|
git clone --recurse-submodules --branch ${PATTERNS_BRANCH} https://github.com/WerWolv/ImHex-Patterns.git "${imhex_patterns_SOURCE_DIR}"
|
||||||
|
COMMAND_ERROR_IS_FATAL ANY
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
]])
|
||||||
else ()
|
else ()
|
||||||
set(imhex_patterns_SOURCE_DIR "")
|
set(imhex_patterns_SOURCE_DIR "")
|
||||||
|
|
||||||
# Maybe patterns are cloned to a subdirectory
|
# Maybe patterns are cloned to a subdirectory
|
||||||
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
|
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
|
||||||
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns")
|
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ImHex-Patterns")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Or a sibling directory
|
# Or a sibling directory
|
||||||
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
|
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
|
||||||
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ImHex-Patterns")
|
set(imhex_patterns_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ImHex-Patterns")
|
||||||
endif()
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (NOT EXISTS ${imhex_patterns_SOURCE_DIR})
|
install(CODE "set(imhex_patterns_SOURCE_DIR \"${imhex_patterns_SOURCE_DIR}\")")
|
||||||
message(WARNING "Failed to locate ImHex-Patterns repository, some resources will be missing during install!")
|
|
||||||
elseif(XCODE)
|
|
||||||
# The Xcode build has multiple configurations, which each need a copy of these files
|
|
||||||
file(GLOB_RECURSE sourceFilePaths LIST_DIRECTORIES NO CONFIGURE_DEPENDS RELATIVE "${imhex_patterns_SOURCE_DIR}"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/constants/*"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/encodings/*"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/includes/*"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/patterns/*"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/magic/*"
|
|
||||||
"${imhex_patterns_SOURCE_DIR}/nodes/*"
|
|
||||||
)
|
|
||||||
list(FILTER sourceFilePaths EXCLUDE REGEX "_schema.json$")
|
|
||||||
|
|
||||||
foreach(relativePath IN LISTS sourceFilePaths)
|
if(XCODE)
|
||||||
file(GENERATE OUTPUT "${dest}/${relativePath}" INPUT "${imhex_patterns_SOURCE_DIR}/${relativePath}")
|
install(CODE [[
|
||||||
endforeach()
|
# The Xcode build has multiple configurations, which each need a copy of these files
|
||||||
|
file(GLOB_RECURSE sourceFilePaths LIST_DIRECTORIES NO CONFIGURE_DEPENDS RELATIVE "${imhex_patterns_SOURCE_DIR}"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/constants/*"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/encodings/*"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/includes/*"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/patterns/*"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/magic/*"
|
||||||
|
"${imhex_patterns_SOURCE_DIR}/nodes/*"
|
||||||
|
)
|
||||||
|
list(FILTER sourceFilePaths EXCLUDE REGEX "_schema.json$")
|
||||||
|
|
||||||
|
foreach(relativePath IN LISTS sourceFilePaths)
|
||||||
|
file(GENERATE OUTPUT "${dest}/${relativePath}" INPUT "${imhex_patterns_SOURCE_DIR}/${relativePath}")
|
||||||
|
endforeach()
|
||||||
|
]])
|
||||||
else()
|
else()
|
||||||
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic nodes)
|
if (NOT (imhex_patterns_SOURCE_DIR STREQUAL ""))
|
||||||
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
|
set(PATTERNS_FOLDERS_TO_INSTALL constants encodings includes patterns magic nodes)
|
||||||
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "${dest}" PATTERN "**/_schema.json" EXCLUDE)
|
foreach (FOLDER ${PATTERNS_FOLDERS_TO_INSTALL})
|
||||||
endforeach ()
|
install(DIRECTORY "${imhex_patterns_SOURCE_DIR}/${FOLDER}" DESTINATION "${dest}" PATTERN "**/_schema.json" EXCLUDE)
|
||||||
|
endforeach ()
|
||||||
|
endif()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
@ -553,71 +710,125 @@ macro(setupDebugCompressionFlag)
|
||||||
elseif (COMPRESS_AVAILABLE_COMPILER AND COMPRESS_AVAILABLE_LINKER)
|
elseif (COMPRESS_AVAILABLE_COMPILER AND COMPRESS_AVAILABLE_LINKER)
|
||||||
message("Using default compression for debug info because both compiler and linker support it")
|
message("Using default compression for debug info because both compiler and linker support it")
|
||||||
set(DEBUG_COMPRESSION_FLAG "-gz" CACHE STRING "Cache to use for debug info compression")
|
set(DEBUG_COMPRESSION_FLAG "-gz" CACHE STRING "Cache to use for debug info compression")
|
||||||
|
else()
|
||||||
|
set(DEBUG_COMPRESSION_FLAG "" CACHE STRING "Cache to use for debug info compression")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} ${DEBUG_COMPRESSION_FLAG}")
|
addCommonFlag(${DEBUG_COMPRESSION_FLAG})
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(setupCompilerFlags target)
|
macro(setupCompilerFlags target)
|
||||||
# IMHEX_COMMON_FLAGS: flags common for C, C++, Objective C, etc.. compilers
|
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
addCommonFlag("/W4" ${target})
|
||||||
|
addCommonFlag("/wd4127" ${target}) # conditional expression is constant
|
||||||
|
addCommonFlag("/wd4242" ${target}) # 'identifier': conversion from 'type1' to 'type2', possible loss of data
|
||||||
|
addCommonFlag("/wd4244" ${target}) # 'conversion': conversion from 'type1' to 'type2', possible loss of data
|
||||||
|
addCommonFlag("/wd4267" ${target}) # 'var': conversion from 'size_t' to 'type', possible loss of data
|
||||||
|
addCommonFlag("/wd4305" ${target}) # truncation from 'double' to 'float'
|
||||||
|
addCommonFlag("/wd4996" ${target}) # 'function': was declared deprecated
|
||||||
|
addCommonFlag("/wd5244" ${target}) # 'include' in the purview of module 'module' appears erroneous
|
||||||
|
|
||||||
|
if (IMHEX_STRICT_WARNINGS)
|
||||||
|
addCommonFlag("/WX" ${target})
|
||||||
|
endif()
|
||||||
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
|
addCommonFlag("-Wall" ${target})
|
||||||
|
addCommonFlag("-Wextra" ${target})
|
||||||
|
addCommonFlag("-Wpedantic" ${target})
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
||||||
# Define strict compilation flags
|
# Define strict compilation flags
|
||||||
if (IMHEX_STRICT_WARNINGS)
|
if (IMHEX_STRICT_WARNINGS)
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wall -Wextra -Wpedantic -Werror")
|
addCommonFlag("-Werror" ${target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (UNIX AND NOT APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -rdynamic")
|
addCommonFlag("-rdynamic" ${target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IMHEX_CXX_FLAGS "-fexceptions -frtti")
|
addCXXFlag("-fexceptions" ${target})
|
||||||
|
addCXXFlag("-frtti" ${target})
|
||||||
|
addCommonFlag("-fno-omit-frame-pointer" ${target})
|
||||||
|
|
||||||
# Disable some warnings
|
# Disable some warnings
|
||||||
set(IMHEX_C_CXX_FLAGS "-Wno-array-bounds -Wno-deprecated-declarations -Wno-unknown-pragmas")
|
addCCXXFlag("-Wno-array-bounds" ${target})
|
||||||
|
addCCXXFlag("-Wno-deprecated-declarations" ${target})
|
||||||
|
addCCXXFlag("-Wno-unknown-pragmas" ${target})
|
||||||
|
addCXXFlag("-Wno-include-angled-in-module-purview" ${target})
|
||||||
|
|
||||||
|
# Enable hardening flags
|
||||||
|
if (IMHEX_BUILD_HARDENING)
|
||||||
|
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
addCommonFlag("-U_FORTIFY_SOURCE" ${target})
|
||||||
|
addCommonFlag("-D_FORTIFY_SOURCE=3" ${target})
|
||||||
|
|
||||||
|
if (NOT EMSCRIPTEN)
|
||||||
|
addCommonFlag("-fstack-protector-strong" ${target})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
if (IMHEX_ENABLE_UNITY_BUILD AND WIN32)
|
if (WIN32)
|
||||||
set(IMHEX_COMMON_FLAGS "${IMHEX_COMMON_FLAGS} -Wa,-mbig-obj")
|
addLinkerFlag("-Wa,mbig-obj" ${target})
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE)
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND APPLE)
|
||||||
|
addCCXXFlag("-Wno-unknown-warning-option" ${target})
|
||||||
|
|
||||||
|
# On macOS, when using clang from Homebrew, properly setup the libc++ library path so
|
||||||
|
# it's using the one from Homebrew instead of the system one.
|
||||||
execute_process(COMMAND brew --prefix llvm OUTPUT_VARIABLE LLVM_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND brew --prefix llvm OUTPUT_VARIABLE LLVM_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
|
if (NOT LLVM_PREFIX STREQUAL "" AND ${CMAKE_CXX_COMPILER} STREQUAL "${LLVM_PREFIX}/bin/clang++")
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
|
||||||
set(IMHEX_C_CXX_FLAGS "-Wno-unknown-warning-option")
|
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
|
||||||
|
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -L${LLVM_PREFIX}/lib/c++")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
add_compile_definitions(_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
|
addCommonFlag("/bigobj" ${target})
|
||||||
|
addCFlag("/std:clatest" ${target})
|
||||||
|
addCXXFlag("/std:c++latest" ${target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Disable some warnings for gcc
|
# Disable some warnings for gcc
|
||||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||||
set(IMHEX_C_CXX_FLAGS "${IMHEX_C_CXX_FLAGS} -Wno-restrict -Wno-stringop-overread -Wno-stringop-overflow -Wno-dangling-reference")
|
addCCXXFlag("-Wno-restrict" ${target})
|
||||||
|
addCCXXFlag("-Wno-stringop-overread" ${target})
|
||||||
|
addCCXXFlag("-Wno-stringop-overflow" ${target})
|
||||||
|
addCCXXFlag("-Wno-dangling-reference" ${target})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Define emscripten-specific disabled warnings
|
# Define emscripten-specific disabled warnings
|
||||||
if (EMSCRIPTEN)
|
if (EMSCRIPTEN)
|
||||||
set(IMHEX_C_CXX_FLAGS "${IMHEX_C_CXX_FLAGS} -pthread -Wno-dollar-in-identifier-extension -Wno-pthreads-mem-growth")
|
addCCXXFlag("-pthread" ${target})
|
||||||
|
addCCXXFlag("-Wno-dollar-in-identifier-extension" ${target})
|
||||||
|
addCCXXFlag("-Wno-pthreads-mem-growth" ${target})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (IMHEX_COMPRESS_DEBUG_INFO)
|
if (IMHEX_COMPRESS_DEBUG_INFO)
|
||||||
setupDebugCompressionFlag()
|
setupDebugCompressionFlag()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Set actual CMake flags
|
|
||||||
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}")
|
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS}")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${IMHEX_COMMON_FLAGS} ${IMHEX_C_CXX_FLAGS} ${IMHEX_CXX_FLAGS}")
|
|
||||||
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} ${IMHEX_COMMON_FLAGS}")
|
|
||||||
|
|
||||||
# Only generate minimal debug information for stacktraces in RelWithDebInfo builds
|
# Only generate minimal debug information for stacktraces in RelWithDebInfo builds
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g1")
|
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g1")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
||||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
addCCXXFlag("-g1" ${target})
|
||||||
# Add flags for debug info in inline functions
|
endif()
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
|
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -gstatement-frontiers -ginline-points")
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
# Add flags for debug info in inline functions
|
||||||
|
addCCXXFlag("-gstatement-frontiers" ${target})
|
||||||
|
addCCXXFlag("-ginline-points" ${target})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
@ -635,11 +846,16 @@ macro(setUninstallTarget)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(addBundledLibraries)
|
macro(addBundledLibraries)
|
||||||
|
# Make sure the build is using vcpkg on Windows and Emscripten, otherwise none of these dependencies will be found
|
||||||
|
if (MSVC OR EMSCRIPTEN)
|
||||||
|
if (NOT (CMAKE_TOOLCHAIN_FILE MATCHES "vcpkg"))
|
||||||
|
message(AUTHOR_WARNING "Your current environment probably needs to be setup to use vcpkg, otherwise none of the dependencies will be found!")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(EXTERNAL_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/external")
|
set(EXTERNAL_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/external")
|
||||||
set(THIRD_PARTY_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/third_party")
|
set(THIRD_PARTY_LIBS_FOLDER "${CMAKE_CURRENT_SOURCE_DIR}/lib/third_party")
|
||||||
|
|
||||||
set(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
|
|
||||||
|
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/microtar EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/microtar EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
|
@ -649,6 +865,7 @@ macro(addBundledLibraries)
|
||||||
set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
|
set(FPHSA_NAME_MISMATCHED ON CACHE BOOL "")
|
||||||
|
|
||||||
if(NOT USE_SYSTEM_FMT)
|
if(NOT USE_SYSTEM_FMT)
|
||||||
|
set(FMT_INSTALL OFF CACHE BOOL "Disable install targets for libfmt" FORCE)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/fmt EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/fmt EXCLUDE_FROM_ALL)
|
||||||
set(FMT_LIBRARIES fmt::fmt-header-only)
|
set(FMT_LIBRARIES fmt::fmt-header-only)
|
||||||
else()
|
else()
|
||||||
|
|
@ -688,8 +905,19 @@ macro(addBundledLibraries)
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/lunasvg EXCLUDE_FROM_ALL)
|
||||||
set(LUNASVG_LIBRARIES lunasvg)
|
set(LUNASVG_LIBRARIES lunasvg)
|
||||||
else()
|
else()
|
||||||
find_package(LunaSVG REQUIRED)
|
find_package(lunasvg REQUIRED)
|
||||||
set(LUNASVG_LIBRARIES lunasvg)
|
set(LUNASVG_LIBRARIES lunasvg::lunasvg)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT USE_SYSTEM_MD4C)
|
||||||
|
set(BUILD_MD2HTML_EXECUTABLE OFF CACHE BOOL "Disable md2html executable" FORCE)
|
||||||
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/md4c EXCLUDE_FROM_ALL)
|
||||||
|
add_library(md4c_lib INTERFACE)
|
||||||
|
add_library(md4c::md4c ALIAS md4c_lib)
|
||||||
|
target_include_directories(md4c_lib INTERFACE ${THIRD_PARTY_LIBS_FOLDER}/md4c/src)
|
||||||
|
target_link_libraries(md4c_lib INTERFACE md4c)
|
||||||
|
else()
|
||||||
|
find_package(md4c REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT USE_SYSTEM_LLVM)
|
if (NOT USE_SYSTEM_LLVM)
|
||||||
|
|
@ -698,20 +926,8 @@ macro(addBundledLibraries)
|
||||||
find_package(LLVM REQUIRED Demangle)
|
find_package(LLVM REQUIRED Demangle)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT USE_SYSTEM_JTHREAD)
|
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/jthread EXCLUDE_FROM_ALL)
|
|
||||||
set(JTHREAD_LIBRARIES jthread)
|
|
||||||
else()
|
|
||||||
find_path(JOSUTTIS_JTHREAD_INCLUDE_DIRS "condition_variable_any2.hpp")
|
|
||||||
include_directories(${JOSUTTIS_JTHREAD_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
add_library(jthread INTERFACE)
|
|
||||||
target_include_directories(jthread INTERFACE ${JOSUTTIS_JTHREAD_INCLUDE_DIRS})
|
|
||||||
set(JTHREAD_LIBRARIES jthread)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (USE_SYSTEM_BOOST)
|
if (USE_SYSTEM_BOOST)
|
||||||
find_package(Boost REQUIRED)
|
find_package(Boost REQUIRED CONFIG COMPONENTS regex)
|
||||||
set(BOOST_LIBRARIES Boost::regex)
|
set(BOOST_LIBRARIES Boost::regex)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/boost ${CMAKE_CURRENT_BINARY_DIR}/boost EXCLUDE_FROM_ALL)
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/boost ${CMAKE_CURRENT_BINARY_DIR}/boost EXCLUDE_FROM_ALL)
|
||||||
|
|
@ -721,13 +937,12 @@ macro(addBundledLibraries)
|
||||||
set(LIBPL_BUILD_CLI_AS_EXECUTABLE OFF CACHE BOOL "" FORCE)
|
set(LIBPL_BUILD_CLI_AS_EXECUTABLE OFF CACHE BOOL "" FORCE)
|
||||||
set(LIBPL_ENABLE_PRECOMPILED_HEADERS ${IMHEX_ENABLE_PRECOMPILED_HEADERS} CACHE BOOL "" FORCE)
|
set(LIBPL_ENABLE_PRECOMPILED_HEADERS ${IMHEX_ENABLE_PRECOMPILED_HEADERS} CACHE BOOL "" FORCE)
|
||||||
|
|
||||||
if (WIN32)
|
set(LIBPL_SHARED_LIBRARY OFF CACHE BOOL "" FORCE)
|
||||||
set(LIBPL_SHARED_LIBRARY ON CACHE BOOL "" FORCE)
|
|
||||||
else()
|
|
||||||
set(LIBPL_SHARED_LIBRARY OFF CACHE BOOL "" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/pattern_language EXCLUDE_FROM_ALL)
|
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/pattern_language EXCLUDE_FROM_ALL)
|
||||||
|
add_subdirectory(${EXTERNAL_LIBS_FOLDER}/disassembler EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
|
add_subdirectory(${THIRD_PARTY_LIBS_FOLDER}/imgui)
|
||||||
|
|
||||||
if (LIBPL_SHARED_LIBRARY)
|
if (LIBPL_SHARED_LIBRARY)
|
||||||
install(
|
install(
|
||||||
|
|
@ -752,30 +967,6 @@ macro(addBundledLibraries)
|
||||||
|
|
||||||
find_package(mbedTLS 3.4.0 REQUIRED)
|
find_package(mbedTLS 3.4.0 REQUIRED)
|
||||||
find_package(Magic 5.39 REQUIRED)
|
find_package(Magic 5.39 REQUIRED)
|
||||||
|
|
||||||
if (NOT IMHEX_DISABLE_STACKTRACE)
|
|
||||||
if (WIN32)
|
|
||||||
message(STATUS "StackWalk enabled!")
|
|
||||||
set(LIBBACKTRACE_LIBRARIES DbgHelp.lib)
|
|
||||||
else ()
|
|
||||||
find_package(Backtrace)
|
|
||||||
if (${Backtrace_FOUND})
|
|
||||||
message(STATUS "Backtrace enabled! Header: ${Backtrace_HEADER}")
|
|
||||||
|
|
||||||
if (Backtrace_HEADER STREQUAL "backtrace.h")
|
|
||||||
set(LIBBACKTRACE_LIBRARIES ${Backtrace_LIBRARY})
|
|
||||||
set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
|
|
||||||
add_compile_definitions(BACKTRACE_HEADER=<${Backtrace_HEADER}>)
|
|
||||||
add_compile_definitions(HEX_HAS_BACKTRACE)
|
|
||||||
elseif (Backtrace_HEADER STREQUAL "execinfo.h")
|
|
||||||
set(LIBBACKTRACE_LIBRARIES ${Backtrace_LIBRARY})
|
|
||||||
set(LIBBACKTRACE_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR})
|
|
||||||
add_compile_definitions(BACKTRACE_HEADER=<${Backtrace_HEADER}>)
|
|
||||||
add_compile_definitions(HEX_HAS_EXECINFO)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
function(enableUnityBuild TARGET)
|
function(enableUnityBuild TARGET)
|
||||||
|
|
@ -784,71 +975,22 @@ function(enableUnityBuild TARGET)
|
||||||
endif ()
|
endif ()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(generatePDBs)
|
function(setSDKPaths)
|
||||||
if (NOT IMHEX_GENERATE_PDBS)
|
if (WIN32)
|
||||||
return()
|
set(SDK_PATH "./sdk" PARENT_SCOPE)
|
||||||
endif ()
|
elseif (APPLE)
|
||||||
|
set(SDK_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources/sdk" PARENT_SCOPE)
|
||||||
if (NOT WIN32 OR CMAKE_BUILD_TYPE STREQUAL "Debug")
|
else()
|
||||||
return()
|
set(SDK_PATH "share/imhex/sdk" PARENT_SCOPE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(FetchContent)
|
|
||||||
FetchContent_Declare(
|
|
||||||
cv2pdb
|
|
||||||
URL "https://github.com/rainers/cv2pdb/releases/download/v0.52/cv2pdb-0.52.zip"
|
|
||||||
DOWNLOAD_EXTRACT_TIMESTAMP ON
|
|
||||||
)
|
|
||||||
FetchContent_Populate(cv2pdb)
|
|
||||||
|
|
||||||
set(PDBS_TO_GENERATE main main-forwarder libimhex ${PLUGINS})
|
|
||||||
foreach (PDB ${PDBS_TO_GENERATE})
|
|
||||||
if (PDB STREQUAL "main")
|
|
||||||
set(GENERATED_PDB imhex)
|
|
||||||
elseif (PDB STREQUAL "main-forwarder")
|
|
||||||
set(GENERATED_PDB imhex-gui)
|
|
||||||
elseif (PDB STREQUAL "libimhex")
|
|
||||||
set(GENERATED_PDB libimhex)
|
|
||||||
else ()
|
|
||||||
set(GENERATED_PDB plugins/${PDB})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (IMHEX_REPLACE_DWARF_WITH_PDB)
|
|
||||||
set(PDB_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${GENERATED_PDB})
|
|
||||||
else ()
|
|
||||||
set(PDB_OUTPUT_PATH)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_custom_target(${PDB}_pdb DEPENDS ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb)
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb
|
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
||||||
COMMAND
|
|
||||||
(
|
|
||||||
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb &&
|
|
||||||
${cv2pdb_SOURCE_DIR}/cv2pdb64.exe $<TARGET_FILE:${PDB}> ${PDB_OUTPUT_PATH} &&
|
|
||||||
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}
|
|
||||||
) || (exit 0)
|
|
||||||
COMMAND_EXPAND_LISTS)
|
|
||||||
|
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb DESTINATION ".")
|
|
||||||
|
|
||||||
add_dependencies(imhex_all ${PDB}_pdb)
|
|
||||||
endforeach ()
|
|
||||||
|
|
||||||
|
set(SDK_BUILD_PATH "${CMAKE_BINARY_DIR}/sdk" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(generateSDKDirectory)
|
function(generateSDKDirectory)
|
||||||
if (WIN32)
|
setSDKPaths()
|
||||||
set(SDK_PATH "./sdk")
|
|
||||||
elseif (APPLE)
|
|
||||||
set(SDK_PATH "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources/sdk")
|
|
||||||
else()
|
|
||||||
set(SDK_PATH "share/imhex/sdk")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SDK_BUILD_PATH "${CMAKE_BINARY_DIR}/sdk")
|
|
||||||
|
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/libimhex DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/libimhex DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/trace DESTINATION "${SDK_PATH}/lib" PATTERN "**/source/*" EXCLUDE)
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/external DESTINATION "${SDK_PATH}/lib")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/external DESTINATION "${SDK_PATH}/lib")
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/imgui DESTINATION "${SDK_PATH}/lib/third_party" PATTERN "**/source/*" EXCLUDE)
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/lib/third_party/imgui DESTINATION "${SDK_PATH}/lib/third_party" PATTERN "**/source/*" EXCLUDE)
|
||||||
if (NOT USE_SYSTEM_FMT)
|
if (NOT USE_SYSTEM_FMT)
|
||||||
|
|
@ -865,6 +1007,19 @@ function(generateSDKDirectory)
|
||||||
install(FILES ${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake DESTINATION "${SDK_PATH}/cmake")
|
install(FILES ${CMAKE_SOURCE_DIR}/cmake/build_helpers.cmake DESTINATION "${SDK_PATH}/cmake")
|
||||||
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/cmake/sdk/ DESTINATION "${SDK_PATH}")
|
||||||
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
install(TARGETS libimhex ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
install(TARGETS tracing ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/ui/include DESTINATION "${SDK_PATH}/lib/ui/include")
|
||||||
|
install(FILES ${CMAKE_SOURCE_DIR}/plugins/ui/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/ui/")
|
||||||
|
if (WIN32)
|
||||||
|
install(TARGETS ui ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/plugins/fonts/include DESTINATION "${SDK_PATH}/lib/fonts/include")
|
||||||
|
install(FILES ${CMAKE_SOURCE_DIR}/plugins/fonts/CMakeLists.txt DESTINATION "${SDK_PATH}/lib/fonts/")
|
||||||
|
if (WIN32)
|
||||||
|
install(TARGETS fonts ARCHIVE DESTINATION "${SDK_PATH}/lib")
|
||||||
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(addIncludesFromLibrary target library)
|
function(addIncludesFromLibrary target library)
|
||||||
|
|
@ -878,11 +1033,12 @@ function(precompileHeaders target includeFolder)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(GLOB_RECURSE TARGET_INCLUDES "${includeFolder}/**/*.hpp")
|
file(GLOB_RECURSE TARGET_INCLUDES "${includeFolder}/**/*.hpp")
|
||||||
|
file(GLOB_RECURSE LIBIMHEX_INCLUDES "${CMAKE_SOURCE_DIR}/lib/libimhex/include/**/*.hpp")
|
||||||
set(SYSTEM_INCLUDES "<algorithm>;<array>;<atomic>;<chrono>;<cmath>;<cstddef>;<cstdint>;<cstdio>;<cstdlib>;<cstring>;<exception>;<filesystem>;<functional>;<iterator>;<limits>;<list>;<map>;<memory>;<optional>;<ranges>;<set>;<stdexcept>;<string>;<string_view>;<thread>;<tuple>;<type_traits>;<unordered_map>;<unordered_set>;<utility>;<variant>;<vector>")
|
set(SYSTEM_INCLUDES "<algorithm>;<array>;<atomic>;<chrono>;<cmath>;<cstddef>;<cstdint>;<cstdio>;<cstdlib>;<cstring>;<exception>;<filesystem>;<functional>;<iterator>;<limits>;<list>;<map>;<memory>;<optional>;<ranges>;<set>;<stdexcept>;<string>;<string_view>;<thread>;<tuple>;<type_traits>;<unordered_map>;<unordered_set>;<utility>;<variant>;<vector>")
|
||||||
set(INCLUDES "${SYSTEM_INCLUDES};${TARGET_INCLUDES}")
|
set(INCLUDES "${SYSTEM_INCLUDES};${TARGET_INCLUDES};${LIBIMHEX_INCLUDES}")
|
||||||
string(REPLACE ">" "$<ANGLE-R>" INCLUDES "${INCLUDES}")
|
string(REPLACE ">" "$<ANGLE-R>" INCLUDES "${INCLUDES}")
|
||||||
target_precompile_headers(${target}
|
target_precompile_headers(${target}
|
||||||
PUBLIC
|
PUBLIC
|
||||||
"$<$<COMPILE_LANGUAGE:CXX>:${INCLUDES}>"
|
"$<$<COMPILE_LANGUAGE:CXX>:${INCLUDES}>"
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
find_path(LIBSSH2_INCLUDE_DIR libssh2.h)
|
||||||
|
|
||||||
|
find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2)
|
||||||
|
|
||||||
|
if(LIBSSH2_INCLUDE_DIR)
|
||||||
|
file(STRINGS "${LIBSSH2_INCLUDE_DIR}/libssh2.h" libssh2_version_str REGEX "^#define[\t ]+LIBSSH2_VERSION[\t ]+\"(.*)\"")
|
||||||
|
string(REGEX REPLACE "^.*\"([^\"]+)\"" "\\1" LIBSSH2_VERSION "${libssh2_version_str}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LibSSH2
|
||||||
|
REQUIRED_VARS LIBSSH2_LIBRARY LIBSSH2_INCLUDE_DIR
|
||||||
|
VERSION_VAR LIBSSH2_VERSION)
|
||||||
|
|
||||||
|
mark_as_advanced(LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
|
||||||
|
|
@ -26,8 +26,9 @@ SET(MBEDTLS_FIND_QUIETLY TRUE)
|
||||||
FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509)
|
FIND_LIBRARY(MBEDTLS_LIBRARY NAMES mbedtls libmbedtls libmbedx509)
|
||||||
FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509)
|
FIND_LIBRARY(MBEDX509_LIBRARY NAMES mbedx509 libmbedx509)
|
||||||
FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto)
|
FIND_LIBRARY(MBEDCRYPTO_LIBRARY NAMES mbedcrypto libmbedcrypto)
|
||||||
|
FIND_LIBRARY(TFPSACRYPTO_LIBRARY NAMES libtfpsacrypto tfpsacrypto)
|
||||||
|
|
||||||
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY)
|
IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND (MBEDCRYPTO_LIBRARY OR TFPSACRYPTO_LIBRARY))
|
||||||
SET(MBEDTLS_FOUND TRUE)
|
SET(MBEDTLS_FOUND TRUE)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
|
|
@ -37,10 +38,25 @@ IF(MBEDTLS_FOUND)
|
||||||
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
|
GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
|
||||||
GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
|
GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
|
||||||
GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
|
GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
|
||||||
|
GET_FILENAME_COMPONENT(TFPSACRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY} NAME_WE)
|
||||||
STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
|
STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
|
||||||
STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
|
STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
|
||||||
STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
|
STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
|
||||||
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}")
|
STRING(REGEX REPLACE "^lib" "" TFPSACRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY_FILE})
|
||||||
|
|
||||||
|
if (TFPSACRYPTO_LIBRARY)
|
||||||
|
SET(MBEDTLS_CRYPTO_LIBRARY_FILE ${TFPSACRYPTO_LIBRARY_FILE})
|
||||||
|
elseif (MBEDCRYPTO_LIBRARY)
|
||||||
|
SET(MBEDTLS_CRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
|
||||||
|
else ()
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find mbedTLS Crypto library")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (MSVC)
|
||||||
|
SET(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARY_FILE}.lib ${MBEDX509_LIBRARY_FILE}.lib ${MBEDTLS_CRYPTO_LIBRARY_FILE}.lib)
|
||||||
|
else()
|
||||||
|
SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDTLS_CRYPTO_LIBRARY_FILE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(NOT MBEDTLS_FIND_QUIETLY)
|
IF(NOT MBEDTLS_FIND_QUIETLY)
|
||||||
MESSAGE(STATUS "Found mbedTLS:")
|
MESSAGE(STATUS "Found mbedTLS:")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
macro(add_imhex_plugin)
|
macro(add_imhex_plugin)
|
||||||
|
setSDKPaths()
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
set(options LIBRARY_PLUGIN)
|
set(options LIBRARY_PLUGIN)
|
||||||
set(oneValueArgs NAME IMHEX_VERSION)
|
set(oneValueArgs NAME IMHEX_VERSION)
|
||||||
|
|
@ -28,104 +29,132 @@ macro(add_imhex_plugin)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (IMHEX_PLUGIN_LIBRARY_PLUGIN)
|
||||||
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/" DESTINATION "${SDK_PATH}/lib/plugins/${IMHEX_PLUGIN_NAME}")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Define new project for plugin
|
# Define new project for plugin
|
||||||
project(${IMHEX_PLUGIN_NAME})
|
project(${IMHEX_PLUGIN_NAME})
|
||||||
|
|
||||||
# Create a new shared library for the plugin source code
|
if (IMHEX_PLUGIN_IMPORTED)
|
||||||
add_library(${IMHEX_PLUGIN_NAME} ${IMHEX_PLUGIN_LIBRARY_TYPE} ${IMHEX_PLUGIN_SOURCES})
|
add_library(${IMHEX_PLUGIN_NAME} SHARED IMPORTED GLOBAL)
|
||||||
|
|
||||||
# Add include directories and link libraries
|
if (WIN32)
|
||||||
target_include_directories(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_INCLUDES})
|
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
|
||||||
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_LIBRARIES})
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
|
||||||
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE libimhex ${FMT_LIBRARIES} imgui_all_includes libwolv)
|
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/../lib${IMHEX_PLUGIN_NAME}.dll.a"
|
||||||
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl)
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
|
||||||
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl-gen)
|
elseif (APPLE)
|
||||||
|
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../../MacOS/plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
|
||||||
|
else()
|
||||||
|
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../plugins/${IMHEX_PLUGIN_NAME}${IMHEX_PLUGIN_SUFFIX}"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include/include")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
# Create a new shared library for the plugin source code
|
||||||
|
add_library(${IMHEX_PLUGIN_NAME} ${IMHEX_PLUGIN_LIBRARY_TYPE} ${IMHEX_PLUGIN_SOURCES})
|
||||||
|
|
||||||
precompileHeaders(${IMHEX_PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
# Add include directories and link libraries
|
||||||
|
target_include_directories(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_INCLUDES})
|
||||||
|
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_LIBRARIES})
|
||||||
|
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE libimhex ${FMT_LIBRARIES} imgui_all_includes libwolv)
|
||||||
|
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl)
|
||||||
|
addIncludesFromLibrary(${IMHEX_PLUGIN_NAME} libpl-gen)
|
||||||
|
|
||||||
# Add IMHEX_PROJECT_NAME and IMHEX_VERSION define
|
precompileHeaders(${IMHEX_PLUGIN_NAME} "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}")
|
|
||||||
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_VERSION="${IMHEX_VERSION_STRING}")
|
|
||||||
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
|
|
||||||
|
|
||||||
# Enable required compiler flags
|
# Add IMHEX_PROJECT_NAME and IMHEX_VERSION define
|
||||||
enableUnityBuild(${IMHEX_PLUGIN_NAME})
|
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}")
|
||||||
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
|
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_VERSION="${IMHEX_VERSION_STRING}")
|
||||||
|
target_compile_definitions(${IMHEX_PLUGIN_NAME} PRIVATE IMHEX_PLUGIN_NAME=${IMHEX_PLUGIN_NAME})
|
||||||
|
|
||||||
# Configure build properties
|
# Enable required compiler flags
|
||||||
set_target_properties(${IMHEX_PLUGIN_NAME}
|
enableUnityBuild(${IMHEX_PLUGIN_NAME})
|
||||||
PROPERTIES
|
setupCompilerFlags(${IMHEX_PLUGIN_NAME})
|
||||||
RUNTIME_OUTPUT_DIRECTORY "${IMHEX_MAIN_OUTPUT_DIRECTORY}/plugins"
|
addCppCheck(${IMHEX_PLUGIN_NAME})
|
||||||
CXX_STANDARD 23
|
|
||||||
PREFIX ""
|
|
||||||
SUFFIX ${IMHEX_PLUGIN_SUFFIX}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set rpath of plugin libraries to the plugins folder
|
# Configure build properties
|
||||||
if (APPLE)
|
set_target_properties(${IMHEX_PLUGIN_NAME}
|
||||||
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES BUILD_RPATH "@executable_path/../Frameworks;@executable_path/plugins")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Setup a romfs for the plugin
|
|
||||||
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
|
||||||
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
|
|
||||||
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
|
|
||||||
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
|
|
||||||
|
|
||||||
set(FEATURE_DEFINE_CONTENT)
|
|
||||||
|
|
||||||
if (IMHEX_PLUGIN_FEATURES)
|
|
||||||
list(LENGTH IMHEX_PLUGIN_FEATURES IMHEX_FEATURE_COUNT)
|
|
||||||
math(EXPR IMHEX_FEATURE_COUNT "${IMHEX_FEATURE_COUNT} - 1" OUTPUT_FORMAT DECIMAL)
|
|
||||||
foreach(index RANGE 0 ${IMHEX_FEATURE_COUNT} 2)
|
|
||||||
list(SUBLIST IMHEX_PLUGIN_FEATURES ${index} 2 IMHEX_PLUGIN_FEATURE)
|
|
||||||
list(GET IMHEX_PLUGIN_FEATURE 0 feature_define)
|
|
||||||
list(GET IMHEX_PLUGIN_FEATURE 1 feature_description)
|
|
||||||
|
|
||||||
string(TOUPPER ${feature_define} feature_define)
|
|
||||||
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature_define}=0)
|
|
||||||
set(FEATURE_DEFINE_CONTENT "${FEATURE_DEFINE_CONTENT}{ \"${feature_description}\", IMHEX_FEATURE_ENABLED(${feature_define}) },")
|
|
||||||
endforeach()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
target_compile_options(${IMHEX_PLUGIN_NAME} PRIVATE -DIMHEX_PLUGIN_FEATURES_CONTENT=${FEATURE_DEFINE_CONTENT})
|
|
||||||
|
|
||||||
# Add the new plugin to the main dependency list so it gets built by default
|
|
||||||
if (TARGET imhex_all)
|
|
||||||
add_dependencies(imhex_all ${IMHEX_PLUGIN_NAME})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
|
|
||||||
install(TARGETS ${IMHEX_PLUGIN_NAME} DESTINATION ".")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Fix rpath
|
|
||||||
if (APPLE)
|
|
||||||
set_target_properties(
|
|
||||||
${IMHEX_PLUGIN_NAME}
|
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/plugins"
|
RUNTIME_OUTPUT_DIRECTORY "${IMHEX_MAIN_OUTPUT_DIRECTORY}/plugins"
|
||||||
|
CXX_STANDARD 23
|
||||||
|
PREFIX ""
|
||||||
|
SUFFIX ${IMHEX_PLUGIN_SUFFIX}
|
||||||
)
|
)
|
||||||
elseif (UNIX)
|
|
||||||
set(PLUGIN_RPATH "")
|
|
||||||
list(APPEND PLUGIN_RPATH "$ORIGIN")
|
|
||||||
|
|
||||||
if (IMHEX_PLUGIN_ADD_INSTALL_PREFIX_TO_RPATH)
|
# Set rpath of plugin libraries to the plugins folder
|
||||||
list(APPEND PLUGIN_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
if (WIN32)
|
||||||
|
if (IMHEX_PLUGIN_LIBRARY_PLUGIN)
|
||||||
|
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||||
|
endif()
|
||||||
|
elseif (APPLE)
|
||||||
|
set_target_properties(${IMHEX_PLUGIN_NAME} PROPERTIES BUILD_RPATH "@executable_path/../Frameworks;@executable_path/plugins")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_target_properties(
|
# Setup a romfs for the plugin
|
||||||
${IMHEX_PLUGIN_NAME}
|
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
|
||||||
PROPERTIES
|
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
|
||||||
|
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
|
||||||
|
target_link_libraries(${IMHEX_PLUGIN_NAME} PRIVATE ${LIBROMFS_LIBRARY})
|
||||||
|
|
||||||
|
set(FEATURE_DEFINE_CONTENT)
|
||||||
|
|
||||||
|
if (IMHEX_PLUGIN_FEATURES)
|
||||||
|
list(LENGTH IMHEX_PLUGIN_FEATURES IMHEX_FEATURE_COUNT)
|
||||||
|
math(EXPR IMHEX_FEATURE_COUNT "${IMHEX_FEATURE_COUNT} - 1" OUTPUT_FORMAT DECIMAL)
|
||||||
|
foreach(index RANGE 0 ${IMHEX_FEATURE_COUNT} 2)
|
||||||
|
list(SUBLIST IMHEX_PLUGIN_FEATURES ${index} 2 IMHEX_PLUGIN_FEATURE)
|
||||||
|
list(GET IMHEX_PLUGIN_FEATURE 0 feature_define)
|
||||||
|
list(GET IMHEX_PLUGIN_FEATURE 1 feature_description)
|
||||||
|
|
||||||
|
string(TOUPPER ${feature_define} feature_define)
|
||||||
|
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature_define}=0)
|
||||||
|
set(FEATURE_DEFINE_CONTENT "${FEATURE_DEFINE_CONTENT}{ \"${feature_description}\", IMHEX_FEATURE_ENABLED(${feature_define}) },")
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_compile_options(${IMHEX_PLUGIN_NAME} PRIVATE -DIMHEX_PLUGIN_FEATURES_CONTENT=${FEATURE_DEFINE_CONTENT})
|
||||||
|
|
||||||
|
# Add the new plugin to the main dependency list so it gets built by default
|
||||||
|
if (TARGET imhex_all)
|
||||||
|
add_dependencies(imhex_all ${IMHEX_PLUGIN_NAME})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
|
||||||
|
install(TARGETS ${IMHEX_PLUGIN_NAME} DESTINATION ".")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Fix rpath
|
||||||
|
if (APPLE)
|
||||||
|
set_target_properties(
|
||||||
|
${IMHEX_PLUGIN_NAME}
|
||||||
|
PROPERTIES
|
||||||
|
INSTALL_RPATH "@executable_path/../Frameworks;@executable_path/plugins"
|
||||||
|
)
|
||||||
|
elseif (UNIX)
|
||||||
|
set(PLUGIN_RPATH "")
|
||||||
|
list(APPEND PLUGIN_RPATH "$ORIGIN")
|
||||||
|
|
||||||
|
if (IMHEX_PLUGIN_ADD_INSTALL_PREFIX_TO_RPATH)
|
||||||
|
list(APPEND PLUGIN_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set_target_properties(
|
||||||
|
${IMHEX_PLUGIN_NAME}
|
||||||
|
PROPERTIES
|
||||||
INSTALL_RPATH_USE_ORIGIN ON
|
INSTALL_RPATH_USE_ORIGIN ON
|
||||||
INSTALL_RPATH "${PLUGIN_RPATH}"
|
INSTALL_RPATH "${PLUGIN_RPATH}"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt AND IMHEX_ENABLE_UNIT_TESTS AND IMHEX_ENABLE_PLUGIN_TESTS)
|
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt AND IMHEX_ENABLE_UNIT_TESTS AND IMHEX_ENABLE_PLUGIN_TESTS)
|
||||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
|
||||||
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_NAME}_tests)
|
target_link_libraries(${IMHEX_PLUGIN_NAME} PUBLIC ${IMHEX_PLUGIN_NAME}_tests)
|
||||||
target_compile_definitions(${IMHEX_PLUGIN_NAME}_tests PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}-tests")
|
target_compile_definitions(${IMHEX_PLUGIN_NAME}_tests PRIVATE IMHEX_PROJECT_NAME="${IMHEX_PLUGIN_NAME}-tests")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|
@ -147,4 +176,4 @@ macro (enable_plugin_feature feature)
|
||||||
|
|
||||||
remove_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=0)
|
remove_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=0)
|
||||||
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=1)
|
add_definitions(-DIMHEX_PLUGIN_${IMHEX_PLUGIN_NAME}_FEATURE_${feature}=1)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
|
||||||
|
|
@ -38,25 +38,36 @@ add_subdirectory(lib/external/libwolv EXCLUDE_FROM_ALL)
|
||||||
set(LIBPL_ENABLE_CLI OFF CACHE BOOL "" FORCE)
|
set(LIBPL_ENABLE_CLI OFF CACHE BOOL "" FORCE)
|
||||||
add_subdirectory(lib/external/pattern_language EXCLUDE_FROM_ALL)
|
add_subdirectory(lib/external/pattern_language EXCLUDE_FROM_ALL)
|
||||||
|
|
||||||
find_package(CURL REQUIRED)
|
set(IMHEX_PLUGIN_IMPORTED ON)
|
||||||
find_package(mbedTLS 3.4.0 REQUIRED)
|
|
||||||
set(CURL_LIBRARIES ${CURL_LIBRARIES} PARENT_SCOPE)
|
|
||||||
set(MBEDTLS_LIBRARIES ${MBEDTLS_LIBRARIES} PARENT_SCOPE)
|
|
||||||
|
|
||||||
add_subdirectory(lib/libimhex)
|
add_subdirectory(lib/libimhex)
|
||||||
|
add_subdirectory(lib/trace)
|
||||||
|
add_subdirectory(lib/fonts)
|
||||||
|
add_subdirectory(lib/ui)
|
||||||
|
|
||||||
|
set(IMHEX_PLUGIN_IMPORTED OFF)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_target_properties(libimhex PROPERTIES
|
set_target_properties(libimhex PROPERTIES
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.dll"
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.dll"
|
||||||
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibimhex.dll.a"
|
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/liblibimhex.dll.a"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
||||||
|
set_target_properties(tracing PROPERTIES
|
||||||
|
IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/lib/libtracing.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
file(GLOB LIBIMHEX_DYLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../Frameworks/libimhex.*.dylib")
|
file(GLOB LIBIMHEX_DYLIB "${CMAKE_CURRENT_SOURCE_DIR}/../../Frameworks/libimhex.*.dylib")
|
||||||
set_target_properties(libimhex PROPERTIES
|
set_target_properties(libimhex PROPERTIES
|
||||||
IMPORTED_LOCATION "${LIBIMHEX_DYLIB}"
|
IMPORTED_LOCATION "${LIBIMHEX_DYLIB}"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
||||||
|
set_target_properties(tracing PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libtracing.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
|
||||||
else()
|
else()
|
||||||
set_target_properties(libimhex PROPERTIES
|
set_target_properties(libimhex PROPERTIES
|
||||||
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../libimhex.so"
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib/libimhex.so"
|
||||||
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/libimhex/include")
|
||||||
|
set_target_properties(tracing PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/lib/libtracing.a"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/lib/trace/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include <hex/plugin.hpp>
|
#include <hex/plugin.hpp>
|
||||||
|
|
||||||
// Browse through the headers in lib/libimhex/include/hex/api/ to see what you can do with the API.
|
// Browse through the headers in lib/libimhex/include/hex/api/ to see what you can do with the API.
|
||||||
// Most important ones are <hex/api/imhex_api.hpp> and <hex/api/content_registry.hpp>
|
// Most important ones are the things under imhex_api and content_registry
|
||||||
|
|
||||||
// This is the main entry point of your plugin. The code in the body of this construct will be executed
|
// This is the main entry point of your plugin. The code in the body of this construct will be executed
|
||||||
// when ImHex starts up and loads the plugin.
|
// when ImHex starts up and loads the plugin.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,146 @@
|
||||||
|
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
|
||||||
|
version: 1
|
||||||
|
AppDir:
|
||||||
|
path: .AppDir
|
||||||
|
app_info:
|
||||||
|
id: imhex
|
||||||
|
name: ImHex
|
||||||
|
icon: imhex
|
||||||
|
version: "{{VERSION}}"
|
||||||
|
exec: usr/bin/imhex
|
||||||
|
exec_args: $@
|
||||||
|
apt:
|
||||||
|
arch:
|
||||||
|
- all
|
||||||
|
- "{{ARCHITECTURE_PACKAGE}}"
|
||||||
|
allow_unauthenticated: true
|
||||||
|
sources:
|
||||||
|
- sourceline: 'deb [arch=amd64] https://us.archive.ubuntu.com/ubuntu/ noble main restricted universe multiverse'
|
||||||
|
- sourceline: 'deb [arch=arm64] https://ports.ubuntu.com/ubuntu-ports/ noble main restricted universe multiverse'
|
||||||
|
include:
|
||||||
|
- libgdk-pixbuf2.0-0
|
||||||
|
- libgdk-pixbuf2.0-common
|
||||||
|
- shared-mime-info
|
||||||
|
- librsvg2-common
|
||||||
|
- libbz2-1.0
|
||||||
|
- libcap2
|
||||||
|
- libdbus-1-3
|
||||||
|
- libfontconfig1
|
||||||
|
- libgpg-error0
|
||||||
|
- liblzma5
|
||||||
|
- libnss-mdns
|
||||||
|
- libpcre3
|
||||||
|
- libselinux1
|
||||||
|
- libtinfo6
|
||||||
|
- libmd4c-dev
|
||||||
|
- libmd4c-html0-dev
|
||||||
|
files:
|
||||||
|
include:
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libLLVM-13.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libOpenGL.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libX11.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXau.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXcomposite.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXcursor.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXdamage.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXdmcp.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXext.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXfixes.so.3"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXi.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXinerama.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXrandr.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXrender.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libXxf86vm.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatk-1.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatk-bridge-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libatspi.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libblkid.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbrotlicommon.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbrotlidec.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libbsd.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcairo-gobject.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcairo.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libcurl-gnutls.so.4"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libdatrie.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libedit.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libelf.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libepoxy.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libffi.so.8"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfontconfig.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfreetype.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libfribidi.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgcrypt.so.20"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgdk-3.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgdk_pixbuf-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgio-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libglfw.so.3"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libglib-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgmodule-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgmp.so.10"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgnutls.so.30"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgobject-2.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libgraphite2.so.3"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libharfbuzz.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libhogweed.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libicudata.so.70"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libicuuc.so.70"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libidn2.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libjpeg.so.8"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/liblber-2.5.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libldap-2.5.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/liblz4.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmagic.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedcrypto.so.7"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedtls.so.14"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmbedx509.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmd.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmount.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libnettle.so.8"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libp11-kit.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpango-1.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpangocairo-1.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpangoft2-1.0.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpcre2-8.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpixman-1.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libpng16.so.16"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsasl2.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsensors.so.5"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libstdc++.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libsystemd.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libtasn1.so.6"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libthai.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libunistring.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libuuid.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libvulkan.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-client.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-cursor.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libwayland-egl.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-dri2.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-dri3.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-present.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxcb-sync.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxkbcommon.so.0"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxml2.so.2"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libxshmfence.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libzstd.so.1"
|
||||||
|
- "/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/libmd4c.so"
|
||||||
|
exclude:
|
||||||
|
- usr/share/man
|
||||||
|
- usr/share/doc/*/README.*
|
||||||
|
- usr/share/doc/*/changelog.*
|
||||||
|
- usr/share/doc/*/NEWS.*
|
||||||
|
- usr/share/doc/*/TODO.*
|
||||||
|
|
||||||
|
runtime:
|
||||||
|
env:
|
||||||
|
APPDIR_LIBRARY_PATH: '$APPDIR/usr/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu:$APPDIR/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu:$APPDIR/usr/lib:$APPDIR/usr/lib/{{ARCHITECTURE_APPIMAGE_BUILDER}}-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders'
|
||||||
|
GTK_EXE_PREFIX: $APPDIR/usr
|
||||||
|
GTK_DATA_PREFIX: $APPDIR
|
||||||
|
XDG_DATA_DIRS: '/usr/local/share:/usr/share:$APPDIR/usr/share:$XDG_DATA_DIRS:$APPDIR/usr/local/share:$APPDIR/usr/local/lib:$APPDIR/usr/local/share'
|
||||||
|
XDG_CONFIG_DIRS: '$XDG_CONFIG_DIRS:$APPDIR/usr/local/share'
|
||||||
|
|
||||||
|
AppImage:
|
||||||
|
arch: "{{ARCHITECTURE_APPIMAGE_BUILDER}}"
|
||||||
|
comp: zstd
|
||||||
|
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-{{ARCHITECTURE_FILE_NAME}}.AppImage.zsync
|
||||||
|
file_name: imhex-{{VERSION}}-{{ARCHITECTURE_FILE_NAME}}.AppImage
|
||||||
|
|
@ -0,0 +1,93 @@
|
||||||
|
FROM ubuntu:24.04 as build
|
||||||
|
|
||||||
|
# Used to invalidate layer cache but not mount cache
|
||||||
|
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
||||||
|
ARG UNIQUEKEY 1
|
||||||
|
|
||||||
|
COPY dist/get_deps_debian.sh /tmp
|
||||||
|
RUN --mount=type=cache,target=/var/apt/cache <<EOF
|
||||||
|
# Install apt dependencies
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
apt update
|
||||||
|
|
||||||
|
# general deps
|
||||||
|
apt install -y ccache git wget
|
||||||
|
# appimage tools deps
|
||||||
|
apt install -y python3-pip python3-venv python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build
|
||||||
|
apt install -y squashfs-tools zsync
|
||||||
|
|
||||||
|
# imhex deps
|
||||||
|
/tmp/get_deps_debian.sh
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ENV PATH="/cache/bin/:${PATH}"
|
||||||
|
|
||||||
|
# Copy Imhex source
|
||||||
|
COPY . /imhex
|
||||||
|
|
||||||
|
ARG LTO=ON
|
||||||
|
ARG BUILD_TYPE=RelWithDebInfo
|
||||||
|
ARG GIT_COMMIT_HASH
|
||||||
|
ARG GIT_BRANCH
|
||||||
|
ARG ARCHITECTURE_PACKAGE=x86_64
|
||||||
|
ARG ARCHITECTURE_FILE_NAME=amd64
|
||||||
|
ARG ARCHITECTURE_APPIMAGE_BUILDER=x86_64
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
# Ubuntu sh doesnt support string substitution
|
||||||
|
SHELL ["bash", "-c"]
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
# Prepare ImHex build
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
CC=gcc-14 CXX=g++-14 cmake -G "Ninja" \
|
||||||
|
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
||||||
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||||
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
|
-DIMHEX_COMMIT_HASH_LONG="${GIT_COMMIT_HASH}" \
|
||||||
|
-DIMHEX_COMMIT_BRANCH="${GIT_BRANCH}" \
|
||||||
|
-DIMHEX_ENABLE_LTO=${LTO} \
|
||||||
|
-DIMHEX_BUNDLE_PLUGIN_SDK=OFF \
|
||||||
|
`# To prevent using a libdir with an architecture-specific name` \
|
||||||
|
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||||
|
/imhex
|
||||||
|
EOF
|
||||||
|
|
||||||
|
ENV CCACHE_DIR /cache/ccache
|
||||||
|
RUN --mount=type=cache,target=/cache <<EOF
|
||||||
|
# Build Imhex
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
ccache -zs
|
||||||
|
DESTDIR=AppDir ninja install
|
||||||
|
ccache -s
|
||||||
|
EOF
|
||||||
|
|
||||||
|
RUN <<EOF
|
||||||
|
# Download appimage-builder
|
||||||
|
set -xe
|
||||||
|
|
||||||
|
mkdir -p /cache/bin
|
||||||
|
wget -nc https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage -O /cache/bin/appimagetool || true
|
||||||
|
chmod +x /cache/bin/appimagetool
|
||||||
|
|
||||||
|
python3 -m venv venv
|
||||||
|
. venv/bin/activate
|
||||||
|
pip3 install git+https://github.com/AppImageCrafters/appimage-builder@e995e8e
|
||||||
|
|
||||||
|
# Package ImHex as AppImage
|
||||||
|
export VERSION=$(cat /imhex/VERSION)
|
||||||
|
export ARCHITECTURE_PACKAGE=${ARCHITECTURE_PACKAGE}
|
||||||
|
export ARCHITECTURE_FILE_NAME=${ARCHITECTURE_FILE_NAME}
|
||||||
|
export ARCHITECTURE_APPIMAGE_BUILDER=${ARCHITECTURE_APPIMAGE_BUILDER}
|
||||||
|
appimage-builder --recipe /imhex/dist/AppImage/AppImageBuilder.yml
|
||||||
|
EOF
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
# Copy build artifact
|
||||||
|
COPY --from=build /build/*.AppImage /build/*.AppImage.zsync ./
|
||||||
|
|
@ -1,138 +0,0 @@
|
||||||
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
|
|
||||||
version: 1
|
|
||||||
AppDir:
|
|
||||||
path: .AppDir
|
|
||||||
app_info:
|
|
||||||
id: imhex
|
|
||||||
name: ImHex
|
|
||||||
icon: imhex
|
|
||||||
version: "{{VERSION}}"
|
|
||||||
exec: usr/bin/imhex
|
|
||||||
exec_args: $@
|
|
||||||
apt:
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
allow_unauthenticated: true
|
|
||||||
sources:
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular main restricted
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates main restricted
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular universe
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates universe
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular multiverse
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-updates multiverse
|
|
||||||
- sourceline: deb http://us.archive.ubuntu.com/ubuntu/ oracular-backports main restricted
|
|
||||||
universe multiverse
|
|
||||||
- sourceline: deb http://security.ubuntu.com/ubuntu oracular-security main restricted
|
|
||||||
- sourceline: deb http://security.ubuntu.com/ubuntu oracular-security universe
|
|
||||||
- sourceline: deb http://security.ubuntu.com/ubuntu oracular-security multiverse
|
|
||||||
include:
|
|
||||||
- librsvg2-common
|
|
||||||
- libbz2-1.0:amd64
|
|
||||||
- libcap2:amd64
|
|
||||||
- libdbus-1-3:amd64
|
|
||||||
- libfontconfig1:amd64
|
|
||||||
- libgpg-error0:amd64
|
|
||||||
- liblzma5:amd64
|
|
||||||
- libnss-mdns:amd64
|
|
||||||
- libpcre3:amd64
|
|
||||||
- libselinux1:amd64
|
|
||||||
- libtinfo6:amd64
|
|
||||||
files:
|
|
||||||
include:
|
|
||||||
- /lib/x86_64-linux-gnu/libLLVM-13.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libOpenGL.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libX11.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libXau.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libXcomposite.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libXcursor.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libXdamage.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libXdmcp.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libXext.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libXfixes.so.3
|
|
||||||
- /lib/x86_64-linux-gnu/libXi.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libXinerama.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libXrandr.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libXrender.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libXxf86vm.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libatk-1.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libatspi.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libblkid.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libbrotlicommon.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libbrotlidec.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libbsd.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libcairo-gobject.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libcairo.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libcurl-gnutls.so.4
|
|
||||||
- /lib/x86_64-linux-gnu/libdatrie.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libedit.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libelf.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libepoxy.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libffi.so.8
|
|
||||||
- /lib/x86_64-linux-gnu/libfontconfig.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libfreetype.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libfribidi.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgcrypt.so.20
|
|
||||||
- /lib/x86_64-linux-gnu/libgdk-3.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgio-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libglfw.so.3
|
|
||||||
- /lib/x86_64-linux-gnu/libglib-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgmodule-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgmp.so.10
|
|
||||||
- /lib/x86_64-linux-gnu/libgnutls.so.30
|
|
||||||
- /lib/x86_64-linux-gnu/libgobject-2.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libgraphite2.so.3
|
|
||||||
- /lib/x86_64-linux-gnu/libharfbuzz.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libhogweed.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libicudata.so.70
|
|
||||||
- /lib/x86_64-linux-gnu/libicuuc.so.70
|
|
||||||
- /lib/x86_64-linux-gnu/libidn2.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libjpeg.so.8
|
|
||||||
- /lib/x86_64-linux-gnu/liblber-2.5.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libldap-2.5.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/liblz4.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libmagic.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libmbedcrypto.so.7
|
|
||||||
- /lib/x86_64-linux-gnu/libmbedtls.so.14
|
|
||||||
- /lib/x86_64-linux-gnu/libmbedx509.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libmd.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libmount.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libnettle.so.8
|
|
||||||
- /lib/x86_64-linux-gnu/libp11-kit.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpango-1.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpangocairo-1.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpcre2-8.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpixman-1.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libpng16.so.16
|
|
||||||
- /lib/x86_64-linux-gnu/libsasl2.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libsensors.so.5
|
|
||||||
- /lib/x86_64-linux-gnu/libstdc++.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libsystemd.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libtasn1.so.6
|
|
||||||
- /lib/x86_64-linux-gnu/libthai.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libunistring.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libuuid.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libvulkan.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libwayland-client.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libwayland-cursor.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libwayland-egl.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libxcb-dri2.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libxcb-dri3.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libxcb-present.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libxcb-sync.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libxkbcommon.so.0
|
|
||||||
- /lib/x86_64-linux-gnu/libxml2.so.2
|
|
||||||
- /lib/x86_64-linux-gnu/libxshmfence.so.1
|
|
||||||
- /lib/x86_64-linux-gnu/libzstd.so.1
|
|
||||||
exclude:
|
|
||||||
- usr/share/man
|
|
||||||
- usr/share/doc/*/README.*
|
|
||||||
- usr/share/doc/*/changelog.*
|
|
||||||
- usr/share/doc/*/NEWS.*
|
|
||||||
- usr/share/doc/*/TODO.*
|
|
||||||
AppImage:
|
|
||||||
arch: x86_64
|
|
||||||
update-information: gh-releases-zsync|WerWolv|ImHex|latest|imhex-*-x86_64.AppImage.zsync
|
|
||||||
file_name: imhex-{{VERSION}}-x86_64.AppImage
|
|
||||||
|
|
@ -17,7 +17,9 @@ RUN pacman -S --needed --noconfirm \
|
||||||
freetype2 \
|
freetype2 \
|
||||||
curl \
|
curl \
|
||||||
dbus \
|
dbus \
|
||||||
xdg-desktop-portal
|
xdg-desktop-portal \
|
||||||
|
libssh2 \
|
||||||
|
md4c
|
||||||
|
|
||||||
# Clone ImHex
|
# Clone ImHex
|
||||||
RUN git clone https://github.com/WerWolv/ImHex --recurse-submodules /root/ImHex
|
RUN git clone https://github.com/WerWolv/ImHex --recurse-submodules /root/ImHex
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ pkgdesc="A Hex Editor for Reverse Engineers, Programmers and people who value th
|
||||||
arch=("x86_64")
|
arch=("x86_64")
|
||||||
url="https://github.com/WerWolv/ImHex"
|
url="https://github.com/WerWolv/ImHex"
|
||||||
license=('GPL2')
|
license=('GPL2')
|
||||||
depends=(glfw mbedtls fontconfig freetype2 libglvnd dbus gtk3 curl fmt yara nlohmann-json zlib bzip2 xz zstd)
|
depends=(glfw mbedtls fontconfig freetype2 libglvnd dbus gtk3 curl fmt yara zlib bzip2 xz zstd libssh2)
|
||||||
makedepends=(git)
|
makedepends=(git nlohmann-json)
|
||||||
provides=(imhex)
|
provides=(imhex)
|
||||||
conflicts=(imhex)
|
conflicts=(imhex)
|
||||||
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux-x86_64.pkg.tar.zst")
|
source=("$url/releases/download/v$pkgver/imhex-$pkgver-ArchLinux-x86_64.pkg.tar.zst")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ Section: editors
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
License: GNU GPL-2
|
License: GNU GPL-2
|
||||||
Depends: libfontconfig1, libglfw3 | libglfw3-wayland, libmagic1, libmbedtls14, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal
|
Depends: libfontconfig1, libglfw3 | libglfw3-wayland, libmagic1, libmbedtls14, libfreetype6, libopengl0, libdbus-1-3, xdg-desktop-portal, libssh2-1, libmd4c0
|
||||||
Maintainer: WerWolv <hey@werwolv.net>
|
Maintainer: WerWolv <hey@werwolv.net>
|
||||||
Description: ImHex Hex Editor
|
Description: ImHex Hex Editor
|
||||||
A Hex Editor for Reverse Engineers, Programmers and
|
A Hex Editor for Reverse Engineers, Programmers and
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ RDEPEND="${DEPEND}
|
||||||
media-libs/glfw
|
media-libs/glfw
|
||||||
sys-apps/file
|
sys-apps/file
|
||||||
net-libs/mbedtls
|
net-libs/mbedtls
|
||||||
dev-cpp/nlohmann_json
|
|
||||||
sys-apps/dbus
|
sys-apps/dbus
|
||||||
sys-apps/xdg-desktop-portal
|
sys-apps/xdg-desktop-portal
|
||||||
sys-libs/zlib
|
sys-libs/zlib
|
||||||
|
|
@ -29,5 +28,9 @@ RDEPEND="${DEPEND}
|
||||||
app-arch/lzma
|
app-arch/lzma
|
||||||
app-arch/zstd
|
app-arch/zstd
|
||||||
app-arch/lz4
|
app-arch/lz4
|
||||||
|
net-libs/libssh2
|
||||||
|
dev-libs/md4c
|
||||||
|
"
|
||||||
|
BDEPEND="${DEPEND}
|
||||||
|
dev-cpp/nlohmann_json
|
||||||
"
|
"
|
||||||
BDEPEND="${DEPEND}"
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ImHex" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS=".ninja_log" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://$CMakeCurrentBuildDir$" PASS_PARENT_ENVS_2="true" PROJECT_NAME="ImHex" TARGET_NAME="imhex_all" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="ImHex" RUN_TARGET_NAME="main">
|
||||||
|
<envs>
|
||||||
|
<env name="NO_DEBUG_BANNER" value="1" />
|
||||||
|
</envs>
|
||||||
|
<method v="2">
|
||||||
|
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
<configuration default="false" name="CMake Debug" type="CMakeListConfigurationType" factoryName="CMakeListConfigurationFactory">
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
FROM ubuntu:24.10 as build
|
|
||||||
|
|
||||||
# Used to invalidate layer cache but not mount cache
|
|
||||||
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
|
||||||
ARG UNIQUEKEY 1
|
|
||||||
|
|
||||||
COPY dist/get_deps_debian.sh /tmp
|
|
||||||
RUN --mount=type=cache,target=/var/apt/cache <<EOF
|
|
||||||
# Install apt dependencies
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
apt update
|
|
||||||
|
|
||||||
# general deps
|
|
||||||
apt install -y ccache git wget
|
|
||||||
# appimage tools deps
|
|
||||||
apt install -y python3-pip python3-venv python3-setuptools desktop-file-utils libgdk-pixbuf2.0-dev fuse ninja-build
|
|
||||||
apt install -y squashfs-tools zsync
|
|
||||||
|
|
||||||
# imhex deps
|
|
||||||
/tmp/get_deps_debian.sh
|
|
||||||
EOF
|
|
||||||
|
|
||||||
ENV PATH="/cache/bin/:${PATH}"
|
|
||||||
|
|
||||||
# Copy Imhex source
|
|
||||||
COPY . /imhex
|
|
||||||
|
|
||||||
ARG LTO=ON
|
|
||||||
ARG BUILD_TYPE=RelWithDebInfo
|
|
||||||
ARG GIT_COMMIT_HASH
|
|
||||||
ARG GIT_BRANCH
|
|
||||||
WORKDIR /build
|
|
||||||
SHELL ["bash", "-c"] # Ubuntu sh doesnt support string substitution
|
|
||||||
RUN <<EOF
|
|
||||||
# Prepare ImHex build
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
CC=gcc-14 CXX=g++-14 cmake -G "Ninja" \
|
|
||||||
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
|
|
||||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
|
||||||
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
|
||||||
-DIMHEX_COMMIT_HASH_LONG="${GIT_COMMIT_HASH}" \
|
|
||||||
-DIMHEX_COMMIT_BRANCH="${GIT_BRANCH}" \
|
|
||||||
-DIMHEX_ENABLE_LTO=${LTO} \
|
|
||||||
-DIMHEX_PLUGINS_IN_SHARE=ON \
|
|
||||||
/imhex
|
|
||||||
EOF
|
|
||||||
|
|
||||||
ENV CCACHE_DIR /cache/ccache
|
|
||||||
RUN --mount=type=cache,target=/cache <<EOF
|
|
||||||
# Build Imhex
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
ccache -zs
|
|
||||||
DESTDIR=AppDir ninja install
|
|
||||||
ccache -s
|
|
||||||
EOF
|
|
||||||
|
|
||||||
RUN <<EOF
|
|
||||||
# Download appimage-builder
|
|
||||||
set -xe
|
|
||||||
|
|
||||||
mkdir -p /cache/bin
|
|
||||||
wget -nc https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /cache/bin/appimagetool || true
|
|
||||||
chmod +x /cache/bin/appimagetool
|
|
||||||
|
|
||||||
python3 -m venv venv
|
|
||||||
. venv/bin/activate
|
|
||||||
pip3 install git+https://github.com/AppImageCrafters/appimage-builder@f38699e
|
|
||||||
|
|
||||||
# Package ImHex as AppImage
|
|
||||||
export VERSION=$(cat /imhex/VERSION)
|
|
||||||
appimage-builder --recipe /imhex/dist/AppImageBuilder.yml
|
|
||||||
EOF
|
|
||||||
|
|
||||||
FROM scratch
|
|
||||||
|
|
||||||
# Copy build artifact
|
|
||||||
COPY --from=build /build/*.AppImage /build/*.AppImage.zsync ./
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
@echo off
|
||||||
|
|
||||||
|
start "" "%~dp0..\imhex.exe" %*
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
script_path=$(readlink -f "$0")
|
||||||
|
script_dir=$(dirname "${script_path}")
|
||||||
|
"${script_dir}/../imhex" "$@" > /dev/null 2>&1 &
|
||||||
|
|
@ -9,7 +9,7 @@ On Linux, ImHex is built through regular GCC (or optionally Clang).
|
||||||
cd ImHex
|
cd ImHex
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
CC=gcc-12 CXX=g++-12 \
|
CC=gcc-14 CXX=g++-14 \
|
||||||
cmake -G "Ninja" \
|
cmake -G "Ninja" \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX="/usr" \
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
On macOS, ImHex is built through regular GCC and LLVM clang.
|
On macOS, ImHex is built through regular GCC and LLVM clang.
|
||||||
|
|
||||||
1. Clone the repo using `git clone https://github.com/WerWolv/ImHex --recurse-submodules`
|
1. Clone the repo using `git clone https://github.com/WerWolv/ImHex --recurse-submodules`
|
||||||
2. Install all the dependencies using `brew bundle --no-lock --file dist/Brewfile`
|
2. Install all the dependencies using `brew bundle --no-lock --file dist/macOS/Brewfile`
|
||||||
3. Build ImHex itself using the following commands:
|
3. Build ImHex itself using the following commands:
|
||||||
```sh
|
```sh
|
||||||
cd ImHex
|
cd ImHex
|
||||||
|
|
@ -19,4 +19,4 @@ cmake -G "Ninja" \
|
||||||
-DIMHEX_GENERATE_PACKAGE=ON \
|
-DIMHEX_GENERATE_PACKAGE=ON \
|
||||||
..
|
..
|
||||||
ninja install
|
ninja install
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
missingIncludeSystem
|
||||||
|
constParameter
|
||||||
|
unusedFunction
|
||||||
|
preprocessorErrorDirective
|
||||||
|
checkersReport
|
||||||
|
noExplicitConstructor
|
||||||
|
unmatchedSuppression
|
||||||
|
useInitializationList
|
||||||
|
useStlAlgorithm
|
||||||
|
knownConditionTrueFalse
|
||||||
|
internalAstError
|
||||||
|
unsignedPositive
|
||||||
|
variableScope
|
||||||
|
unusedPrivateFunction
|
||||||
|
constParameterCallback
|
||||||
|
|
||||||
|
*:*/lib/third_party/*
|
||||||
|
*:*/external/pattern_language/external/*
|
||||||
|
*:*/external/disassembler/external/*
|
||||||
|
*:*/lib/libimhex/source/ui/imgui_imhex_extensions.cpp
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
{
|
||||||
|
description = "ImHex";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }:
|
||||||
|
let
|
||||||
|
supportedSystems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
||||||
|
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
|
||||||
|
in {
|
||||||
|
devShells = forAllSystems (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.cmake
|
||||||
|
pkgs.clang
|
||||||
|
pkgs.lld
|
||||||
|
|
||||||
|
pkgs.nghttp3
|
||||||
|
pkgs.pkg-config
|
||||||
|
pkgs.glfw
|
||||||
|
pkgs.fontconfig
|
||||||
|
pkgs.file
|
||||||
|
pkgs.mbedtls
|
||||||
|
pkgs.freetype
|
||||||
|
pkgs.dbus
|
||||||
|
pkgs.gtk3
|
||||||
|
pkgs.curl
|
||||||
|
pkgs.fmt
|
||||||
|
pkgs.yara
|
||||||
|
pkgs.nlohmann_json
|
||||||
|
pkgs.ninja
|
||||||
|
pkgs.zlib
|
||||||
|
pkgs.bzip2
|
||||||
|
pkgs.xz
|
||||||
|
pkgs.zstd
|
||||||
|
pkgs.lz4
|
||||||
|
pkgs.libssh2
|
||||||
|
pkgs.md4c
|
||||||
|
];
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export CC=${pkgs.clang}/bin/clang
|
||||||
|
export CXX=${pkgs.clang}/bin/clang++
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
app-id: net.werwolv.ImHex
|
||||||
|
runtime: org.freedesktop.Platform
|
||||||
|
runtime-version: '24.08'
|
||||||
|
sdk: org.freedesktop.Sdk
|
||||||
|
command: imhex
|
||||||
|
rename-desktop-file: imhex.desktop
|
||||||
|
|
||||||
|
finish-args:
|
||||||
|
- --share=ipc
|
||||||
|
- --share=network
|
||||||
|
- --socket=wayland
|
||||||
|
- --socket=fallback-x11
|
||||||
|
- --filesystem=host
|
||||||
|
- --device=dri
|
||||||
|
|
||||||
|
modules:
|
||||||
|
- name: glfw
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
builddir: true
|
||||||
|
config-opts:
|
||||||
|
- -DBUILD_SHARED_LIBS=ON
|
||||||
|
- -DGLFW_BUILD_EXAMPLES=OFF
|
||||||
|
- -DGLFW_BUILD_TESTS=OFF
|
||||||
|
- -DGLFW_BUILD_DOCS=OFF
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip
|
||||||
|
sha256: b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib64/pkgconfig
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib64/cmake
|
||||||
|
|
||||||
|
- name: mbedtls
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DCMAKE_C_FLAGS=-fPIC
|
||||||
|
- -DENABLE_TESTING=OFF
|
||||||
|
- -DENABLE_PROGRAMS=OFF
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://github.com/ARMmbed/mbedtls/archive/refs/tags/v3.4.0.tar.gz
|
||||||
|
sha256: 1b899f355022e8d02c4d313196a0a16af86c5a692456fa99d302915b8cf0320a
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib64/pkgconfig
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib64/cmake
|
||||||
|
|
||||||
|
- name: fmt
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DBUILD_SHARED_LIBS=ON
|
||||||
|
- -DFMT_TEST=OFF
|
||||||
|
sources:
|
||||||
|
- type: archive
|
||||||
|
url: https://github.com/fmtlib/fmt/releases/download/10.0.0/fmt-10.0.0.zip
|
||||||
|
sha256: 4943cb165f3f587f26da834d3056ee8733c397e024145ca7d2a8a96bb71ac281
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib64/pkgconfig
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib64/cmake
|
||||||
|
|
||||||
|
- name: yara
|
||||||
|
buildsystem: autotools
|
||||||
|
sources:
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/VirusTotal/yara.git
|
||||||
|
tag: v4.3.1
|
||||||
|
commit: a6f6ce1d6d74a03c396660db25765f2a794d9e30
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib64/pkgconfig
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib64/cmake
|
||||||
|
|
||||||
|
- name: libssh2
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DBUILD_SHARED_LIBS=ON
|
||||||
|
- -DENABLE_ZLIB_COMPRESSION=OFF
|
||||||
|
- -DENABLE_MANUAL=OFF
|
||||||
|
- -DENABLE_EXAMPLES=OFF
|
||||||
|
- -DENABLE_TESTING=OFF
|
||||||
|
sources:
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/libssh2/libssh2.git
|
||||||
|
tag: libssh2-1.11.1
|
||||||
|
cleanup:
|
||||||
|
- /include
|
||||||
|
- /lib/pkgconfig
|
||||||
|
- /lib64/pkgconfig
|
||||||
|
- /lib/cmake
|
||||||
|
- /lib64/cmake
|
||||||
|
|
||||||
|
- name: md4c
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
config-opts:
|
||||||
|
- -DBUILD_SHARED_LIBS=ON
|
||||||
|
- -DMD4C_BUILD_TESTS=OFF
|
||||||
|
- -DMD4C_BUILD_EXAMPLES=OFF
|
||||||
|
- -DMD4C_BUILD_DOCS=OFF
|
||||||
|
sources:
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/mity/md4c.git
|
||||||
|
tag: release-0.5.2
|
||||||
|
|
||||||
|
- name: imhex
|
||||||
|
buildsystem: cmake-ninja
|
||||||
|
builddir: true
|
||||||
|
config-opts:
|
||||||
|
- -DUSE_SYSTEM_CURL=ON
|
||||||
|
- -DUSE_SYSTEM_FMT=ON
|
||||||
|
- -DUSE_SYSTEM_YARA=ON
|
||||||
|
- -DIMHEX_OFFLINE_BUILD=ON
|
||||||
|
- -DIMHEX_BUNDLE_PLUGIN_SDK=OFF
|
||||||
|
- -DCMAKE_INSTALL_LIBDIR=lib
|
||||||
|
- -DCMAKE_INSTALL_RPATH='$ORIGIN/../lib:$ORIGIN/../lib64'
|
||||||
|
sources:
|
||||||
|
- type: dir
|
||||||
|
path: ../..
|
||||||
|
- type: git
|
||||||
|
url: https://github.com/WerWolv/ImHex-Patterns.git
|
||||||
|
tag: master
|
||||||
|
dest: ImHex-Patterns
|
||||||
|
x-checker-data:
|
||||||
|
type: git
|
||||||
|
tag-pattern: ^ImHex-v([\d.]+)$
|
||||||
|
post-install:
|
||||||
|
- mkdir -p ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps
|
||||||
|
- cp ${FLATPAK_DEST}/share/pixmaps/imhex.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
|
||||||
|
- desktop-file-edit --set-key="Icon" --set-value="${FLATPAK_ID}" "${FLATPAK_DEST}/share/applications/imhex.desktop"
|
||||||
|
|
@ -0,0 +1,69 @@
|
||||||
|
from fontTools.ttLib import TTFont
|
||||||
|
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable
|
||||||
|
import argparse
|
||||||
|
|
||||||
|
# Default PUAs
|
||||||
|
SOURCE_PUA_START = 0xEA00
|
||||||
|
SOURCE_PUA_END = 0x100F2
|
||||||
|
TARGET_PUA_START = 0xF0000
|
||||||
|
|
||||||
|
def move_pua_glyphs(input_font_path, output_font_path):
|
||||||
|
font = TTFont(input_font_path)
|
||||||
|
|
||||||
|
cmap_table = font['cmap']
|
||||||
|
glyph_set = font.getGlyphSet()
|
||||||
|
|
||||||
|
# Track moved glyphs
|
||||||
|
moved = 0
|
||||||
|
new_mapping = {}
|
||||||
|
|
||||||
|
# Collect original mappings in the PUA
|
||||||
|
for cmap in cmap_table.tables:
|
||||||
|
if cmap.isUnicode():
|
||||||
|
for codepoint, glyph_name in cmap.cmap.items():
|
||||||
|
if SOURCE_PUA_START <= codepoint <= SOURCE_PUA_END:
|
||||||
|
offset = codepoint - SOURCE_PUA_START
|
||||||
|
new_codepoint = TARGET_PUA_START + offset
|
||||||
|
new_mapping[new_codepoint] = glyph_name
|
||||||
|
moved += 1
|
||||||
|
|
||||||
|
if moved == 0:
|
||||||
|
print("No glyphs found in the source Private Use Area.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Remove old PUA entries from existing cmap subtables
|
||||||
|
for cmap in cmap_table.tables:
|
||||||
|
if cmap.isUnicode():
|
||||||
|
cmap.cmap = {
|
||||||
|
cp: gn for cp, gn in cmap.cmap.items()
|
||||||
|
if not (SOURCE_PUA_START <= cp <= SOURCE_PUA_END)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Create or update a format 12 cmap subtable
|
||||||
|
found_format12 = False
|
||||||
|
for cmap in cmap_table.tables:
|
||||||
|
if cmap.format == 12 and cmap.platformID == 3 and cmap.platEncID in (10, 1):
|
||||||
|
cmap.cmap.update(new_mapping)
|
||||||
|
found_format12 = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if not found_format12:
|
||||||
|
# Create a new format 12 subtable
|
||||||
|
cmap12 = CmapSubtable.newSubtable(12)
|
||||||
|
cmap12.platformID = 3
|
||||||
|
cmap12.platEncID = 10 # UCS-4
|
||||||
|
cmap12.language = 0
|
||||||
|
cmap12.cmap = new_mapping
|
||||||
|
cmap_table.tables.append(cmap12)
|
||||||
|
|
||||||
|
print(f"Moved {moved} glyphs from U+{SOURCE_PUA_START:X}–U+{SOURCE_PUA_END:X} to U+{TARGET_PUA_START:X}+")
|
||||||
|
font.save(output_font_path)
|
||||||
|
print(f"Saved modified font to {output_font_path}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Move PUA glyphs in a TTF file to another Unicode range.")
|
||||||
|
parser.add_argument("input", help="Input TTF file path")
|
||||||
|
parser.add_argument("output", help="Output TTF file path")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
move_pua_glyphs(args.input, args.output)
|
||||||
|
|
@ -0,0 +1,60 @@
|
||||||
|
import argparse
|
||||||
|
from fontTools.ttLib import TTFont
|
||||||
|
import os
|
||||||
|
|
||||||
|
def unicode_to_utf8_escape(codepoint):
|
||||||
|
return ''.join([f'\\x{b:02x}' for b in chr(codepoint).encode('utf-8')])
|
||||||
|
|
||||||
|
def format_macro_name(prefix, glyph_name):
|
||||||
|
# Convert names like 'repo-forked' -> 'ICON_VS_REPO_FORKED'
|
||||||
|
return "ICON_" + prefix + "_" + glyph_name.upper().replace('-', '_')
|
||||||
|
|
||||||
|
def generate_font_header(font_path, output_path, font_macro_name, font_file_macro):
|
||||||
|
font = TTFont(font_path)
|
||||||
|
|
||||||
|
# Use cmap to get Unicode to glyph mapping
|
||||||
|
codepoint_to_names = {}
|
||||||
|
for table in font["cmap"].tables:
|
||||||
|
if table.isUnicode():
|
||||||
|
for codepoint, glyph_name in table.cmap.items():
|
||||||
|
codepoint_to_names.setdefault(codepoint, []).append(glyph_name)
|
||||||
|
|
||||||
|
if not codepoint_to_names:
|
||||||
|
print("No Unicode-mapped glyphs found in the font.")
|
||||||
|
return
|
||||||
|
|
||||||
|
# Remove any glyph that is lower than 0xFF
|
||||||
|
codepoint_to_names = {cp: names for cp, names in codepoint_to_names.items() if cp >= 0xFF}
|
||||||
|
|
||||||
|
min_cp = min(codepoint_to_names)
|
||||||
|
max_cp = max(codepoint_to_names)
|
||||||
|
|
||||||
|
with open(output_path, "w", encoding="utf-8") as out:
|
||||||
|
out.write("#pragma once\n\n")
|
||||||
|
out.write(f'#define FONT_ICON_FILE_NAME_{font_macro_name} "{font_file_macro}"\n\n')
|
||||||
|
out.write(f"#define ICON_MIN_{font_macro_name} 0x{min_cp:04x}\n")
|
||||||
|
out.write(f"#define ICON_MAX_16_{font_macro_name} 0x{max_cp:04x}\n")
|
||||||
|
out.write(f"#define ICON_MAX_{font_macro_name} 0x{max_cp:04x}\n")
|
||||||
|
|
||||||
|
written = set()
|
||||||
|
for codepoint in sorted(codepoint_to_names):
|
||||||
|
utf8 = unicode_to_utf8_escape(codepoint)
|
||||||
|
comment = f"// U+{codepoint:04X}"
|
||||||
|
glyph_names = sorted(set(codepoint_to_names[codepoint]))
|
||||||
|
for i, glyph_name in enumerate(glyph_names):
|
||||||
|
macro = format_macro_name(font_macro_name, glyph_name)
|
||||||
|
if macro in written:
|
||||||
|
continue
|
||||||
|
out.write(f"#define {macro} \"{utf8}\"\t{comment}\n")
|
||||||
|
written.add(macro)
|
||||||
|
|
||||||
|
print(f"Header generated at {output_path}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Generate C header file from TTF glyphs.")
|
||||||
|
parser.add_argument("font", help="Input .ttf font file")
|
||||||
|
parser.add_argument("output", help="Output .h file")
|
||||||
|
parser.add_argument("macro_name", help="Macro prefix")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
generate_font_header(args.font, args.output, args.macro_name, os.path.basename(args.font))
|
||||||
|
|
@ -32,11 +32,17 @@ def main(args: list) -> int:
|
||||||
|
|
||||||
sorted_commits = {}
|
sorted_commits = {}
|
||||||
for commit in master_commits:
|
for commit in master_commits:
|
||||||
category, commit_name = commit.split(":", 1)
|
if commit == "":
|
||||||
|
continue
|
||||||
|
|
||||||
if category not in sorted_commits:
|
try:
|
||||||
sorted_commits[category] = []
|
category, commit_name = commit.split(":", 1)
|
||||||
sorted_commits[category].append(commit_name)
|
|
||||||
|
if category not in sorted_commits:
|
||||||
|
sorted_commits[category] = []
|
||||||
|
sorted_commits[category].append(commit_name)
|
||||||
|
except:
|
||||||
|
print(f"Failed to parse commit: {commit}")
|
||||||
|
|
||||||
for category in sorted_commits:
|
for category in sorted_commits:
|
||||||
print(f"## {category}\n")
|
print(f"## {category}\n")
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,6 @@ pacman -S $@ --needed \
|
||||||
bzip2 \
|
bzip2 \
|
||||||
xz \
|
xz \
|
||||||
zstd \
|
zstd \
|
||||||
lz4
|
lz4 \
|
||||||
|
libssh2 \
|
||||||
|
md4c
|
||||||
|
|
|
||||||
|
|
@ -28,4 +28,7 @@ apt install -y \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
liblzma-dev \
|
liblzma-dev \
|
||||||
libzstd-dev \
|
libzstd-dev \
|
||||||
liblz4-dev
|
liblz4-dev \
|
||||||
|
libssh2-1-dev \
|
||||||
|
libmd4c-dev \
|
||||||
|
libmd4c-html0-dev
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,5 @@ dnf install -y \
|
||||||
zlib-devel \
|
zlib-devel \
|
||||||
bzip2-devel \
|
bzip2-devel \
|
||||||
xz-devel \
|
xz-devel \
|
||||||
lz4-devel
|
lz4-devel \
|
||||||
|
libssh2-devel
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
pacman -S --needed --noconfirm pactoys
|
pacman -S --needed --noconfirm pactoys unzip git
|
||||||
pacboy -S --needed --noconfirm \
|
pacboy -S --needed --noconfirm \
|
||||||
gcc:p \
|
gcc:p \
|
||||||
lld:p \
|
lld:p \
|
||||||
cmake:p \
|
cmake:p \
|
||||||
ccache:p \
|
ccache:p \
|
||||||
glfw:p \
|
glfw:p \
|
||||||
file:p \
|
file:p \
|
||||||
curl-winssl:p \
|
curl-winssl:p \
|
||||||
mbedtls:p \
|
mbedtls:p \
|
||||||
freetype:p \
|
freetype:p \
|
||||||
dlfcn:p \
|
dlfcn:p \
|
||||||
ninja:p \
|
ninja:p \
|
||||||
capstone:p \
|
capstone:p \
|
||||||
zlib:p \
|
zlib:p \
|
||||||
bzip2:p \
|
bzip2:p \
|
||||||
xz:p \
|
xz:p \
|
||||||
zstd:p \
|
zstd:p \
|
||||||
lz4:p
|
lz4:p \
|
||||||
|
libssh2-wincng:p \
|
||||||
|
md4c:p
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,6 @@ zypper install \
|
||||||
zlib-devel \
|
zlib-devel \
|
||||||
bzip3-devel \
|
bzip3-devel \
|
||||||
xz-devel \
|
xz-devel \
|
||||||
lz4-dev
|
lz4-dev \
|
||||||
|
libssh2-devel \
|
||||||
|
md4c-devel
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
|
Version=1.0
|
||||||
Name=ImHex
|
Name=ImHex
|
||||||
Comment=ImHex Hex Editor
|
Comment=ImHex Hex Editor
|
||||||
GenericName=Hex Editor
|
GenericName=Hex Editor
|
||||||
|
|
@ -10,3 +11,8 @@ Categories=Development;IDE;
|
||||||
StartupWMClass=imhex
|
StartupWMClass=imhex
|
||||||
Keywords=static-analysis;reverse-engineering;disassembler;disassembly;hacking;forensics;hex-editor;cybersecurity;security;binary-analysis;
|
Keywords=static-analysis;reverse-engineering;disassembler;disassembly;hacking;forensics;hex-editor;cybersecurity;security;binary-analysis;
|
||||||
MimeType=application/vnd.imhex.proj;
|
MimeType=application/vnd.imhex.proj;
|
||||||
|
Actions=NewFile;
|
||||||
|
|
||||||
|
[Desktop Action NewFile]
|
||||||
|
Exec=imhex --new
|
||||||
|
Name=Create New File
|
||||||
|
|
@ -92,18 +92,7 @@ def main():
|
||||||
|
|
||||||
with lang_file_path.open("w", encoding="utf-8") as new_lang_file:
|
with lang_file_path.open("w", encoding="utf-8") as new_lang_file:
|
||||||
new_lang_data = {
|
new_lang_data = {
|
||||||
"code": lang,
|
|
||||||
"language": (
|
|
||||||
exist_lang_data["language"]
|
|
||||||
if exist_lang_data
|
|
||||||
else input("Enter language name: ")
|
|
||||||
),
|
|
||||||
"country": (
|
|
||||||
exist_lang_data["country"]
|
|
||||||
if exist_lang_data
|
|
||||||
else input("Enter country name: ")
|
|
||||||
),
|
|
||||||
"translations": {},
|
|
||||||
}
|
}
|
||||||
json.dump(new_lang_data, new_lang_file, indent=4, ensure_ascii=False)
|
json.dump(new_lang_data, new_lang_file, indent=4, ensure_ascii=False)
|
||||||
|
|
||||||
|
|
@ -124,10 +113,10 @@ def main():
|
||||||
with lang_file_path.open("r+", encoding="utf-8") as target_lang_file:
|
with lang_file_path.open("r+", encoding="utf-8") as target_lang_file:
|
||||||
lang_data = json.load(target_lang_file)
|
lang_data = json.load(target_lang_file)
|
||||||
|
|
||||||
for key, value in default_lang_data["translations"].items():
|
for key, value in default_lang_data.items():
|
||||||
has_translation = (
|
has_translation = (
|
||||||
key in lang_data["translations"]
|
key in lang_data
|
||||||
and lang_data["translations"][key] != INVALID_TRANSLATION
|
and lang_data[key] != INVALID_TRANSLATION
|
||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
has_translation
|
has_translation
|
||||||
|
|
@ -140,7 +129,7 @@ def main():
|
||||||
continue
|
continue
|
||||||
if command == "check":
|
if command == "check":
|
||||||
print(
|
print(
|
||||||
f"Error: Translation {lang_data['code']} is missing translation for key '{key}'"
|
f"Error: Translation {lang_file_path} is missing translation for key '{key}'"
|
||||||
)
|
)
|
||||||
elif (
|
elif (
|
||||||
command == "translate"
|
command == "translate"
|
||||||
|
|
@ -150,45 +139,45 @@ def main():
|
||||||
if command == "untranslate" and not has_translation:
|
if command == "untranslate" and not has_translation:
|
||||||
continue
|
continue
|
||||||
reference_tranlsation = (
|
reference_tranlsation = (
|
||||||
" '%s'" % reference_lang_data["translations"][key]
|
" '%s'" % reference_lang_data[key]
|
||||||
if (
|
if (
|
||||||
reference_lang_data
|
reference_lang_data
|
||||||
and key in reference_lang_data["translations"]
|
and key in reference_lang_data
|
||||||
)
|
)
|
||||||
else ""
|
else ""
|
||||||
)
|
)
|
||||||
print(
|
print(
|
||||||
f"\033[1m'{key}' '{value}'{reference_tranlsation}\033[0m => {lang_data['language']}",
|
f"\033[1m'{key}' '{value}'{reference_tranlsation}\033[0m => ",
|
||||||
end="",
|
end="",
|
||||||
)
|
)
|
||||||
if has_translation:
|
if has_translation:
|
||||||
translation = lang_data["translations"][key]
|
translation = lang_data[key]
|
||||||
print(f" <= \033[1m'{translation}'\033[0m")
|
print(f" <= \033[1m'{translation}'\033[0m")
|
||||||
print() # for a new line
|
print() # for a new line
|
||||||
if command == "untranslate":
|
if command == "untranslate":
|
||||||
lang_data["translations"][key] = INVALID_TRANSLATION
|
lang_data[key] = INVALID_TRANSLATION
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
new_value = input("=> ")
|
new_value = input("=> ")
|
||||||
lang_data["translations"][key] = new_value
|
lang_data[key] = new_value
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
elif command == "update" or command == "create":
|
elif command == "update" or command == "create":
|
||||||
lang_data["translations"][key] = INVALID_TRANSLATION
|
lang_data[key] = INVALID_TRANSLATION
|
||||||
elif command == "fmtzh":
|
elif command == "fmtzh":
|
||||||
if has_translation:
|
if has_translation:
|
||||||
lang_data["translations"][key] = fmtzh(
|
lang_data[key] = fmtzh(
|
||||||
lang_data["translations"][key]
|
lang_data[key]
|
||||||
)
|
)
|
||||||
|
|
||||||
keys_to_remove = []
|
keys_to_remove = []
|
||||||
for key, value in lang_data["translations"].items():
|
for key, value in lang_data.items():
|
||||||
if key not in default_lang_data["translations"]:
|
if key not in default_lang_data:
|
||||||
keys_to_remove.append(key)
|
keys_to_remove.append(key)
|
||||||
for key in keys_to_remove:
|
for key in keys_to_remove:
|
||||||
lang_data["translations"].pop(key)
|
lang_data.pop(key)
|
||||||
print(
|
print(
|
||||||
f"Removed unused key '{key}' from translation '{lang_data['code']}'"
|
f"Removed unused key '{key}' from translation '{lang_file_path}'"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_lang_file.seek(0)
|
target_lang_file.seek(0)
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,6 @@ brew "ninja"
|
||||||
brew "zlib"
|
brew "zlib"
|
||||||
brew "xz"
|
brew "xz"
|
||||||
brew "bzip2"
|
brew "bzip2"
|
||||||
brew "zstd"
|
brew "zstd"
|
||||||
|
brew "libssh2"
|
||||||
|
brew "md4c"
|
||||||
|
|
@ -1,18 +1,29 @@
|
||||||
# This base image is also known as "crosscompile". See arm64.crosscompile.Dockerfile
|
# This base image is also known as "crosscompile". See arm64.crosscompile.Dockerfile
|
||||||
FROM ghcr.io/itrooz/macos-crosscompile:clang17-nosdk as build
|
FROM ghcr.io/werwolv/macos-crosscompile:4c4af2d1a6a102fab93cc9cd660280c2ec9d72af as build
|
||||||
|
|
||||||
ENV MACOSX_DEPLOYMENT_TARGET 13.0
|
ENV MACOSX_DEPLOYMENT_TARGET 13.0
|
||||||
|
|
||||||
# -- DOWNLOADING STUFF
|
# -- DOWNLOADING STUFF
|
||||||
|
|
||||||
|
# Update vcpkg
|
||||||
|
RUN <<EOF
|
||||||
|
cp /vcpkg/triplets/community/arm-osx-mytriplet.cmake /tmp/arm-osx-mytriplet.cmake
|
||||||
|
git -C /vcpkg clean -ffdx
|
||||||
|
git -C /vcpkg checkout origin/master
|
||||||
|
git -C /vcpkg reset --hard
|
||||||
|
git -C /vcpkg pull
|
||||||
|
/vcpkg/bootstrap-vcpkg.sh
|
||||||
|
cp /tmp/arm-osx-mytriplet.cmake /vcpkg/triplets/community/arm-osx-mytriplet.cmake
|
||||||
|
EOF
|
||||||
|
|
||||||
## Install make
|
## Install make
|
||||||
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y make
|
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y make cmake
|
||||||
|
|
||||||
## fix environment
|
## fix environment
|
||||||
### add install_name_tool for cmake command that won't have the right env set (see PostprocessBundle.cmake function postprocess_bundle())
|
### add install_name_tool for cmake command that won't have the right env set (see PostprocessBundle.cmake function postprocess_bundle())
|
||||||
RUN cp /osxcross/build/cctools-port/cctools/misc/install_name_tool /usr/bin/install_name_tool
|
RUN cp /osxcross/build/cctools-port/cctools/misc/install_name_tool /usr/bin/install_name_tool
|
||||||
### a cmake thing wants 'otool' and not '' apparently
|
### a cmake thing wants 'otool' and not '' apparently
|
||||||
RUN cp /osxcross/target/bin/aarch64-apple-darwin23-otool /usr/bin/otool
|
RUN cp /osxcross/target/bin/aarch64-apple-darwin24-otool /usr/bin/otool
|
||||||
|
|
||||||
## Clone glfw
|
## Clone glfw
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
|
|
@ -25,17 +36,17 @@ EOF
|
||||||
RUN --mount=type=cache,target=/cache <<EOF
|
RUN --mount=type=cache,target=/cache <<EOF
|
||||||
## Download SDK is missing (it may have been removed from the image)
|
## Download SDK is missing (it may have been removed from the image)
|
||||||
set -xe
|
set -xe
|
||||||
if [ ! -d /osxcross/target/SDK/MacOSX14.0.sdk ]; then
|
if [ ! -d /osxcross/target/SDK/MacOSX15.0.sdk ]; then
|
||||||
wget https://github.com/joseluisq/macosx-sdks/releases/download/14.0/MacOSX14.0.sdk.tar.xz -O /cache/MacOSX14.0.sdk.tar.xz -nc || true
|
wget https://github.com/joseluisq/macosx-sdks/releases/download/15.0/MacOSX15.0.sdk.tar.xz -O /cache/MacOSX15.0.sdk.tar.xz -nc || true
|
||||||
mkdir -p /osxcross/target/SDK
|
mkdir -p /osxcross/target/SDK
|
||||||
tar -C /osxcross/target/SDK -xf /cache/MacOSX14.0.sdk.tar.xz
|
tar -C /osxcross/target/SDK -xf /cache/MacOSX15.0.sdk.tar.xz
|
||||||
fi
|
fi
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
## Download libmagic
|
## Download libmagic
|
||||||
### Clone libmagic
|
### Clone libmagic
|
||||||
RUN git clone --depth 1 --branch FILE5_45 https://github.com/file/file /mnt/file
|
RUN git clone --depth 1 --branch FILE5_46 https://github.com/file/file /mnt/file
|
||||||
### Download libmagic dependencies
|
### Download libmagic dependencies
|
||||||
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y libtool autoconf
|
RUN --mount=type=cache,target=/var/lib/apt/lists/ apt update && apt install -y libtool autoconf
|
||||||
|
|
||||||
|
|
@ -56,6 +67,8 @@ vcpkg install --triplet=arm-osx-mytriplet zlib
|
||||||
vcpkg install --triplet=arm-osx-mytriplet bzip2
|
vcpkg install --triplet=arm-osx-mytriplet bzip2
|
||||||
vcpkg install --triplet=arm-osx-mytriplet liblzma
|
vcpkg install --triplet=arm-osx-mytriplet liblzma
|
||||||
vcpkg install --triplet=arm-osx-mytriplet zstd
|
vcpkg install --triplet=arm-osx-mytriplet zstd
|
||||||
|
vcpkg install --triplet=arm-osx-mytriplet openssl
|
||||||
|
vcpkg install --triplet=arm-osx-mytriplet libssh2
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
## Install glfw3 dep
|
## Install glfw3 dep
|
||||||
|
|
@ -88,7 +101,7 @@ RUN --mount=type=cache,target=/cache <<EOF
|
||||||
make -j $JOBS install
|
make -j $JOBS install
|
||||||
|
|
||||||
# Now, we cross-compile it and install it in the libraries folder
|
# Now, we cross-compile it and install it in the libraries folder
|
||||||
CC=/osxcross/target/bin/aarch64-apple-darwin23-clang CXX=/osxcross/target/bin/aarch64-apple-darwin23-clang++ ./configure --prefix /vcpkg/installed/arm-osx-mytriplet --host $OSXCROSS_HOST
|
CC=/osxcross/target/bin/aarch64-apple-darwin24-clang CXX=/osxcross/target/bin/aarch64-apple-darwin24-clang++ ./configure --prefix /vcpkg/installed/arm-osx-mytriplet --host $OSXCROSS_HOST
|
||||||
make -j $JOBS
|
make -j $JOBS
|
||||||
make install
|
make install
|
||||||
|
|
||||||
|
|
@ -126,7 +139,7 @@ if [ "$CUSTOM_GLFW" ]; then
|
||||||
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_OBJC_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_INSTALL_PREFIX=/vcpkg/installed/arm-osx-mytriplet \
|
-DCMAKE_INSTALL_PREFIX=/vcpkg/installed/arm-osx-mytriplet \
|
||||||
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \
|
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 \
|
||||||
..
|
..
|
||||||
ninja -j $JOBS install
|
ninja -j $JOBS install
|
||||||
|
|
||||||
|
|
@ -143,18 +156,19 @@ COPY --from=imhex / /mnt/ImHex
|
||||||
RUN --mount=type=cache,target=/cache --mount=type=cache,target=/mnt/ImHex/build/_deps \
|
RUN --mount=type=cache,target=/cache --mount=type=cache,target=/mnt/ImHex/build/_deps \
|
||||||
cd /mnt/ImHex && \
|
cd /mnt/ImHex && \
|
||||||
# compilers
|
# compilers
|
||||||
CC=o64-clang CXX=o64-clang++ OBJC=/osxcross/target/bin/aarch64-apple-darwin23-clang OBJCXX=/osxcross/target/bin/aarch64-apple-darwin23-clang++ \
|
CC=o64-clang CXX=o64-clang++ OBJC=/osxcross/target/bin/aarch64-apple-darwin24-clang OBJCXX=/osxcross/target/bin/aarch64-apple-darwin24-clang++ \
|
||||||
cmake -G "Ninja" \
|
cmake -G "Ninja" \
|
||||||
`# ccache flags` \
|
`# ccache flags` \
|
||||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OBJC_COMPILER_LAUNCHER=ccache -DCMAKE_OBJCXX_COMPILER_LAUNCHER=ccache \
|
||||||
`# MacOS cross-compiling flags` \
|
`# MacOS cross-compiling flags` \
|
||||||
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.0 \
|
-DVCPKG_TARGET_TRIPLET=arm-osx-mytriplet -DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/osxcross/target/toolchain.cmake -DCMAKE_OSX_SYSROOT=/osxcross/target/SDK/MacOSX14.0.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 \
|
||||||
`# Override compilers for code generators` \
|
`# Override compilers for code generators` \
|
||||||
-DNATIVE_CMAKE_C_COMPILER=/usr/bin/clang -DNATIVE_CMAKE_CXX_COMPILER=/usr/bin/clang++ \
|
-DNATIVE_CMAKE_C_COMPILER=/usr/bin/clang -DNATIVE_CMAKE_CXX_COMPILER=/usr/bin/clang++ \
|
||||||
`# Normal ImHex flags` \
|
`# Normal ImHex flags` \
|
||||||
-DIMHEX_GENERATE_PACKAGE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
-DIMHEX_GENERATE_PACKAGE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||||
`# other flags` \
|
`# other flags` \
|
||||||
-DIMHEX_STRICT_WARNINGS=OFF \
|
-DIMHEX_STRICT_WARNINGS=OFF \
|
||||||
|
-DIMHEX_PATTERNS_PULL_MASTER=ON \
|
||||||
-DCMAKE_INSTALL_PREFIX=/mnt/ImHex/build/install \
|
-DCMAKE_INSTALL_PREFIX=/mnt/ImHex/build/install \
|
||||||
-B build
|
-B build
|
||||||
## Build ImHex
|
## Build ImHex
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
# This image is is provided for reference, but a (probably more up to date) image should be available at https://github.com/iTrooz/macos-crosscompile
|
# This image is provided for reference, but a (probably more up to date) image should be available at https://github.com/iTrooz/macos-crosscompile
|
||||||
FROM ubuntu:22.04
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
ENV PATH $PATH:/osxcross/target/bin
|
ENV PATH $PATH:/osxcross/target/bin
|
||||||
ENV LD_LIBRARY_PATH /osxcross/target/lib
|
ENV LD_LIBRARY_PATH /osxcross/target/lib
|
||||||
ENV OSXCROSS_SDK /osxcross/target/SDK/MacOSX14.0.sdk
|
ENV OSXCROSS_SDK /osxcross/target/SDK/MacOSX14.0.sdk
|
||||||
ENV OSXCROSS_TARGET darwin23
|
ENV OSXCROSS_TARGET darwin24
|
||||||
ENV OSXCROSS_TARGET_DIR /osxcross/target
|
ENV OSXCROSS_TARGET_DIR /osxcross/target
|
||||||
ENV OSXCROSS_HOST aarch64-apple-darwin23
|
ENV OSXCROSS_HOST aarch64-apple-darwin24
|
||||||
|
|
||||||
# -- DOWNLOADING STUFF
|
# -- DOWNLOADING STUFF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
|
||||||
"${MINGW_PACKAGE_PREFIX}-zlib"
|
"${MINGW_PACKAGE_PREFIX}-zlib"
|
||||||
"${MINGW_PACKAGE_PREFIX}-bzip2"
|
"${MINGW_PACKAGE_PREFIX}-bzip2"
|
||||||
"${MINGW_PACKAGE_PREFIX}-xz"
|
"${MINGW_PACKAGE_PREFIX}-xz"
|
||||||
"${MINGW_PACKAGE_PREFIX}-zstd")
|
"${MINGW_PACKAGE_PREFIX}-zstd"
|
||||||
|
"${MINGW_PACKAGE_PREFIX}-libssh2-wincng"
|
||||||
|
"${MINGW_PACKAGE_PREFIX}-md4c")
|
||||||
|
|
||||||
source=()
|
source=()
|
||||||
sha256sums=()
|
sha256sums=()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,71 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<component type="desktop">
|
||||||
|
<id>net.werwolv.ImHex</id>
|
||||||
|
<name>ImHex</name>
|
||||||
|
<summary>Modern REing Hex Editor</summary>
|
||||||
|
<description>
|
||||||
|
<p>
|
||||||
|
ImHex is a modern Hex Editor for Reverse Engineers, Developers, Malware Analysists and Hackers who value
|
||||||
|
their retinas when working at 3 AM once again.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Features:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Featureful hex view</li>
|
||||||
|
<li>Custom C++-like pattern language for parsing and highlighting a file's content</li>
|
||||||
|
<li>Data importing and exporting</li>
|
||||||
|
<li>Data inspector allowing interpretation of data as many different types</li>
|
||||||
|
<li>Huge file support with fast and efficient loading</li>
|
||||||
|
<li>Strings search</li>
|
||||||
|
<li>File hashing support</li>
|
||||||
|
<li>Disassembler supporting many different architectures: ARM, x86, PowerPC, MIPS, and more</li>
|
||||||
|
<li>Bookmarks</li>
|
||||||
|
<li>Data analyzer</li>
|
||||||
|
<li>
|
||||||
|
Helpful tools such as an Itanium and MSVC demangler, ASCII table, Regex
|
||||||
|
replacer, mathematical expression evaluator (calculator), hexadecimal
|
||||||
|
color picker and many more
|
||||||
|
</li>
|
||||||
|
<li>Doesn't burn out your retinas when used in late-night sessions</li>
|
||||||
|
</ul>
|
||||||
|
</description>
|
||||||
|
<metadata_license>CC0-1.0</metadata_license>
|
||||||
|
<project_license>GPL-2.0-only</project_license>
|
||||||
|
<developer id="net.werwolv">
|
||||||
|
<name>WerWolv</name>
|
||||||
|
</developer>
|
||||||
|
<url type="homepage">https://imhex.werwolv.net</url>
|
||||||
|
<url type="bugtracker">https://github.com/WerWolv/ImHex/issues</url>
|
||||||
|
<url type="help">https://docs.werwolv.net/imhex</url>
|
||||||
|
<url type="donation">https://github.com/sponsors/WerWolv</url>
|
||||||
|
<url type="contact">https://imhex.werwolv.net/discord</url>
|
||||||
|
<url type="vcs-browser">https://github.com/WerWolv/ImHex</url>
|
||||||
|
<url type="contribute">https://github.com/WerWolv/ImHex/blob/master/CONTRIBUTING.md</url>
|
||||||
|
<launchable type="desktop-id">imhex.desktop</launchable>
|
||||||
|
<screenshots>
|
||||||
|
<screenshot type="default" width="1920" height="1017">
|
||||||
|
<image type="source">https://raw.githubusercontent.com/flathub/net.werwolv.ImHex/master/screenshots/screenshot1.png</image>
|
||||||
|
<caption>Using a pattern to parse and highlight different sections of an ELF executable file</caption>
|
||||||
|
</screenshot>
|
||||||
|
<screenshot type="default" width="1920" height="1017">
|
||||||
|
<image type="source">https://raw.githubusercontent.com/flathub/net.werwolv.ImHex/master/screenshots/screenshot2.png</image>
|
||||||
|
<caption>Managing bookmarks, diffing two files and decrypting a region of data using the data preprocessor</caption>
|
||||||
|
</screenshot>
|
||||||
|
</screenshots>
|
||||||
|
<content_rating type="oars-1.1"/>
|
||||||
|
<branding>
|
||||||
|
<color type="primary" scheme_preference="light">#babec9</color>
|
||||||
|
<color type="primary" scheme_preference="dark">#0f0f0f</color>
|
||||||
|
</branding>
|
||||||
|
<releases>
|
||||||
|
<release version="1.0.0" date="2025-01-01">
|
||||||
|
<description></description>
|
||||||
|
</release>
|
||||||
|
</releases>
|
||||||
|
<update_contact>hey@werwolv.net</update_contact>
|
||||||
|
<recommends>
|
||||||
|
<control>keyboard</control>
|
||||||
|
<control>pointing</control>
|
||||||
|
</recommends>
|
||||||
|
</component>
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
app-id: net.werwolv.ImHex
|
|
||||||
runtime: org.freedesktop.Platform
|
|
||||||
runtime-version: '20.08'
|
|
||||||
default-branch: stable
|
|
||||||
sdk: org.freedesktop.Sdk
|
|
||||||
command: imhex
|
|
||||||
|
|
||||||
finish-args:
|
|
||||||
- --share=ipc
|
|
||||||
- --socket=x11
|
|
||||||
- --filesystem=host
|
|
||||||
- --device=all
|
|
||||||
|
|
||||||
modules:
|
|
||||||
- name: imhex
|
|
||||||
buildsystem: cmake
|
|
||||||
config-opts:
|
|
||||||
- -DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
||||||
|
|
||||||
sources:
|
|
||||||
- type: git
|
|
||||||
url: https://github.com/WerWolv/ImHex.git
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<component type="desktop-application">
|
|
||||||
<id>imhex</id>
|
|
||||||
<metadata_license>CC0-1.0</metadata_license>
|
|
||||||
<project_license>GPL-2.0</project_license>
|
|
||||||
<name>ImHex</name>
|
|
||||||
<developer_name>WerWolv</developer_name>
|
|
||||||
<update_contact>hey@werwolv.net</update_contact>
|
|
||||||
<summary>A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM</summary>
|
|
||||||
<description>
|
|
||||||
<p>ImHex is a feature-rich Hex Editor aimed towards Reverse Engineers working with foreign data formats, malware, executables and raw memory.
|
|
||||||
Besides all the features a common Hex Editor has, ImHex also features a custom scripting language used to declare and dissect data structures, support for running YARA rules, a node-based graphical data pre-processor and support for various data sources such as files, raw disks or GDB Servers.</p>
|
|
||||||
</description>
|
|
||||||
<launchable type="desktop-id">imhex.desktop</launchable>
|
|
||||||
<url type="homepage">https://imhex.werwolv.net</url>
|
|
||||||
<screenshots>
|
|
||||||
<screenshot type="default">
|
|
||||||
<image>https://user-images.githubusercontent.com/10835354/139717326-8044769d-527b-4d88-8adf-2d4ecafdca1f.png</image>
|
|
||||||
</screenshot>
|
|
||||||
<screenshot>
|
|
||||||
<image>https://user-images.githubusercontent.com/10835354/139717323-1f8c9d52-f7eb-4f43-9f11-097ac728ed6c.png</image>
|
|
||||||
</screenshot>
|
|
||||||
</screenshots>
|
|
||||||
|
|
||||||
<provides>
|
|
||||||
<id>imhex.desktop</id>
|
|
||||||
</provides>
|
|
||||||
|
|
||||||
<categories>
|
|
||||||
<category>Development</category>
|
|
||||||
</categories>
|
|
||||||
|
|
||||||
|
|
||||||
</component>
|
|
||||||
|
|
@ -6,7 +6,7 @@ Release: 0%{?dist}
|
||||||
Summary: A hex editor for reverse engineers and programmers
|
Summary: A hex editor for reverse engineers and programmers
|
||||||
|
|
||||||
License: GPL-2.0-only AND Zlib AND MIT AND Apache-2.0
|
License: GPL-2.0-only AND Zlib AND MIT AND Apache-2.0
|
||||||
# imhex is gplv2. capstone is custom. nativefiledialog is Zlib.
|
# imhex is gplv2. capstone is custom.
|
||||||
# see license dir for full breakdown
|
# see license dir for full breakdown
|
||||||
URL: https://imhex.werwolv.net/
|
URL: https://imhex.werwolv.net/
|
||||||
# We need the archive with deps bundled
|
# We need the archive with deps bundled
|
||||||
|
|
@ -16,7 +16,6 @@ BuildRequires: cmake
|
||||||
BuildRequires: desktop-file-utils
|
BuildRequires: desktop-file-utils
|
||||||
BuildRequires: dbus-devel
|
BuildRequires: dbus-devel
|
||||||
BuildRequires: file-devel
|
BuildRequires: file-devel
|
||||||
BuildRequires: fontconfig-devel
|
|
||||||
BuildRequires: freetype-devel
|
BuildRequires: freetype-devel
|
||||||
BuildRequires: fmt-devel
|
BuildRequires: fmt-devel
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
|
|
@ -25,32 +24,41 @@ BuildRequires: libglvnd-devel
|
||||||
BuildRequires: glfw-devel
|
BuildRequires: glfw-devel
|
||||||
BuildRequires: json-devel
|
BuildRequires: json-devel
|
||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
BuildRequires: llvm-devel
|
BuildRequires: libarchive-devel
|
||||||
BuildRequires: mbedtls-devel
|
|
||||||
BuildRequires: yara-devel
|
|
||||||
BuildRequires: nativefiledialog-extended-devel
|
|
||||||
BuildRequires: dotnet-sdk-8.0
|
|
||||||
BuildRequires: libzstd-devel
|
BuildRequires: libzstd-devel
|
||||||
BuildRequires: zlib-devel
|
BuildRequires: zlib-devel
|
||||||
BuildRequires: bzip2-devel
|
BuildRequires: bzip2-devel
|
||||||
BuildRequires: xz-devel
|
BuildRequires: xz-devel
|
||||||
%if 0%{?rhel}
|
BuildRequires: llvm-devel
|
||||||
|
BuildRequires: mbedtls-devel
|
||||||
|
BuildRequires: yara-devel
|
||||||
|
BuildRequires: nativefiledialog-extended-devel
|
||||||
|
BuildRequires: lz4-devel
|
||||||
|
BuildRequires: libssh2-devel
|
||||||
|
%if 0%{?rhel} == 9
|
||||||
BuildRequires: gcc-toolset-14
|
BuildRequires: gcc-toolset-14
|
||||||
%endif
|
%endif
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} > 9
|
||||||
|
BuildRequires: capstone-devel
|
||||||
|
%endif
|
||||||
|
BuildRequires: lunasvg-devel
|
||||||
|
|
||||||
|
|
||||||
Provides: bundled(gnulib)
|
Provides: bundled(gnulib)
|
||||||
Provides: bundled(capstone) = 5.0-rc2
|
%if 0%{?rhel} == 10
|
||||||
Provides: bundled(imgui)
|
Provides: bundled(capstone) = 5.0.1
|
||||||
|
%endif
|
||||||
|
Provides: bundled(imgui) = 1.90.8
|
||||||
Provides: bundled(libromfs)
|
Provides: bundled(libromfs)
|
||||||
Provides: bundled(microtar)
|
Provides: bundled(microtar)
|
||||||
|
Provides: bundled(libpl) = %{version}
|
||||||
Provides: bundled(xdgpp)
|
Provides: bundled(xdgpp)
|
||||||
|
# working on packaging this, bundling for now as to now delay updates
|
||||||
|
Provides: bundled(miniaudio) = 0.11.11
|
||||||
|
|
||||||
# ftbfs on these arches. armv7hl might compile when capstone 5.x
|
|
||||||
# is released upstream and we can build against it
|
|
||||||
# [7:02 PM] WerWolv: We're not supporting 32 bit anyways soooo
|
# [7:02 PM] WerWolv: We're not supporting 32 bit anyways soooo
|
||||||
# [11:38 AM] WerWolv: Officially supported are x86_64 and aarch64
|
# [11:38 AM] WerWolv: Officially supported are x86_64 and aarch64
|
||||||
ExclusiveArch: x86_64 %{arm64} ppc64le
|
ExclusiveArch: x86_64 %{arm64}
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
ImHex is a Hex Editor, a tool to display, decode and analyze binary data to
|
ImHex is a Hex Editor, a tool to display, decode and analyze binary data to
|
||||||
|
|
@ -64,16 +72,33 @@ displayed, a disassembler, diffing support, bookmarks and much much more. At the
|
||||||
same time ImHex is completely free and open source under the GPLv2 language.
|
same time ImHex is completely free and open source under the GPLv2 language.
|
||||||
|
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for %{name}
|
||||||
|
License: GPL-2.0-only
|
||||||
|
%description devel
|
||||||
|
%{summary}
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n ImHex
|
%autosetup -n ImHex -p1
|
||||||
# remove bundled libs we aren't using
|
# remove bundled libs we aren't using
|
||||||
rm -rf lib/third_party/{fmt,nlohmann_json,yara}
|
rm -rf lib/third_party/{curl,fmt,llvm,nlohmann_json,yara}
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} > 9
|
||||||
|
rm -rf lib/third_party/capstone
|
||||||
|
%endif
|
||||||
|
|
||||||
|
# rhel 9 doesn't support all of the new appstream metainfo tags
|
||||||
|
%if 0%{?rhel} && 0%{?rhel} < 10
|
||||||
|
sed -i -e '/url type="vcs-browser"/d' \
|
||||||
|
-e '/url type="contribute"/d' \
|
||||||
|
dist/net.werwolv.ImHex.metainfo.xml
|
||||||
|
%endif
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if 0%{?rhel}
|
%if 0%{?rhel} == 9
|
||||||
. /opt/rh/gcc-toolset-14/enable
|
. /opt/rh/gcc-toolset-14/enable
|
||||||
%set_build_flags
|
%set_build_flags
|
||||||
CXXFLAGS+=" -std=gnu++23"
|
CXXFLAGS+=" -std=gnu++2b"
|
||||||
%endif
|
%endif
|
||||||
%cmake \
|
%cmake \
|
||||||
-D CMAKE_BUILD_TYPE=Release \
|
-D CMAKE_BUILD_TYPE=Release \
|
||||||
|
|
@ -81,23 +106,31 @@ CXXFLAGS+=" -std=gnu++23"
|
||||||
-D IMHEX_OFFLINE_BUILD=ON \
|
-D IMHEX_OFFLINE_BUILD=ON \
|
||||||
-D USE_SYSTEM_NLOHMANN_JSON=ON \
|
-D USE_SYSTEM_NLOHMANN_JSON=ON \
|
||||||
-D USE_SYSTEM_FMT=ON \
|
-D USE_SYSTEM_FMT=ON \
|
||||||
|
-D USE_SYSTEM_CURL=ON \
|
||||||
|
-D USE_SYSTEM_LLVM=ON \
|
||||||
|
-D USE_SYSTEM_MD4C=OFF \
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} > 9
|
||||||
|
-D USE_SYSTEM_CAPSTONE=ON \
|
||||||
|
%endif
|
||||||
|
-D USE_SYSTEM_LUNASVG=ON \
|
||||||
-D USE_SYSTEM_YARA=ON \
|
-D USE_SYSTEM_YARA=ON \
|
||||||
-D USE_SYSTEM_NFD=ON \
|
-D USE_SYSTEM_NFD=ON \
|
||||||
-D IMHEX_USE_GTK_FILE_PICKER=ON \
|
-D IMHEX_ENABLE_UNIT_TESTS=ON \
|
||||||
-D IMHEX_BUNDLE_DOTNET=OFF \
|
%if 0%{?rhel}
|
||||||
# when capstone >= 5.x is released we should be able to build against \
|
-D IMHEX_BUILD_HARDENING=OFF
|
||||||
# system libs of it \
|
%endif
|
||||||
# -D USE_SYSTEM_CAPSTONE=ON
|
# disable built-in build hardening because it is already
|
||||||
|
# done in rhel buildroots. adding the flags again from
|
||||||
|
# upstream generates build errors
|
||||||
|
|
||||||
%cmake_build
|
%cmake_build
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if 0%{?rhel}
|
# build binaries required for tests
|
||||||
. /opt/rh/gcc-toolset-14/enable
|
%cmake_build --target unit_tests
|
||||||
%set_build_flags
|
%ctest --exclude-regex '(Helpers/StoreAPI|Helpers/TipsAPI|Helpers/ContentAPI)'
|
||||||
CXXFLAGS+=" -std=gnu++23"
|
# Helpers/*API exclude tests that require network access
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
|
@ -105,15 +138,15 @@ CXXFLAGS+=" -std=gnu++23"
|
||||||
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
|
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
|
||||||
|
|
||||||
# this is a symlink for the old appdata name that we don't need
|
# this is a symlink for the old appdata name that we don't need
|
||||||
rm -f %{buildroot}%{_metainfodir}/net.werwolv.%{name}.appdata.xml
|
rm -f %{buildroot}%{_metainfodir}/net.werwolv.ImHex.appdata.xml
|
||||||
|
|
||||||
# AppData
|
# AppData
|
||||||
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
|
appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/net.werwolv.ImHex.metainfo.xml
|
||||||
|
|
||||||
# install licenses
|
# install licenses
|
||||||
cp -a lib/third_party/nativefiledialog/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/nativefiledialog-LICENSE
|
%if 0%{?rhel} == 9
|
||||||
cp -a lib/third_party/capstone/LICENSE.TXT %{buildroot}%{_datadir}/licenses/%{name}/capstone-LICENSE
|
cp -a lib/third_party/capstone/LICENSES/LICENSE.TXT %{buildroot}%{_datadir}/licenses/%{name}/capstone-LICENSE
|
||||||
cp -a lib/third_party/capstone/suite/regress/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/capstone-regress-LICENSE
|
%endif
|
||||||
cp -a lib/third_party/microtar/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/microtar-LICENSE
|
cp -a lib/third_party/microtar/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/microtar-LICENSE
|
||||||
cp -a lib/third_party/xdgpp/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/xdgpp-LICENSE
|
cp -a lib/third_party/xdgpp/LICENSE %{buildroot}%{_datadir}/licenses/%{name}/xdgpp-LICENSE
|
||||||
|
|
||||||
|
|
@ -122,10 +155,16 @@ cp -a lib/third_party/xdgpp/LICENSE %{buildroot
|
||||||
%license %{_datadir}/licenses/%{name}/
|
%license %{_datadir}/licenses/%{name}/
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_bindir}/imhex
|
%{_bindir}/imhex
|
||||||
%{_bindir}/imhex-updater
|
%{_datadir}/imhex/imhex
|
||||||
%{_datadir}/pixmaps/%{name}.png
|
%{_datadir}/pixmaps/%{name}.*
|
||||||
%{_datadir}/applications/%{name}.desktop
|
%{_datadir}/applications/%{name}.desktop
|
||||||
%{_datadir}/mime/packages/%{name}.xml
|
%{_libdir}/libimhex.so.*
|
||||||
%{_libdir}/libimhex.so*
|
|
||||||
%{_libdir}/%{name}/
|
%{_libdir}/%{name}/
|
||||||
%{_metainfodir}/net.werwolv.%{name}.metainfo.xml
|
%{_metainfodir}/net.werwolv.ImHex.metainfo.xml
|
||||||
|
%exclude %{_bindir}/imhex-updater
|
||||||
|
%{_datadir}/mime/packages/%{name}.xml
|
||||||
|
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%{_libdir}/libimhex.so
|
||||||
|
%{_datadir}/%{name}/sdk/
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,92 @@
|
||||||
|
name: imhex
|
||||||
|
title: ImHex
|
||||||
|
base: core24
|
||||||
|
version: ${IMHEX_VERSION_STRING}
|
||||||
|
summary: Hex editor for reverse engineering
|
||||||
|
description: ImHex is a hex editor for reverse engineering, reverse engineering, and analyzing binary files. It provides a powerful and flexible interface for working with binary data, including features like pattern matching, scripting, and a customizable user interface.
|
||||||
|
grade: stable
|
||||||
|
confinement: classic
|
||||||
|
contact: https://github.com/WerWolv/ImHex/discussions
|
||||||
|
issues: https://github.com/WerWolv/ImHex/issues
|
||||||
|
source-code: https://github.com/WerWolv/ImHex
|
||||||
|
website: https://imhex.werwolv.net
|
||||||
|
donation: https://github.com/sponsors/WerWolv
|
||||||
|
license: GPL-2.0-only
|
||||||
|
icon: resources/icon.svg
|
||||||
|
adopt-info: imhex
|
||||||
|
|
||||||
|
platforms:
|
||||||
|
amd64:
|
||||||
|
arm64:
|
||||||
|
|
||||||
|
apps:
|
||||||
|
imhex:
|
||||||
|
command: usr/local/bin/imhex
|
||||||
|
desktop: usr/local/share/applications/imhex.desktop
|
||||||
|
environment:
|
||||||
|
LD_LIBRARY_PATH: '$SNAP/usr/local/lib:$SNAP/usr/local/lib/imhex:$SNAP/usr/lib/x86_64-linux-gnu:$SNAP/usr/lib/aarch64-linux-gnu:$LD_LIBRARY_PATH'
|
||||||
|
XDG_DATA_DIRS: '$XDG_DATA_DIRS:$SNAP/usr/local/share:$SNAP/usr/local/lib:$SNAP/usr/local/share'
|
||||||
|
XDG_CONFIG_DIRS: '$XDG_CONFIG_DIRS:$SNAP/usr/local/share'
|
||||||
|
XDG_DATA_HOME: '$XDG_DATA_HOME:$SNAP_DATA'
|
||||||
|
|
||||||
|
parts:
|
||||||
|
imhex:
|
||||||
|
plugin: cmake
|
||||||
|
source: .
|
||||||
|
build-environment:
|
||||||
|
- CC: /usr/bin/gcc-14
|
||||||
|
- CXX: /usr/bin/g++-14
|
||||||
|
cmake-parameters:
|
||||||
|
- -DCMAKE_BUILD_TYPE=Release
|
||||||
|
- -DCMAKE_C_COMPILER_LAUNCHER=${CCACHE}
|
||||||
|
- -DCMAKE_CXX_COMPILER_LAUNCHER=${CCACHE}
|
||||||
|
- -DIMHEX_PATTERNS_PULL_MASTER=ON
|
||||||
|
- -DIMHEX_BUNDLE_PLUGIN_SDK=OFF
|
||||||
|
cmake-generator: Ninja
|
||||||
|
build-packages:
|
||||||
|
- cmake
|
||||||
|
- ninja-build
|
||||||
|
- gcc-14
|
||||||
|
- g++-14
|
||||||
|
- git
|
||||||
|
- pkg-config
|
||||||
|
- libglfw3-dev
|
||||||
|
- libmagic-dev
|
||||||
|
- libmbedtls-dev
|
||||||
|
- libfontconfig-dev
|
||||||
|
- libfreetype-dev
|
||||||
|
- libdbus-1-dev
|
||||||
|
- libcurl4-gnutls-dev
|
||||||
|
- libgtk-3-dev
|
||||||
|
- zlib1g-dev
|
||||||
|
- libbz2-dev
|
||||||
|
- liblzma-dev
|
||||||
|
- libzstd-dev
|
||||||
|
- liblz4-dev
|
||||||
|
- libssh2-1-dev
|
||||||
|
- libmd4c-dev
|
||||||
|
- libmd4c-html0-dev
|
||||||
|
stage-packages:
|
||||||
|
- libglfw3
|
||||||
|
- libmagic1
|
||||||
|
- libmbedtls14
|
||||||
|
- libfontconfig1
|
||||||
|
- libfreetype6
|
||||||
|
- libdbus-1-3
|
||||||
|
- libcurl4-gnutls-dev
|
||||||
|
- libgtk-3-0
|
||||||
|
- zlib1g
|
||||||
|
- libbz2-1.0
|
||||||
|
- liblzma5
|
||||||
|
- libzstd1
|
||||||
|
- liblz4-1
|
||||||
|
- libssh2-1
|
||||||
|
prime:
|
||||||
|
- -usr/include/*
|
||||||
|
- -usr/local/include/*
|
||||||
|
- -usr/lib/**/*.a
|
||||||
|
- -usr/local/lib/**/*.a
|
||||||
|
- -usr/lib/**/*.la
|
||||||
|
- -usr/local/lib/**/*.la
|
||||||
|
- -usr/share/doc/*
|
||||||
|
- -usr/share/man/*
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
{
|
||||||
|
"name": "vcpkg",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"builtin-baseline": "7e21420f775f72ae938bdeb5e6068f722088f06a",
|
||||||
|
"dependencies": [
|
||||||
|
"libmagic",
|
||||||
|
"freetype",
|
||||||
|
"mbedtls",
|
||||||
|
"zlib",
|
||||||
|
"bzip2",
|
||||||
|
"liblzma",
|
||||||
|
"zstd",
|
||||||
|
"glfw3",
|
||||||
|
"curl",
|
||||||
|
"libssh2",
|
||||||
|
"md4c"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -1,23 +1,24 @@
|
||||||
FROM emscripten/emsdk:3.1.51 as build
|
FROM emscripten/emsdk:4.0.21 AS build
|
||||||
|
|
||||||
# Used to invalidate layer cache but not mount cache
|
# Used to invalidate layer cache but not mount cache
|
||||||
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
# See https://github.com/moby/moby/issues/41715#issuecomment-733976493
|
||||||
ARG UNIQUEKEY 1
|
ARG UNIQUEKEY=1
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y git ccache autoconf automake libtool cmake pkg-config ninja-build
|
RUN apt install -y git ccache autoconf automake libtool pkg-config ninja-build
|
||||||
|
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
# Install vcpkg
|
# Install vcpkg
|
||||||
# Note: we are a patch on the libmagic port
|
# Note: we are a patch on the libmagic port
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
git clone https://github.com/microsoft/vcpkg /vcpkg
|
git clone --depth 1 https://github.com/microsoft/vcpkg /vcpkg
|
||||||
/vcpkg/bootstrap-vcpkg.sh
|
/vcpkg/bootstrap-vcpkg.sh
|
||||||
sed -i 's/vcpkg_install_make(${EXTRA_ARGS})/vcpkg_install_make(${EXTRA_ARGS} SUBPATH src)/g' /vcpkg/ports/libmagic/portfile.cmake
|
sed -i 's/vcpkg_install_make(${EXTRA_ARGS})/vcpkg_install_make(${EXTRA_ARGS} SUBPATH src)/g' /vcpkg/ports/libmagic/portfile.cmake
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Patch vcpkg build instructions to add -pthread
|
# Patch vcpkg build instructions to add -pthread flag
|
||||||
|
# Even dependencies must be built with -pthread to be able to use USE_PTHREADS=1
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
|
|
@ -27,7 +28,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
||||||
' >> /emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
' >> /emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ENV VCPKG_DEFAULT_BINARY_CACHE /cache/vcpkg
|
ENV VCPKG_DEFAULT_BINARY_CACHE=/cache/vcpkg
|
||||||
RUN --mount=type=cache,target=/cache <<EOF
|
RUN --mount=type=cache,target=/cache <<EOF
|
||||||
# Install dependencies with vcpkg
|
# Install dependencies with vcpkg
|
||||||
set -xe
|
set -xe
|
||||||
|
|
@ -45,21 +46,22 @@ EOF
|
||||||
|
|
||||||
# Build ImHex
|
# Build ImHex
|
||||||
ARG JOBS=4
|
ARG JOBS=4
|
||||||
ENV CCACHE_DIR /cache/ccache
|
ENV CCACHE_DIR=/cache/ccache
|
||||||
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
ARG BUILD_TYPE=Release
|
||||||
RUN --mount=type=cache,target=/cache \
|
RUN --mount=type=cache,target=/cache \
|
||||||
--mount=type=bind,source=.,target=/imhex <<EOF
|
--mount=type=bind,source=.,target=/imhex <<EOF
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
ccache -zs
|
ccache -zs
|
||||||
|
|
||||||
cmake /imhex \
|
/vcpkg/downloads/tools/cmake-*/cmake-*/bin/cmake /imhex \
|
||||||
-G "Ninja" \
|
-G "Ninja" \
|
||||||
-DIMHEX_OFFLINE_BUILD=ON \
|
-DIMHEX_OFFLINE_BUILD=ON \
|
||||||
-DIMHEX_STATIC_LINK_PLUGINS=ON \
|
-DIMHEX_STATIC_LINK_PLUGINS=ON \
|
||||||
-DIMHEX_EXCLUDE_PLUGINS="script_loader" \
|
-DIMHEX_EXCLUDE_PLUGINS="script_loader;remote" \
|
||||||
-DIMHEX_COMPRESS_DEBUG_INFO=OFF \
|
-DIMHEX_COMPRESS_DEBUG_INFO=OFF \
|
||||||
-DNATIVE_CMAKE_C_COMPILER=gcc \
|
-DNATIVE_CMAKE_C_COMPILER=gcc \
|
||||||
-DNATIVE_CMAKE_CXX_COMPILER=g++ \
|
-DNATIVE_CMAKE_CXX_COMPILER=g++ \
|
||||||
|
|
@ -67,7 +69,9 @@ cmake /imhex
|
||||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
-DCMAKE_TOOLCHAIN_FILE=/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||||
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
|
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Release
|
-DLIBROMFS_COMPRESS_RESOURCES=OFF \
|
||||||
|
-DIMHEX_ENABLE_PLUGIN_TESTS=OFF \
|
||||||
|
-DCMAKE_BUILD_TYPE=${BUILD_TYPE}
|
||||||
|
|
||||||
ninja -j $JOBS
|
ninja -j $JOBS
|
||||||
|
|
||||||
|
|
@ -79,13 +83,12 @@ EOF
|
||||||
# See https://stackoverflow.com/questions/41701849/cannot-modify-accept-encoding-with-fetch https://github.com/AnthumChris/fetch-progress-indicators/issues/13
|
# See https://stackoverflow.com/questions/41701849/cannot-modify-accept-encoding-with-fetch https://github.com/AnthumChris/fetch-progress-indicators/issues/13
|
||||||
RUN du -b /build/imhex.wasm | cut -f1 > imhex.wasm.size
|
RUN du -b /build/imhex.wasm | cut -f1 > imhex.wasm.size
|
||||||
|
|
||||||
FROM scratch as raw
|
FROM scratch AS raw
|
||||||
COPY --from=build [ \
|
COPY --from=build [ \
|
||||||
# ImHex \
|
# ImHex \
|
||||||
"/build/imhex.wasm", \
|
"/build/imhex.wasm", \
|
||||||
"/build/imhex.wasm.size", \
|
"/build/imhex.wasm.size", \
|
||||||
"/build/imhex.js", \
|
"/build/imhex.js", \
|
||||||
"/build/imhex.worker.js", \
|
|
||||||
\
|
\
|
||||||
# Static files \
|
# Static files \
|
||||||
"/build/index.html", \
|
"/build/index.html", \
|
||||||
|
|
@ -93,7 +96,7 @@ COPY --from=build [ \
|
||||||
"/build/wasm-config.js", \
|
"/build/wasm-config.js", \
|
||||||
"/build/enable-threads.js", \
|
"/build/enable-threads.js", \
|
||||||
"/build/favicon.ico", \
|
"/build/favicon.ico", \
|
||||||
"/build/icon.png", \
|
"/build/icon.svg", \
|
||||||
"/build/manifest.json", \
|
"/build/manifest.json", \
|
||||||
"/build/robots.txt", \
|
"/build/robots.txt", \
|
||||||
"/build/sitemap.xml", \
|
"/build/sitemap.xml", \
|
||||||
|
|
@ -104,3 +107,4 @@ COPY --from=build [ \
|
||||||
|
|
||||||
FROM nginx
|
FROM nginx
|
||||||
COPY --from=raw . /usr/share/nginx/html
|
COPY --from=raw . /usr/share/nginx/html
|
||||||
|
RUN chmod -R 755 /usr/share/nginx/html
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
# docker compose -f dist/web/compose.yml up --build
|
# docker compose -f dist/web/compose.yml up --build
|
||||||
version: '3'
|
|
||||||
services:
|
services:
|
||||||
imhex_web:
|
imhex_web:
|
||||||
image: imhex_web:latest
|
image: imhex_web:latest
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 122 KiB After Width: | Height: | Size: 162 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 157 KiB |
|
|
@ -0,0 +1,11 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" version="1">
|
||||||
|
<rect style="opacity:0.2" width="55" height="10" x="5" y="-60" rx="1.41" transform="rotate(90)"/>
|
||||||
|
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-60" rx="1.41" transform="rotate(90)"/>
|
||||||
|
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-14" rx="1.41" transform="rotate(90)"/>
|
||||||
|
<rect style="fill:#2b50a1" width="55" height="10" x="4" y="-33" rx="1.41" transform="rotate(90)"/>
|
||||||
|
<path style="opacity:0.2" d="M 5.3808594,5 C 4.6158118,5 4,5.6158118 4,6.3808594 V 13.619141 C 4,14.384188 4.6158118,15 5.3808594,15 H 31.619141 C 32.384188,15 33,14.384188 33,13.619141 V 6.3808594 C 33,5.6158118 32.384188,5 31.619141,5 Z M 40.400391,5 C 39.624791,5 39,5.6247906 39,6.4003906 V 13.599609 C 39,14.375209 39.624791,15 40.400391,15 H 58.599609 C 59.375209,15 60,14.375209 60,13.599609 V 6.4003906 C 60,5.6247906 59.375209,5 58.599609,5 Z M 5.3808594,50 C 4.6158118,50 4,50.615812 4,51.380859 v 7.238282 C 4,59.384188 4.6158118,60 5.3808594,60 H 31.619141 C 32.384188,60 33,59.384188 33,58.619141 V 51.380859 C 33,50.615812 32.384188,50 31.619141,50 Z"/>
|
||||||
|
<rect style="fill:#3a6be0" width="29" height="10" x="4" y="4" rx="1.381"/>
|
||||||
|
<rect style="fill:#3a6be0" width="21" height="10" x="39" y="4" rx="1.4"/>
|
||||||
|
<rect style="fill:#3a6be0" width="29" height="10" x="4" y="49" rx="1.381"/>
|
||||||
|
<path style="fill:#ffffff;opacity:0.1" d="M 5.3808594 4 C 4.6158118 4 4 4.6158118 4 5.3808594 L 4 6.3808594 C 4 5.6158118 4.6158118 5 5.3808594 5 L 31.619141 5 C 32.384188 5 33 5.6158118 33 6.3808594 L 33 5.3808594 C 33 4.6158118 32.384188 4 31.619141 4 L 5.3808594 4 z M 40.400391 4 C 39.624791 4 39 4.6247906 39 5.4003906 L 39 6.4003906 C 39 5.6247906 39.624791 5 40.400391 5 L 58.599609 5 C 59.375209 5 60 5.6247906 60 6.4003906 L 60 5.4003906 C 60 4.6247906 59.375209 4 58.599609 4 L 40.400391 4 z M 5.3808594 49 C 4.6158118 49 4 49.615812 4 50.380859 L 4 51.380859 C 4 50.615812 4.6158118 50 5.3808594 50 L 31.619141 50 C 32.384188 50 33 50.615812 33 51.380859 L 33 50.380859 C 33 49.615812 32.384188 49 31.619141 49 L 5.3808594 49 z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
|
|
@ -11,7 +11,7 @@
|
||||||
<meta name="title" content="ImHex">
|
<meta name="title" content="ImHex">
|
||||||
<meta name="description" content="Free and extremely powerful Online Hex Editor for your Web Browser. ImHex is a free and open source Hex Editor for Reverse Engineers and Developers and Data Analysts.">
|
<meta name="description" content="Free and extremely powerful Online Hex Editor for your Web Browser. ImHex is a free and open source Hex Editor for Reverse Engineers and Developers and Data Analysts.">
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link rel="apple-touch-icon" href="icon.png">
|
<link rel="apple-touch-icon" href="icon.svg">
|
||||||
|
|
||||||
<!-- Open Graph / Facebook -->
|
<!-- Open Graph / Facebook -->
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
"founder": "WerWolv",
|
"founder": "WerWolv",
|
||||||
"slogan": "A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.",
|
"slogan": "A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.",
|
||||||
"url": "https://imhex.werwolv.net",
|
"url": "https://imhex.werwolv.net",
|
||||||
"logo": "https://imhex.werwolv.net/assets/logos/logo.png"
|
"logo": "https://imhex.werwolv.net/assets/logos/logo.svg"
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
],
|
],
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
"src": "icon.png",
|
"src": "icon.svg",
|
||||||
"type": "image/png",
|
"type": "image/svg",
|
||||||
"sizes": "640x640"
|
"sizes": "640x640"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,11 @@
|
||||||
<loc>https://web.imhex.werwolv.net?lang=it-IT</loc>
|
<loc>https://web.imhex.werwolv.net?lang=it-IT</loc>
|
||||||
<lastmod>2024-01-02T11:44:00+00:00</lastmod>
|
<lastmod>2024-01-02T11:44:00+00:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
|
<url>
|
||||||
|
<title>Русский</title>
|
||||||
|
<loc>https://web.imhex.werwolv.net?lang=ru-RU</loc>
|
||||||
|
<lastmod>2024-01-02T11:44:00+00:00</lastmod>
|
||||||
|
</url>
|
||||||
|
|
||||||
|
|
||||||
</urlset>
|
</urlset>
|
||||||
|
|
@ -9,8 +9,9 @@ fetch("imhex.wasm.size").then(async (resp) => {
|
||||||
// inspired from: https://github.com/WordPress/wordpress-playground/pull/46 (but had to be modified)
|
// inspired from: https://github.com/WordPress/wordpress-playground/pull/46 (but had to be modified)
|
||||||
function monkeyPatch(progressFun) {
|
function monkeyPatch(progressFun) {
|
||||||
const _instantiateStreaming = WebAssembly.instantiateStreaming;
|
const _instantiateStreaming = WebAssembly.instantiateStreaming;
|
||||||
WebAssembly.instantiateStreaming = (response, ...args) => {
|
WebAssembly.instantiateStreaming = async (responsePromise, ...args) => {
|
||||||
// Do not collect wasm content length here see above
|
// Do not collect wasm content length here see above
|
||||||
|
let response = await responsePromise
|
||||||
const file = response.url.substring(
|
const file = response.url.substring(
|
||||||
new URL(response.url).origin.length + 1
|
new URL(response.url).origin.length + 1
|
||||||
);
|
);
|
||||||
|
|
@ -235,12 +236,11 @@ var Module = {
|
||||||
totalDependencies: 0,
|
totalDependencies: 0,
|
||||||
monitorRunDependencies: function(left) {
|
monitorRunDependencies: function(left) {
|
||||||
},
|
},
|
||||||
instantiateWasm: function(imports, successCallback) {
|
instantiateWasm: async function(imports, successCallback) {
|
||||||
imports.env.glfwSetCursor = glfwSetCursorCustom
|
imports.env.glfwSetCursor = glfwSetCursorCustom
|
||||||
imports.env.glfwCreateStandardCursor = glfwCreateStandardCursorCustom
|
imports.env.glfwCreateStandardCursor = glfwCreateStandardCursorCustom
|
||||||
instantiateAsync(wasmBinary, wasmBinaryFile, imports, (result) => {
|
let result = await instantiateAsync(null, findWasmBinary(), imports);
|
||||||
successCallback(result.instance, result.module)
|
successCallback(result.instance, result.module)
|
||||||
});
|
|
||||||
},
|
},
|
||||||
arguments: []
|
arguments: []
|
||||||
};
|
};
|
||||||
|
|
@ -251,6 +251,10 @@ const urlParams = new URLSearchParams(queryString);
|
||||||
if (urlParams.has("lang")) {
|
if (urlParams.has("lang")) {
|
||||||
Module["arguments"].push("--language");
|
Module["arguments"].push("--language");
|
||||||
Module["arguments"].push(urlParams.get("lang"));
|
Module["arguments"].push(urlParams.get("lang"));
|
||||||
|
} else if (urlParams.has("save-editor")) {
|
||||||
|
Module["arguments"].push("--save-editor");
|
||||||
|
Module["arguments"].push("gist");
|
||||||
|
Module["arguments"].push(urlParams.get("save-editor"));
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener('resize', js_resizeCanvas, false);
|
window.addEventListener('resize', js_resizeCanvas, false);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 72353526273abb3009cf906f48eb84df16ea91d5
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 03adcfdde0dd79f9426f567673df536e751a32e8
|
Subproject commit fa444f299501f2ec88eb9a11fa2bf8fc40832944
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit b9d7f4abafab5fd215972f4a83381e5bbf475962
|
Subproject commit b0c9416568475a784838e3af8b0021a542e47cd7
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit f45156a55c8706f8d312e4a52ac02259f8ba32e7
|
Subproject commit a06da46a3cf1694ccc785d21a37a2dca08deb56a
|
||||||
|
|
@ -39,10 +39,15 @@ set(LIBIMHEX_SOURCES
|
||||||
source/helpers/default_paths.cpp
|
source/helpers/default_paths.cpp
|
||||||
source/helpers/imgui_hooks.cpp
|
source/helpers/imgui_hooks.cpp
|
||||||
source/helpers/semantic_version.cpp
|
source/helpers/semantic_version.cpp
|
||||||
|
source/helpers/keys.cpp
|
||||||
|
source/helpers/udp_server.cpp
|
||||||
|
source/helpers/scaling.cpp
|
||||||
|
source/helpers/binary_pattern.cpp
|
||||||
|
|
||||||
source/test/tests.cpp
|
source/test/tests.cpp
|
||||||
|
|
||||||
source/providers/provider.cpp
|
source/providers/provider.cpp
|
||||||
|
source/providers/cached_provider.cpp
|
||||||
source/providers/memory_provider.cpp
|
source/providers/memory_provider.cpp
|
||||||
source/providers/undo/stack.cpp
|
source/providers/undo/stack.cpp
|
||||||
|
|
||||||
|
|
@ -50,21 +55,19 @@ set(LIBIMHEX_SOURCES
|
||||||
source/ui/view.cpp
|
source/ui/view.cpp
|
||||||
source/ui/popup.cpp
|
source/ui/popup.cpp
|
||||||
source/ui/toast.cpp
|
source/ui/toast.cpp
|
||||||
|
source/ui/banner.cpp
|
||||||
|
|
||||||
|
source/mcp/client.cpp
|
||||||
|
source/mcp/server.cpp
|
||||||
|
|
||||||
source/subcommands/subcommands.cpp
|
source/subcommands/subcommands.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(OSX_11_0_SDK_PATH /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk)
|
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES}
|
||||||
if (NOT CMAKE_OSX_SYSROOT)
|
source/helpers/utils_macos.m
|
||||||
if (IS_DIRECTORY ${OSX_11_0_SDK_PATH})
|
source/helpers/macos_menu.m
|
||||||
set(CMAKE_OSX_SYSROOT ${OSX_11_0_SDK_PATH})
|
)
|
||||||
else ()
|
|
||||||
message(WARNING "CMAKE_OSX_SYSROOT not set and macOS 10.9 SDK not found! Using default one.")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set(LIBIMHEX_SOURCES ${LIBIMHEX_SOURCES} source/helpers/utils_macos.m)
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
|
if (IMHEX_EXTERNAL_PLUGIN_BUILD)
|
||||||
|
|
@ -77,10 +80,21 @@ else()
|
||||||
add_library(libimhex SHARED ${LIBIMHEX_SOURCES})
|
add_library(libimhex SHARED ${LIBIMHEX_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (IMHEX_ENABLE_CXX_MODULES)
|
||||||
|
target_sources(libimhex
|
||||||
|
PUBLIC
|
||||||
|
FILE_SET cxx_modules TYPE CXX_MODULES
|
||||||
|
FILES
|
||||||
|
include/hex.cppm
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set(LIBIMHEX_LIBRARY_TYPE PUBLIC)
|
set(LIBIMHEX_LIBRARY_TYPE PUBLIC)
|
||||||
target_compile_definitions(libimhex PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
target_compile_definitions(libimhex PRIVATE IMHEX_PROJECT_NAME="${PROJECT_NAME}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
addCppCheck(libimhex)
|
||||||
|
|
||||||
|
|
||||||
if (DEFINED IMHEX_COMMIT_HASH_LONG AND DEFINED IMHEX_COMMIT_BRANCH)
|
if (DEFINED IMHEX_COMMIT_HASH_LONG AND DEFINED IMHEX_COMMIT_BRANCH)
|
||||||
set(GIT_COMMIT_HASH_LONG "${IMHEX_COMMIT_HASH_LONG}")
|
set(GIT_COMMIT_HASH_LONG "${IMHEX_COMMIT_HASH_LONG}")
|
||||||
|
|
@ -115,37 +129,55 @@ endif ()
|
||||||
|
|
||||||
addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
|
addDefineToSource(source/api/imhex_api.cpp "IMHEX_VERSION=\"${IMHEX_VERSION_STRING}\"")
|
||||||
|
|
||||||
|
string(TIMESTAMP IMHEX_BUILD_DATE UTC)
|
||||||
|
addDefineToSource(source/api/imhex_api.cpp "IMHEX_BUILD_DATE=\"${IMHEX_BUILD_DATE}\"")
|
||||||
|
|
||||||
enableUnityBuild(libimhex)
|
enableUnityBuild(libimhex)
|
||||||
setupCompilerFlags(libimhex)
|
setupCompilerFlags(libimhex)
|
||||||
|
|
||||||
include(GenerateExportHeader)
|
include(GenerateExportHeader)
|
||||||
generate_export_header(libimhex)
|
generate_export_header(libimhex)
|
||||||
|
|
||||||
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} include ${XDGPP_INCLUDE_DIRS} ${MBEDTLS_INCLUDE_DIR} ${MAGIC_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS} ${LIBBACKTRACE_INCLUDE_DIRS})
|
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} include ${XDGPP_INCLUDE_DIRS} ${LLVM_INCLUDE_DIRS} ${FMT_INCLUDE_DIRS})
|
||||||
target_link_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARY_DIR} ${MAGIC_LIBRARY_DIRS})
|
|
||||||
|
|
||||||
if (NOT EMSCRIPTEN)
|
|
||||||
# curl is only used in non-emscripten builds
|
|
||||||
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} CURL::libcurl)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
|
if (NOT IMHEX_EXTERNAL_PLUGIN_BUILD)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set_target_properties(libimhex PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
set_target_properties(libimhex PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
|
||||||
target_link_options(libimhex PRIVATE -Wl,--export-all-symbols)
|
if (NOT MSVC)
|
||||||
|
target_link_options(libimhex PRIVATE -Wl,--export-all-symbols)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(libimhex PRIVATE Netapi32.lib)
|
||||||
|
target_compile_definitions(libimhex PRIVATE EXPORT_SYMBOLS=1)
|
||||||
elseif (APPLE)
|
elseif (APPLE)
|
||||||
find_library(FOUNDATION NAMES Foundation)
|
find_library(FOUNDATION NAMES Foundation)
|
||||||
target_link_libraries(libimhex PUBLIC ${FOUNDATION})
|
find_library(USERNOTIFICATIONS NAMES UserNotifications)
|
||||||
|
target_link_libraries(libimhex PUBLIC ${FOUNDATION} ${USERNOTIFICATIONS})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(libimhex PRIVATE microtar libwolv ${NFD_LIBRARIES} magic dl ${JTHREAD_LIBRARIES})
|
target_link_libraries(libimhex PRIVATE libpl microtar ${NFD_LIBRARIES} magic)
|
||||||
target_link_libraries(libimhex PUBLIC libpl ${IMGUI_LIBRARIES})
|
target_link_libraries(libimhex PUBLIC libwolv libpl_includes libpl-gen ${IMGUI_LIBRARIES} ${JTHREAD_LIBRARIES})
|
||||||
|
|
||||||
|
if (IMHEX_ENABLE_IMGUI_TEST_ENGINE)
|
||||||
|
target_link_libraries(libimhex PUBLIC imgui_test_engine)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT WIN32)
|
||||||
|
target_link_libraries(libimhex PRIVATE dl)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT EMSCRIPTEN)
|
||||||
|
# curl is only used in non-emscripten builds
|
||||||
|
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} CURL::libcurl)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_INCLUDE_DIR} ${LIBBACKTRACE_INCLUDE_DIRS} ${MAGIC_INCLUDE_DIRS})
|
||||||
|
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARIES})
|
||||||
|
target_link_directories(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${MBEDTLS_LIBRARY_DIR} ${MAGIC_LIBRARY_DIRS})
|
||||||
|
|
||||||
precompileHeaders(libimhex "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
precompileHeaders(libimhex "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${MBEDTLS_LIBRARIES} ${FMT_LIBRARIES} ${LUNASVG_LIBRARIES} ${BOOST_LIBRARIES})
|
target_link_libraries(libimhex ${LIBIMHEX_LIBRARY_TYPE} ${NLOHMANN_JSON_LIBRARIES} imgui_all_includes ${FMT_LIBRARIES} ${LUNASVG_LIBRARIES} ${BOOST_LIBRARIES} tracing)
|
||||||
|
|
||||||
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
|
set_property(TARGET libimhex PROPERTY INTERPROCEDURAL_OPTIMIZATION FALSE)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
module;
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
#include <vector>
|
||||||
|
#include <exception>
|
||||||
|
#include <algorithm>
|
||||||
|
#include <locale>
|
||||||
|
#include <array>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <list>
|
||||||
|
#include <atomic>
|
||||||
|
#include <ranges>
|
||||||
|
#include <fstream>
|
||||||
|
#include <thread>
|
||||||
|
#include <future>
|
||||||
|
|
||||||
|
#include <fmt/format.h>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <wolv/io/file.hpp>
|
||||||
|
|
||||||
|
#include <imgui.h>
|
||||||
|
#include <imgui_internal.h>
|
||||||
|
#include <hex/ui/imgui_imhex_extensions.h>
|
||||||
|
|
||||||
|
#include <hex/helpers/auto_reset.hpp>
|
||||||
|
#include <hex/api/event_manager.hpp>
|
||||||
|
#include <hex/providers/provider.hpp>
|
||||||
|
#include <hex/providers/provider_data.hpp>
|
||||||
|
#include <hex/data_processor/node.hpp>
|
||||||
|
#include <hex/data_processor/link.hpp>
|
||||||
|
#include <hex/data_processor/attribute.hpp>
|
||||||
|
#include <pl/pattern_language.hpp>
|
||||||
|
|
||||||
|
export module hex;
|
||||||
|
|
||||||
|
#define HEX_MODULE_EXPORT
|
||||||
|
|
||||||
|
#include <hex/api/imhex_api/bookmarks.hpp>
|
||||||
|
#include <hex/api/imhex_api/hex_editor.hpp>
|
||||||
|
#include <hex/api/imhex_api/fonts.hpp>
|
||||||
|
#include <hex/api/imhex_api/messaging.hpp>
|
||||||
|
#include <hex/api/imhex_api/provider.hpp>
|
||||||
|
#include <hex/api/imhex_api/system.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/task_manager.hpp>
|
||||||
|
#include <hex/api/achievement_manager.hpp>
|
||||||
|
#include <hex/api/layout_manager.hpp>
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <hex/api/plugin_manager.hpp>
|
||||||
|
#include <hex/api/shortcut_manager.hpp>
|
||||||
|
#include <hex/api/theme_manager.hpp>
|
||||||
|
#include <hex/api/tutorial_manager.hpp>
|
||||||
|
#include <hex/api/workspace_manager.hpp>
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <hex/helpers/types.hpp>
|
#include <hex/helpers/types.hpp>
|
||||||
|
|
||||||
|
#if defined(HEX_MODULE_EXPORT)
|
||||||
|
#define EXPORT_MODULE export
|
||||||
|
#else
|
||||||
|
#define EXPORT_MODULE
|
||||||
|
#endif
|
||||||
|
|
@ -14,8 +14,9 @@
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <hex/ui/imgui_imhex_extensions.h>
|
#include <hex/ui/imgui_imhex_extensions.h>
|
||||||
#include <hex/api/localization_manager.hpp>
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <hex/helpers/auto_reset.hpp>
|
||||||
|
|
||||||
namespace hex {
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
class AchievementManager;
|
class AchievementManager;
|
||||||
|
|
||||||
|
|
@ -310,11 +311,15 @@ namespace hex {
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool isUnlockable() const {
|
[[nodiscard]] bool isUnlockable() const {
|
||||||
return std::all_of(this->parents.begin(), this->parents.end(), [](auto &parent) { return parent->achievement->isUnlocked(); });
|
return std::ranges::all_of(this->parents, [](const auto &parent) {
|
||||||
|
return parent->achievement->isUnlocked();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool isVisible() const {
|
[[nodiscard]] bool isVisible() const {
|
||||||
return std::all_of(this->visibilityParents.begin(), this->visibilityParents.end(), [](auto &parent) { return parent->achievement->isUnlocked(); });
|
return std::ranges::all_of(this->visibilityParents, [](const auto &parent) {
|
||||||
|
return parent->achievement->isUnlocked();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] bool isUnlocked() const {
|
[[nodiscard]] bool isUnlocked() const {
|
||||||
|
|
@ -361,7 +366,7 @@ namespace hex {
|
||||||
* @brief Returns all registered achievements
|
* @brief Returns all registered achievements
|
||||||
* @return All achievements
|
* @return All achievements
|
||||||
*/
|
*/
|
||||||
static const std::unordered_map<std::string, std::unordered_map<std::string, std::unique_ptr<Achievement>>>& getAchievements();
|
static const std::unordered_map<UnlocalizedString, std::unordered_map<UnlocalizedString, std::unique_ptr<Achievement>>>& getAchievements();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns all achievement start nodes
|
* @brief Returns all achievement start nodes
|
||||||
|
|
@ -369,14 +374,14 @@ namespace hex {
|
||||||
* @param rebuild Whether to rebuild the list of start nodes
|
* @param rebuild Whether to rebuild the list of start nodes
|
||||||
* @return All achievement start nodes
|
* @return All achievement start nodes
|
||||||
*/
|
*/
|
||||||
static const std::unordered_map<std::string, std::vector<AchievementNode*>>& getAchievementStartNodes(bool rebuild = true);
|
static const std::unordered_map<UnlocalizedString, std::vector<AchievementNode*>>& getAchievementStartNodes(bool rebuild = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns all achievement nodes
|
* @brief Returns all achievement nodes
|
||||||
* @param rebuild Whether to rebuild the list of nodes
|
* @param rebuild Whether to rebuild the list of nodes
|
||||||
* @return All achievement nodes
|
* @return All achievement nodes
|
||||||
*/
|
*/
|
||||||
static const std::unordered_map<std::string, std::list<AchievementNode>>& getAchievementNodes(bool rebuild = true);
|
static const std::unordered_map<UnlocalizedString, std::list<AchievementNode>>& getAchievementNodes(bool rebuild = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Loads the progress of all achievements from the achievements save file
|
* @brief Loads the progress of all achievements from the achievements save file
|
||||||
|
|
@ -405,4 +410,4 @@ namespace hex {
|
||||||
static Achievement& addAchievementImpl(std::unique_ptr<Achievement> &&newAchievement);
|
static Achievement& addAchievementImpl(std::unique_ptr<Achievement> &&newAchievement);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,22 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Background Service Registry. Allows adding new background services */
|
||||||
|
namespace ContentRegistry::BackgroundServices {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
using Callback = std::function<void()>;
|
||||||
|
|
||||||
|
void stopServices();
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerService(const UnlocalizedString &unlocalizedString, const impl::Callback &callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
#include <optional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Command Palette Command Registry. Allows adding of new commands to the command palette */
|
||||||
|
namespace ContentRegistry::CommandPalette {
|
||||||
|
|
||||||
|
enum class Type : u32 {
|
||||||
|
SymbolCommand,
|
||||||
|
KeywordCommand
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using QueryResultCallback = std::function<void(std::string)>;
|
||||||
|
|
||||||
|
struct QueryResult {
|
||||||
|
std::string name;
|
||||||
|
QueryResultCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
using ContentDisplayCallback = std::function<void()>;
|
||||||
|
using DisplayCallback = std::function<std::string(std::string)>;
|
||||||
|
using ExecuteCallback = std::function<std::optional<std::string>(std::string)>;
|
||||||
|
using QueryCallback = std::function<std::vector<QueryResult>(std::string)>;
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
Type type;
|
||||||
|
std::string command;
|
||||||
|
UnlocalizedString unlocalizedDescription;
|
||||||
|
DisplayCallback displayCallback;
|
||||||
|
ExecuteCallback executeCallback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Handler {
|
||||||
|
Type type;
|
||||||
|
std::string command;
|
||||||
|
QueryCallback queryCallback;
|
||||||
|
DisplayCallback displayCallback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ContentDisplay {
|
||||||
|
bool showSearchBox;
|
||||||
|
ContentDisplayCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
const std::vector<Handler>& getHandlers();
|
||||||
|
|
||||||
|
std::optional<ContentDisplay>& getDisplayedContent();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new command to the command palette
|
||||||
|
* @param type The type of the command
|
||||||
|
* @param command The command to add
|
||||||
|
* @param unlocalizedDescription The description of the command
|
||||||
|
* @param displayCallback The callback that will be called when the command is displayed in the command palette
|
||||||
|
* @param executeCallback The callback that will be called when the command is executed
|
||||||
|
*/
|
||||||
|
void add(
|
||||||
|
Type type,
|
||||||
|
const std::string &command,
|
||||||
|
const UnlocalizedString &unlocalizedDescription,
|
||||||
|
const impl::DisplayCallback &displayCallback,
|
||||||
|
const impl::ExecuteCallback &executeCallback = [](auto) { return std::nullopt; });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new command handler to the command palette
|
||||||
|
* @param type The type of the command
|
||||||
|
* @param command The command to add
|
||||||
|
* @param queryCallback The callback that will be called when the command palette wants to load the name and callback items
|
||||||
|
* @param displayCallback The callback that will be called when the command is displayed in the command palette
|
||||||
|
*/
|
||||||
|
void addHandler(
|
||||||
|
Type type,
|
||||||
|
const std::string &command,
|
||||||
|
const impl::QueryCallback &queryCallback,
|
||||||
|
const impl::DisplayCallback &displayCallback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Specify UI content that will be displayed inside the command palette
|
||||||
|
* @param displayCallback Display callback that will be called to display the content
|
||||||
|
*/
|
||||||
|
void setDisplayedContent(const impl::ContentDisplayCallback &displayCallback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Opens the command palette window, displaying a user defined interface
|
||||||
|
* @param displayCallback Display callback that will be called to display the content
|
||||||
|
*/
|
||||||
|
void openWithContent(const impl::ContentDisplayCallback &displayCallback);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <hex/mcp/server.hpp>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Network Communication Interface Registry. Allows adding new communication interface endpoints */
|
||||||
|
namespace ContentRegistry::CommunicationInterface {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
using NetworkCallback = std::function<nlohmann::json(const nlohmann::json &)>;
|
||||||
|
|
||||||
|
const std::map<std::string, NetworkCallback>& getNetworkEndpoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
void registerNetworkEndpoint(const std::string &endpoint, const impl::NetworkCallback &callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace ContentRegistry::MCP {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
mcp::Server& getMcpServerInstance();
|
||||||
|
|
||||||
|
void setEnabled(bool enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool isEnabled();
|
||||||
|
bool isConnected();
|
||||||
|
|
||||||
|
void registerTool(std::string_view capabilities, std::function<nlohmann::json(const nlohmann::json ¶ms)> function);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,73 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Data Formatter Registry. Allows adding formatters that are used in the Copy-As menu for example */
|
||||||
|
namespace ContentRegistry::DataFormatter {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using Callback = std::function<std::string(prv::Provider *provider, u64 address, size_t size, bool preview)>;
|
||||||
|
struct ExportMenuEntry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
Callback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct FindOccurrence {
|
||||||
|
Region region;
|
||||||
|
std::endian endian = std::endian::native;
|
||||||
|
enum class DecodeType : u8 { ASCII, UTF8, Binary, UTF16, Unsigned, Signed, Float, Double } decodeType;
|
||||||
|
bool selected;
|
||||||
|
std::string string;
|
||||||
|
};
|
||||||
|
|
||||||
|
using FindExporterCallback = std::function<std::vector<u8>(const std::vector<FindOccurrence>&, std::function<std::string(FindOccurrence)>)>;
|
||||||
|
struct FindExporterEntry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
std::string fileExtension;
|
||||||
|
FindExporterCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieves a list of all registered data formatters used by the 'File -> Export' menu
|
||||||
|
*/
|
||||||
|
const std::vector<ExportMenuEntry>& getExportMenuEntries();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Retrieves a list of all registered data formatters used in the Results section of the 'Find' view
|
||||||
|
*/
|
||||||
|
const std::vector<FindExporterEntry>& getFindExporterEntries();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new data formatter
|
||||||
|
* @param unlocalizedName The unlocalized name of the formatter
|
||||||
|
* @param callback The function to call to format the data
|
||||||
|
*/
|
||||||
|
void addExportMenuEntry(const UnlocalizedString &unlocalizedName, const impl::Callback &callback);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new data exporter for Find results
|
||||||
|
* @param unlocalizedName The unlocalized name of the formatter
|
||||||
|
* @param fileExtension The file extension to use for the exported file
|
||||||
|
* @param callback The function to call to format the data
|
||||||
|
*/
|
||||||
|
void addFindExportFormatter(const UnlocalizedString &unlocalizedName, const std::string &fileExtension, const impl::FindExporterCallback &callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,81 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/task_manager.hpp>
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Data Information Registry. Allows adding new analyzers to the data information view */
|
||||||
|
namespace ContentRegistry::DataInformation {
|
||||||
|
|
||||||
|
class InformationSection {
|
||||||
|
public:
|
||||||
|
InformationSection(const UnlocalizedString &unlocalizedName, const UnlocalizedString &unlocalizedDescription = "", bool hasSettings = false)
|
||||||
|
: m_unlocalizedName(unlocalizedName), m_unlocalizedDescription(unlocalizedDescription),
|
||||||
|
m_hasSettings(hasSettings) { }
|
||||||
|
virtual ~InformationSection() = default;
|
||||||
|
|
||||||
|
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
|
||||||
|
[[nodiscard]] const UnlocalizedString& getUnlocalizedDescription() const { return m_unlocalizedDescription; }
|
||||||
|
|
||||||
|
virtual void process(Task &task, prv::Provider *provider, Region region) = 0;
|
||||||
|
virtual void reset() = 0;
|
||||||
|
|
||||||
|
virtual void drawSettings() { }
|
||||||
|
virtual void drawContent() = 0;
|
||||||
|
|
||||||
|
[[nodiscard]] bool isValid() const { return m_valid; }
|
||||||
|
void markValid(bool valid = true) { m_valid = valid; }
|
||||||
|
|
||||||
|
[[nodiscard]] bool isEnabled() const { return m_enabled; }
|
||||||
|
void setEnabled(bool enabled) { m_enabled = enabled; }
|
||||||
|
|
||||||
|
[[nodiscard]] bool isAnalyzing() const { return m_analyzing; }
|
||||||
|
void setAnalyzing(bool analyzing) { m_analyzing = analyzing; }
|
||||||
|
|
||||||
|
virtual void load(const nlohmann::json &data);
|
||||||
|
[[nodiscard]] virtual nlohmann::json store();
|
||||||
|
|
||||||
|
[[nodiscard]] bool hasSettings() const { return m_hasSettings; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
UnlocalizedString m_unlocalizedName, m_unlocalizedDescription;
|
||||||
|
bool m_hasSettings;
|
||||||
|
|
||||||
|
std::atomic<bool> m_analyzing = false;
|
||||||
|
std::atomic<bool> m_valid = false;
|
||||||
|
std::atomic<bool> m_enabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using CreateCallback = std::function<std::unique_ptr<InformationSection>()>;
|
||||||
|
|
||||||
|
const std::vector<CreateCallback>& getInformationSectionConstructors();
|
||||||
|
void addInformationSectionCreator(const CreateCallback &callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void addInformationSection(auto && ...args) {
|
||||||
|
impl::addInformationSectionCreator([args...] {
|
||||||
|
return std::make_unique<T>(std::forward<decltype(args)>(args)...);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,112 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <optional>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <bit>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Data Inspector Registry. Allows adding of new types to the data inspector */
|
||||||
|
namespace ContentRegistry::DataInspector {
|
||||||
|
|
||||||
|
enum class NumberDisplayStyle : u8 {
|
||||||
|
Decimal,
|
||||||
|
Hexadecimal,
|
||||||
|
Octal
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
struct DoNotUseThisByItselfTag {};
|
||||||
|
|
||||||
|
using DisplayFunction = std::function<std::string()>;
|
||||||
|
using EditingFunction = std::function<std::optional<std::vector<u8>>(std::string&, std::endian, DoNotUseThisByItselfTag)>;
|
||||||
|
using GeneratorFunction = std::function<DisplayFunction(const std::vector<u8> &, std::endian, NumberDisplayStyle)>;
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
size_t requiredSize;
|
||||||
|
size_t maxSize;
|
||||||
|
GeneratorFunction generatorFunction;
|
||||||
|
std::optional<EditingFunction> editingFunction;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace EditWidget {
|
||||||
|
|
||||||
|
class Widget {
|
||||||
|
public:
|
||||||
|
using Function = std::function<std::vector<u8>(const std::string&, std::endian)>;
|
||||||
|
|
||||||
|
explicit Widget(const Function &function) : m_function(function) {}
|
||||||
|
|
||||||
|
virtual ~Widget() = default;
|
||||||
|
virtual std::optional<std::vector<u8>> draw(std::string &value, std::endian endian) = 0;
|
||||||
|
std::optional<std::vector<u8>> operator()(std::string &value, std::endian endian, impl::DoNotUseThisByItselfTag) {
|
||||||
|
return draw(value, endian);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<u8> getBytes(const std::string &value, std::endian endian) const {
|
||||||
|
return m_function(value, endian);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Function m_function;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TextInput : Widget {
|
||||||
|
explicit TextInput(const Function &function) : Widget(function) {}
|
||||||
|
std::optional<std::vector<u8>> draw(std::string &value, std::endian endian) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new entry to the data inspector
|
||||||
|
* @param unlocalizedName The unlocalized name of the entry
|
||||||
|
* @param requiredSize The minimum required number of bytes available for the entry to appear
|
||||||
|
* @param displayGeneratorFunction The function that will be called to generate the display function
|
||||||
|
* @param editingFunction The function that will be called to edit the data
|
||||||
|
*/
|
||||||
|
void add(
|
||||||
|
const UnlocalizedString &unlocalizedName,
|
||||||
|
size_t requiredSize,
|
||||||
|
impl::GeneratorFunction displayGeneratorFunction,
|
||||||
|
std::optional<impl::EditingFunction> editingFunction = std::nullopt
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new entry to the data inspector
|
||||||
|
* @param unlocalizedName The unlocalized name of the entry
|
||||||
|
* @param requiredSize The minimum required number of bytes available for the entry to appear
|
||||||
|
* @param maxSize The maximum number of bytes to read from the data
|
||||||
|
* @param displayGeneratorFunction The function that will be called to generate the display function
|
||||||
|
* @param editingFunction The function that will be called to edit the data
|
||||||
|
*/
|
||||||
|
void add(
|
||||||
|
const UnlocalizedString &unlocalizedName,
|
||||||
|
size_t requiredSize,
|
||||||
|
size_t maxSize,
|
||||||
|
impl::GeneratorFunction displayGeneratorFunction,
|
||||||
|
std::optional<impl::EditingFunction> editingFunction = std::nullopt
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Allows adding new menu items to data inspector row context menus. Call this function inside the
|
||||||
|
* draw function of the data inspector row definition.
|
||||||
|
* @param function Callback that will draw menu items
|
||||||
|
*/
|
||||||
|
void drawMenuItems(const std::function<void()> &function);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace dp { class Node; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Data Processor Node Registry. Allows adding new processor nodes to be used in the data processor */
|
||||||
|
namespace ContentRegistry::DataProcessor {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using CreatorFunction = std::function<std::unique_ptr<dp::Node>()>;
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
UnlocalizedString unlocalizedCategory;
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
CreatorFunction creatorFunction;
|
||||||
|
};
|
||||||
|
|
||||||
|
void add(const Entry &entry);
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new node to the data processor
|
||||||
|
* @tparam T The custom node class that extends dp::Node
|
||||||
|
* @tparam Args Arguments types
|
||||||
|
* @param unlocalizedCategory The unlocalized category name of the node
|
||||||
|
* @param unlocalizedName The unlocalized name of the node
|
||||||
|
* @param args Arguments passed to the constructor of the node
|
||||||
|
*/
|
||||||
|
template<std::derived_from<dp::Node> T, typename... Args>
|
||||||
|
void add(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, Args &&...args) {
|
||||||
|
add(impl::Entry {
|
||||||
|
unlocalizedCategory,
|
||||||
|
unlocalizedName,
|
||||||
|
[unlocalizedName, ...args = std::forward<Args>(args)]() mutable {
|
||||||
|
auto node = std::make_unique<T>(std::forward<Args>(args)...);
|
||||||
|
node->setUnlocalizedName(unlocalizedName);
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a separator to the data processor right click menu
|
||||||
|
*/
|
||||||
|
void addSeparator();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <wolv/container/interval_tree.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Diffing Registry. Allows adding new diffing algorithms */
|
||||||
|
namespace ContentRegistry::Diffing {
|
||||||
|
|
||||||
|
enum class DifferenceType : u8 {
|
||||||
|
Match = 0,
|
||||||
|
Insertion = 1,
|
||||||
|
Deletion = 2,
|
||||||
|
Mismatch = 3
|
||||||
|
};
|
||||||
|
|
||||||
|
using DiffTree = wolv::container::IntervalTree<DifferenceType>;
|
||||||
|
|
||||||
|
class Algorithm {
|
||||||
|
public:
|
||||||
|
explicit Algorithm(UnlocalizedString unlocalizedName, UnlocalizedString unlocalizedDescription)
|
||||||
|
: m_unlocalizedName(std::move(unlocalizedName)),
|
||||||
|
m_unlocalizedDescription(std::move(unlocalizedDescription)) { }
|
||||||
|
|
||||||
|
virtual ~Algorithm() = default;
|
||||||
|
|
||||||
|
virtual std::vector<DiffTree> analyze(prv::Provider *providerA, prv::Provider *providerB) const = 0;
|
||||||
|
virtual void drawSettings() { }
|
||||||
|
|
||||||
|
const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
|
||||||
|
const UnlocalizedString& getUnlocalizedDescription() const { return m_unlocalizedDescription; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
UnlocalizedString m_unlocalizedName, m_unlocalizedDescription;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
const std::vector<std::unique_ptr<Algorithm>>& getAlgorithms();
|
||||||
|
|
||||||
|
void addAlgorithm(std::unique_ptr<Algorithm> &&hash);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new hash
|
||||||
|
* @tparam T The hash type that extends hex::Hash
|
||||||
|
* @param args The arguments to pass to the constructor of the hash
|
||||||
|
*/
|
||||||
|
template<typename T, typename ... Args>
|
||||||
|
void addAlgorithm(Args && ... args) {
|
||||||
|
impl::addAlgorithm(std::make_unique<T>(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,64 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <optional>
|
||||||
|
#include <span>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Disassembler Registry. Allows adding new disassembler architectures */
|
||||||
|
namespace ContentRegistry::Disassemblers {
|
||||||
|
|
||||||
|
struct Instruction {
|
||||||
|
u64 address;
|
||||||
|
u64 offset;
|
||||||
|
size_t size;
|
||||||
|
std::string bytes;
|
||||||
|
std::string mnemonic;
|
||||||
|
std::string operators;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Architecture {
|
||||||
|
public:
|
||||||
|
explicit Architecture(std::string name) : m_name(std::move(name)) {}
|
||||||
|
virtual ~Architecture() = default;
|
||||||
|
|
||||||
|
virtual bool start() = 0;
|
||||||
|
virtual void end() = 0;
|
||||||
|
|
||||||
|
virtual std::optional<Instruction> disassemble(u64 imageBaseAddress, u64 instructionLoadAddress, u64 instructionDataAddress, std::span<const u8> code) = 0;
|
||||||
|
virtual void drawSettings() = 0;
|
||||||
|
|
||||||
|
[[nodiscard]] const std::string& getName() const { return m_name; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string m_name;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using CreatorFunction = std::function<std::unique_ptr<Architecture>()>;
|
||||||
|
|
||||||
|
void addArchitectureCreator(CreatorFunction function);
|
||||||
|
|
||||||
|
const std::map<std::string, CreatorFunction>& getArchitectures();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
template<std::derived_from<Architecture> T>
|
||||||
|
void add(auto && ...args) {
|
||||||
|
impl::addArchitectureCreator([...args = std::move(args)] {
|
||||||
|
return std::make_unique<T>(args...);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Experiments Registry. Allows adding new experiments */
|
||||||
|
namespace ContentRegistry::Experiments {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
struct Experiment {
|
||||||
|
UnlocalizedString unlocalizedName, unlocalizedDescription;
|
||||||
|
bool enabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::map<std::string, Experiment>& getExperiments();
|
||||||
|
}
|
||||||
|
|
||||||
|
void addExperiment(
|
||||||
|
const std::string &experimentName,
|
||||||
|
const UnlocalizedString &unlocalizedName,
|
||||||
|
const UnlocalizedString &unlocalizedDescription = ""
|
||||||
|
);
|
||||||
|
|
||||||
|
void enableExperiement(const std::string &experimentName, bool enabled);
|
||||||
|
|
||||||
|
[[nodiscard]] bool isExperimentEnabled(const std::string &experimentName);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/helpers/fs.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* File Handler Registry. Allows adding handlers for opening files specific file types */
|
||||||
|
namespace ContentRegistry::FileTypeHandler {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using Callback = std::function<bool(std::fs::path)>;
|
||||||
|
struct Entry {
|
||||||
|
std::vector<std::string> extensions;
|
||||||
|
Callback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new file handler
|
||||||
|
* @param extensions The file extensions to handle
|
||||||
|
* @param callback The function to call to handle the file
|
||||||
|
*/
|
||||||
|
void add(const std::vector<std::string> &extensions, const impl::Callback &callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
#include <nlohmann/json_fwd.hpp>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Hash Registry. Allows adding new hashes to the Hash view */
|
||||||
|
namespace ContentRegistry::Hashes {
|
||||||
|
|
||||||
|
class Hash {
|
||||||
|
public:
|
||||||
|
explicit Hash(UnlocalizedString unlocalizedName) : m_unlocalizedName(std::move(unlocalizedName)) {}
|
||||||
|
virtual ~Hash() = default;
|
||||||
|
|
||||||
|
class Function {
|
||||||
|
public:
|
||||||
|
using Callback = std::function<std::vector<u8>(const Region&, prv::Provider *)>;
|
||||||
|
|
||||||
|
Function(Hash *type, std::string name, Callback callback)
|
||||||
|
: m_type(type), m_name(std::move(name)), m_callback(std::move(callback)) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] Hash *getType() { return m_type; }
|
||||||
|
[[nodiscard]] const Hash *getType() const { return m_type; }
|
||||||
|
[[nodiscard]] const std::string& getName() const { return m_name; }
|
||||||
|
|
||||||
|
std::vector<u8> get(const Region& region, prv::Provider *provider) const {
|
||||||
|
return m_callback(region, provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Hash *m_type;
|
||||||
|
std::string m_name;
|
||||||
|
Callback m_callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtual void draw() { }
|
||||||
|
[[nodiscard]] virtual Function create(std::string name) = 0;
|
||||||
|
|
||||||
|
[[nodiscard]] virtual nlohmann::json store() const = 0;
|
||||||
|
virtual void load(const nlohmann::json &json) = 0;
|
||||||
|
|
||||||
|
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const {
|
||||||
|
return m_unlocalizedName;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
[[nodiscard]] Function create(const std::string &name, const Function::Callback &callback) {
|
||||||
|
return { this, name, callback };
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
UnlocalizedString m_unlocalizedName;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
const std::vector<std::unique_ptr<Hash>>& getHashes();
|
||||||
|
|
||||||
|
void add(std::unique_ptr<Hash> &&hash);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new hash
|
||||||
|
* @tparam T The hash type that extends hex::Hash
|
||||||
|
* @param args The arguments to pass to the constructor of the hash
|
||||||
|
*/
|
||||||
|
template<typename T, typename ... Args>
|
||||||
|
void add(Args && ... args) {
|
||||||
|
impl::add(std::make_unique<T>(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <span>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Hex Editor Registry. Allows adding new functionality to the hex editor */
|
||||||
|
namespace ContentRegistry::HexEditor {
|
||||||
|
|
||||||
|
class DataVisualizer {
|
||||||
|
public:
|
||||||
|
DataVisualizer(UnlocalizedString unlocalizedName, u16 bytesPerCell, u16 maxCharsPerCell)
|
||||||
|
: m_unlocalizedName(std::move(unlocalizedName)),
|
||||||
|
m_bytesPerCell(bytesPerCell),
|
||||||
|
m_maxCharsPerCell(maxCharsPerCell) { }
|
||||||
|
|
||||||
|
virtual ~DataVisualizer() = default;
|
||||||
|
|
||||||
|
virtual void draw(u64 address, const u8 *data, size_t size, bool upperCase) = 0;
|
||||||
|
virtual bool drawEditing(u64 address, u8 *data, size_t size, bool upperCase, bool startedEditing) = 0;
|
||||||
|
|
||||||
|
[[nodiscard]] u16 getBytesPerCell() const { return m_bytesPerCell; }
|
||||||
|
[[nodiscard]] u16 getMaxCharsPerCell() const { return m_maxCharsPerCell; }
|
||||||
|
|
||||||
|
[[nodiscard]] const UnlocalizedString& getUnlocalizedName() const { return m_unlocalizedName; }
|
||||||
|
|
||||||
|
[[nodiscard]] static int DefaultTextInputFlags();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool drawDefaultScalarEditingTextBox(u64 address, const char *format, ImGuiDataType dataType, u8 *data, ImGuiInputTextFlags flags) const;
|
||||||
|
bool drawDefaultTextEditingTextBox(u64 address, std::string &data, ImGuiInputTextFlags flags) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
UnlocalizedString m_unlocalizedName;
|
||||||
|
u16 m_bytesPerCell;
|
||||||
|
u16 m_maxCharsPerCell;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MiniMapVisualizer {
|
||||||
|
using Callback = std::function<void(u64, std::span<const u8>, std::vector<ImColor>&)>;
|
||||||
|
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
Callback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
void addDataVisualizer(std::shared_ptr<DataVisualizer> &&visualizer);
|
||||||
|
|
||||||
|
const std::vector<std::shared_ptr<DataVisualizer>>& getVisualizers();
|
||||||
|
const std::vector<std::shared_ptr<MiniMapVisualizer>>& getMiniMapVisualizers();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new cell data visualizer
|
||||||
|
* @tparam T The data visualizer type that extends hex::DataVisualizer
|
||||||
|
* @param args The arguments to pass to the constructor of the data visualizer
|
||||||
|
*/
|
||||||
|
template<std::derived_from<DataVisualizer> T, typename... Args>
|
||||||
|
void addDataVisualizer(Args &&...args) {
|
||||||
|
return impl::addDataVisualizer(std::make_shared<T>(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets a data visualizer by its unlocalized name
|
||||||
|
* @param unlocalizedName Unlocalized name of the data visualizer
|
||||||
|
* @return The data visualizer, or nullptr if it doesn't exist
|
||||||
|
*/
|
||||||
|
std::shared_ptr<DataVisualizer> getVisualizerByName(const UnlocalizedString &unlocalizedName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new minimap visualizer
|
||||||
|
* @param unlocalizedName Unlocalized name of the minimap visualizer
|
||||||
|
* @param callback The callback that will be called to get the color of a line
|
||||||
|
*/
|
||||||
|
void addMiniMapVisualizer(UnlocalizedString unlocalizedName, MiniMapVisualizer::Callback callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,155 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <pl/pattern_language.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <span>
|
||||||
|
#include <string>
|
||||||
|
#include <map>
|
||||||
|
#include <vector>
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Pattern Language Function Registry. Allows adding of new functions that may be used inside the pattern language */
|
||||||
|
namespace ContentRegistry::PatternLanguage {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using VisualizerFunctionCallback = std::function<void(pl::ptrn::Pattern&, bool, std::span<const pl::core::Token::Literal>)>;
|
||||||
|
|
||||||
|
struct FunctionDefinition {
|
||||||
|
pl::api::Namespace ns;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
pl::api::FunctionParameterCount parameterCount;
|
||||||
|
pl::api::FunctionCallback callback;
|
||||||
|
|
||||||
|
bool dangerous;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TypeDefinition {
|
||||||
|
pl::api::Namespace ns;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
pl::api::FunctionParameterCount parameterCount;
|
||||||
|
pl::api::TypeCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Visualizer {
|
||||||
|
pl::api::FunctionParameterCount parameterCount;
|
||||||
|
VisualizerFunctionCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::map<std::string, Visualizer>& getVisualizers();
|
||||||
|
const std::map<std::string, Visualizer>& getInlineVisualizers();
|
||||||
|
const std::map<std::string, pl::api::PragmaHandler>& getPragmas();
|
||||||
|
const std::vector<FunctionDefinition>& getFunctions();
|
||||||
|
const std::vector<TypeDefinition>& getTypes();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Provides access to the current provider's pattern language runtime
|
||||||
|
* @return Runtime
|
||||||
|
*/
|
||||||
|
pl::PatternLanguage& getRuntime();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Provides access to the current provider's pattern language runtime's lock
|
||||||
|
* @return Lock
|
||||||
|
*/
|
||||||
|
std::mutex& getRuntimeLock();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configures the pattern language runtime using ImHex's default settings
|
||||||
|
* @param runtime The pattern language runtime to configure
|
||||||
|
* @param provider The provider to use for data access
|
||||||
|
*/
|
||||||
|
void configureRuntime(pl::PatternLanguage &runtime, prv::Provider *provider);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new pragma to the pattern language
|
||||||
|
* @param name The name of the pragma
|
||||||
|
* @param handler The handler that will be called when the pragma is encountered
|
||||||
|
*/
|
||||||
|
void addPragma(const std::string &name, const pl::api::PragmaHandler &handler);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new function to the pattern language
|
||||||
|
* @param ns The namespace of the function
|
||||||
|
* @param name The name of the function
|
||||||
|
* @param parameterCount The amount of parameters the function takes
|
||||||
|
* @param func The function callback
|
||||||
|
*/
|
||||||
|
void addFunction(
|
||||||
|
const pl::api::Namespace &ns,
|
||||||
|
const std::string &name,
|
||||||
|
pl::api::FunctionParameterCount parameterCount,
|
||||||
|
const pl::api::FunctionCallback &func
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new dangerous function to the pattern language
|
||||||
|
* @note Dangerous functions are functions that require the user to explicitly allow them to be used
|
||||||
|
* @param ns The namespace of the function
|
||||||
|
* @param name The name of the function
|
||||||
|
* @param parameterCount The amount of parameters the function takes
|
||||||
|
* @param func The function callback
|
||||||
|
*/
|
||||||
|
void addDangerousFunction(
|
||||||
|
const pl::api::Namespace &ns,
|
||||||
|
const std::string &name,
|
||||||
|
pl::api::FunctionParameterCount parameterCount,
|
||||||
|
const pl::api::FunctionCallback &func
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new type to the pattern language
|
||||||
|
* @param ns The namespace of the type
|
||||||
|
* @param name The name of the type
|
||||||
|
* @param parameterCount The amount of non-type template parameters the type takes
|
||||||
|
* @param func The type callback
|
||||||
|
*/
|
||||||
|
void addType(
|
||||||
|
const pl::api::Namespace &ns,
|
||||||
|
const std::string &name,
|
||||||
|
pl::api::FunctionParameterCount parameterCount,
|
||||||
|
const pl::api::TypeCallback &func
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new visualizer to the pattern language
|
||||||
|
* @note Visualizers are extensions to the [[hex::visualize]] attribute, used to visualize data
|
||||||
|
* @param name The name of the visualizer
|
||||||
|
* @param function The function callback
|
||||||
|
* @param parameterCount The amount of parameters the function takes
|
||||||
|
*/
|
||||||
|
void addVisualizer(
|
||||||
|
const std::string &name,
|
||||||
|
const impl::VisualizerFunctionCallback &function,
|
||||||
|
pl::api::FunctionParameterCount parameterCount
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new inline visualizer to the pattern language
|
||||||
|
* @note Inline visualizers are extensions to the [[hex::inline_visualize]] attribute, used to visualize data
|
||||||
|
* @param name The name of the visualizer
|
||||||
|
* @param function The function callback
|
||||||
|
* @param parameterCount The amount of parameters the function takes
|
||||||
|
*/
|
||||||
|
void addInlineVisualizer(
|
||||||
|
const std::string &name,
|
||||||
|
const impl::VisualizerFunctionCallback &function,
|
||||||
|
pl::api::FunctionParameterCount parameterCount
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <hex/providers/provider.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Provider Registry. Allows adding new data providers to be created from the UI */
|
||||||
|
namespace ContentRegistry::Provider {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
void addProviderName(const UnlocalizedString &unlocalizedName, const char *icon);
|
||||||
|
|
||||||
|
using ProviderCreationFunction = std::function<std::shared_ptr<prv::Provider>()>;
|
||||||
|
void add(const std::string &typeName, ProviderCreationFunction creationFunction);
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
const char *icon;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new provider to the list of providers
|
||||||
|
* @tparam T The provider type that extends hex::prv::Provider
|
||||||
|
* @param addToList Whether to display the provider in the Other Providers list in the welcome screen and File menu
|
||||||
|
*/
|
||||||
|
template<std::derived_from<prv::Provider> T>
|
||||||
|
void add(bool addToList = true) {
|
||||||
|
const T provider;
|
||||||
|
auto typeName = provider.getTypeName();
|
||||||
|
|
||||||
|
impl::add(typeName, []() -> std::unique_ptr<prv::Provider> {
|
||||||
|
return std::make_unique<T>();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (addToList)
|
||||||
|
impl::addProviderName(typeName, provider.getIcon());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
#if !defined(HEX_MODULE_EXPORT)
|
||||||
|
namespace prv { class Provider; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Reports Registry. Allows adding new sections to exported reports */
|
||||||
|
namespace ContentRegistry::Reports {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using Callback = std::function<std::string(prv::Provider*)>;
|
||||||
|
|
||||||
|
struct ReportGenerator {
|
||||||
|
Callback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<ReportGenerator>& getGenerators();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void addReportProvider(impl::Callback callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,353 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <hex/helpers/fs.hpp>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Settings Registry. Allows adding of new entries into the ImHex preferences window. */
|
||||||
|
namespace ContentRegistry::Settings {
|
||||||
|
|
||||||
|
namespace Widgets {
|
||||||
|
|
||||||
|
class Widget {
|
||||||
|
public:
|
||||||
|
virtual ~Widget() = default;
|
||||||
|
|
||||||
|
virtual bool draw(const std::string &name) = 0;
|
||||||
|
|
||||||
|
virtual void load(const nlohmann::json &data) = 0;
|
||||||
|
virtual nlohmann::json store() = 0;
|
||||||
|
|
||||||
|
class Interface {
|
||||||
|
public:
|
||||||
|
friend class Widget;
|
||||||
|
|
||||||
|
Interface& requiresRestart() {
|
||||||
|
m_requiresRestart = true;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface& setEnabledCallback(std::function<bool()> callback) {
|
||||||
|
m_enabledCallback = std::move(callback);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface& setChangedCallback(std::function<void(Widget&)> callback) {
|
||||||
|
m_changedCallback = std::move(callback);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface& setTooltip(const std::string &tooltip) {
|
||||||
|
m_tooltip = tooltip;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Widget& getWidget() const {
|
||||||
|
return *m_widget;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
explicit Interface(Widget *widget) : m_widget(widget) {}
|
||||||
|
Widget *m_widget;
|
||||||
|
|
||||||
|
bool m_requiresRestart = false;
|
||||||
|
std::function<bool()> m_enabledCallback;
|
||||||
|
std::function<void(Widget&)> m_changedCallback;
|
||||||
|
std::optional<UnlocalizedString> m_tooltip;
|
||||||
|
};
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
bool doesRequireRestart() const {
|
||||||
|
return m_interface.m_requiresRestart;
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
bool isEnabled() const {
|
||||||
|
return !m_interface.m_enabledCallback || m_interface.m_enabledCallback();
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
const std::optional<UnlocalizedString>& getTooltip() const {
|
||||||
|
return m_interface.m_tooltip;
|
||||||
|
}
|
||||||
|
|
||||||
|
void onChanged() {
|
||||||
|
if (m_interface.m_changedCallback)
|
||||||
|
m_interface.m_changedCallback(*this);
|
||||||
|
}
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
Interface& getInterface() {
|
||||||
|
return m_interface;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
Interface m_interface = Interface(this);
|
||||||
|
};
|
||||||
|
|
||||||
|
class Checkbox : public Widget {
|
||||||
|
public:
|
||||||
|
explicit Checkbox(bool defaultValue) : m_value(defaultValue) { }
|
||||||
|
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] bool isChecked() const { return m_value; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
bool m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SliderInteger : public Widget {
|
||||||
|
public:
|
||||||
|
SliderInteger(i32 defaultValue, i32 min, i32 max) : m_value(defaultValue), m_min(min), m_max(max) { }
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] i32 getValue() const { return m_value; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
int m_value;
|
||||||
|
i32 m_min, m_max;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SliderFloat : public Widget {
|
||||||
|
public:
|
||||||
|
SliderFloat(float defaultValue, float min, float max) : m_value(defaultValue), m_min(min), m_max(max) { }
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] float getValue() const { return m_value; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
float m_value;
|
||||||
|
float m_min, m_max;
|
||||||
|
};
|
||||||
|
|
||||||
|
class SliderDataSize : public Widget {
|
||||||
|
public:
|
||||||
|
SliderDataSize(u64 defaultValue, u64 min, u64 max, u64 stepSize) : m_value(defaultValue), m_min(min), m_max(max), m_stepSize(stepSize) { }
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] i32 getValue() const { return m_value; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
u64 m_value;
|
||||||
|
u64 m_min, m_max;
|
||||||
|
u64 m_stepSize;
|
||||||
|
};
|
||||||
|
|
||||||
|
class ColorPicker : public Widget {
|
||||||
|
public:
|
||||||
|
explicit ColorPicker(ImColor defaultColor, ImGuiColorEditFlags flags = 0);
|
||||||
|
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] ImColor getColor() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::array<float, 4> m_value = {}, m_defaultValue = {};
|
||||||
|
ImGuiColorEditFlags m_flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DropDown : public Widget {
|
||||||
|
public:
|
||||||
|
explicit DropDown(const std::vector<std::string> &items, const std::vector<nlohmann::json> &settingsValues, const nlohmann::json &defaultItem) : m_items(items.begin(), items.end()), m_settingsValues(settingsValues), m_defaultItem(defaultItem) { }
|
||||||
|
explicit DropDown(const std::vector<UnlocalizedString> &items, const std::vector<nlohmann::json> &settingsValues, const nlohmann::json &defaultItem) : m_items(items), m_settingsValues(settingsValues), m_defaultItem(defaultItem) { }
|
||||||
|
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
const nlohmann::json& getValue() const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::vector<UnlocalizedString> m_items;
|
||||||
|
std::vector<nlohmann::json> m_settingsValues;
|
||||||
|
nlohmann::json m_defaultItem;
|
||||||
|
|
||||||
|
int m_value = -1;
|
||||||
|
};
|
||||||
|
|
||||||
|
class TextBox : public Widget {
|
||||||
|
public:
|
||||||
|
explicit TextBox(std::string defaultValue) : m_value(std::move(defaultValue)) { }
|
||||||
|
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
const std::string& getValue() const { return m_value; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::string m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
class FilePicker : public Widget {
|
||||||
|
public:
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &data) override;
|
||||||
|
nlohmann::json store() override;
|
||||||
|
|
||||||
|
[[nodiscard]] const std::fs::path& getPath() const {
|
||||||
|
return m_path;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::fs::path m_path;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Label : public Widget {
|
||||||
|
public:
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &) override {}
|
||||||
|
nlohmann::json store() override { return {}; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class Spacer : public Widget {
|
||||||
|
public:
|
||||||
|
bool draw(const std::string &name) override;
|
||||||
|
|
||||||
|
void load(const nlohmann::json &) override {}
|
||||||
|
nlohmann::json store() override { return {}; }
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
std::unique_ptr<Widgets::Widget> widget;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SubCategory {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
std::vector<Entry> entries;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Category {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
UnlocalizedString unlocalizedDescription;
|
||||||
|
std::vector<SubCategory> subCategories;
|
||||||
|
};
|
||||||
|
|
||||||
|
void load();
|
||||||
|
void store();
|
||||||
|
void clear();
|
||||||
|
|
||||||
|
const std::vector<Category>& getSettings();
|
||||||
|
nlohmann::json& getSetting(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const nlohmann::json &defaultValue);
|
||||||
|
const nlohmann::json& getSettingsData();
|
||||||
|
|
||||||
|
Widgets::Widget* add(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedSubCategory, const UnlocalizedString &unlocalizedName, std::unique_ptr<Widgets::Widget> &&widget);
|
||||||
|
|
||||||
|
void printSettingReadError(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const nlohmann::json::exception &e);
|
||||||
|
|
||||||
|
void runOnChangeHandlers(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const nlohmann::json &value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<std::derived_from<Widgets::Widget> T>
|
||||||
|
Widgets::Widget::Interface& add(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedSubCategory, const UnlocalizedString &unlocalizedName, auto && ... args) {
|
||||||
|
return impl::add(
|
||||||
|
unlocalizedCategory,
|
||||||
|
unlocalizedSubCategory,
|
||||||
|
unlocalizedName,
|
||||||
|
std::make_unique<T>(std::forward<decltype(args)>(args)...)
|
||||||
|
)->getInterface();
|
||||||
|
}
|
||||||
|
|
||||||
|
void setCategoryDescription(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedDescription);
|
||||||
|
|
||||||
|
class SettingsValue {
|
||||||
|
public:
|
||||||
|
SettingsValue(nlohmann::json value) : m_value(std::move(value)) {}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
T get(std::common_type_t<T> defaultValue) const {
|
||||||
|
try {
|
||||||
|
auto result = m_value;
|
||||||
|
if (result.is_number() && std::same_as<T, bool>)
|
||||||
|
result = m_value.get<int>() != 0;
|
||||||
|
if (m_value.is_null())
|
||||||
|
result = defaultValue;
|
||||||
|
|
||||||
|
return result.get<T>();
|
||||||
|
} catch (const nlohmann::json::exception &) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
nlohmann::json m_value;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
[[nodiscard]] T read(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const std::common_type_t<T> &defaultValue) {
|
||||||
|
auto setting = impl::getSetting(unlocalizedCategory, unlocalizedName, defaultValue);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (setting.is_number() && std::same_as<T, bool>)
|
||||||
|
setting = setting.template get<int>() != 0;
|
||||||
|
if (setting.is_null())
|
||||||
|
setting = defaultValue;
|
||||||
|
|
||||||
|
return setting.template get<T>();
|
||||||
|
} catch (const nlohmann::json::exception &e) {
|
||||||
|
impl::printSettingReadError(unlocalizedCategory, unlocalizedName, e);
|
||||||
|
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
void write(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const std::common_type_t<T> &value) {
|
||||||
|
impl::getSetting(unlocalizedCategory, unlocalizedName, value) = value;
|
||||||
|
impl::runOnChangeHandlers(unlocalizedCategory, unlocalizedName, value);
|
||||||
|
|
||||||
|
impl::store();
|
||||||
|
}
|
||||||
|
|
||||||
|
using OnChangeCallback = std::function<void(const SettingsValue &)>;
|
||||||
|
u64 onChange(const UnlocalizedString &unlocalizedCategory, const UnlocalizedString &unlocalizedName, const OnChangeCallback &callback);
|
||||||
|
|
||||||
|
using OnSaveCallback = std::function<void()>;
|
||||||
|
u64 onSave(const OnSaveCallback &callback);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* Tools Registry. Allows adding new entries to the tools window */
|
||||||
|
namespace ContentRegistry::Tools {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using Callback = std::function<void()>;
|
||||||
|
|
||||||
|
struct Entry {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
const char *icon;
|
||||||
|
Callback function;
|
||||||
|
};
|
||||||
|
|
||||||
|
const std::vector<Entry>& getEntries();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new tool to the tools window
|
||||||
|
* @param unlocalizedName The unlocalized name of the tool
|
||||||
|
* @param function The function that will be called to draw the tool
|
||||||
|
*/
|
||||||
|
void add(const UnlocalizedString &unlocalizedName, const char *icon, const impl::Callback &function);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,291 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/shortcut_manager.hpp>
|
||||||
|
#include <hex/ui/imgui_imhex_extensions.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* User Interface Registry. Allows adding new items to various interfaces */
|
||||||
|
namespace ContentRegistry::UserInterface {
|
||||||
|
|
||||||
|
struct Icon {
|
||||||
|
Icon(const char *glyph, ImGuiCustomCol color = ImGuiCustomCol(0x00)) : glyph(glyph), color(color) {}
|
||||||
|
|
||||||
|
std::string glyph;
|
||||||
|
ImGuiCustomCol color;
|
||||||
|
};
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
using DrawCallback = std::function<void()>;
|
||||||
|
using MenuCallback = std::function<void()>;
|
||||||
|
using EnabledCallback = std::function<bool()>;
|
||||||
|
using SelectedCallback = std::function<bool()>;
|
||||||
|
using ClickCallback = std::function<void()>;
|
||||||
|
using ToggleCallback = std::function<void(bool)>;
|
||||||
|
|
||||||
|
struct MainMenuItem {
|
||||||
|
UnlocalizedString unlocalizedName;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MenuItem {
|
||||||
|
std::vector<UnlocalizedString> unlocalizedNames;
|
||||||
|
Icon icon;
|
||||||
|
Shortcut shortcut;
|
||||||
|
View *view;
|
||||||
|
MenuCallback callback;
|
||||||
|
EnabledCallback enabledCallback;
|
||||||
|
SelectedCallback selectedCallback;
|
||||||
|
i32 toolbarIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SidebarItem {
|
||||||
|
std::string icon;
|
||||||
|
DrawCallback callback;
|
||||||
|
EnabledCallback enabledCallback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct TitleBarButton {
|
||||||
|
std::string icon;
|
||||||
|
ImGuiCustomCol color;
|
||||||
|
UnlocalizedString unlocalizedTooltip;
|
||||||
|
ClickCallback callback;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct WelcomeScreenQuickSettingsToggle {
|
||||||
|
std::string onIcon, offIcon;
|
||||||
|
UnlocalizedString unlocalizedTooltip;
|
||||||
|
ToggleCallback callback;
|
||||||
|
mutable bool state;
|
||||||
|
};
|
||||||
|
|
||||||
|
constexpr static auto SeparatorValue = "$SEPARATOR$";
|
||||||
|
constexpr static auto SubMenuValue = "$SUBMENU$";
|
||||||
|
|
||||||
|
const std::multimap<u32, MainMenuItem>& getMainMenuItems();
|
||||||
|
|
||||||
|
const std::multimap<u32, MenuItem>& getMenuItems();
|
||||||
|
const std::vector<MenuItem*>& getToolbarMenuItems();
|
||||||
|
std::multimap<u32, MenuItem>& getMenuItemsMutable();
|
||||||
|
|
||||||
|
const std::vector<DrawCallback>& getWelcomeScreenEntries();
|
||||||
|
const std::vector<DrawCallback>& getFooterItems();
|
||||||
|
const std::vector<DrawCallback>& getToolbarItems();
|
||||||
|
const std::vector<SidebarItem>& getSidebarItems();
|
||||||
|
const std::vector<TitleBarButton>& getTitlebarButtons();
|
||||||
|
const std::vector<WelcomeScreenQuickSettingsToggle>& getWelcomeScreenQuickSettingsToggles();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new top-level main menu entry
|
||||||
|
* @param unlocalizedName The unlocalized name of the entry
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
*/
|
||||||
|
void registerMainMenuItem(const UnlocalizedString &unlocalizedName, u32 priority);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu entry
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param icon The icon to use for the entry
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param shortcut The shortcut to use for the entry
|
||||||
|
* @param function The function to call when the entry is clicked
|
||||||
|
* @param enabledCallback The function to call to determine if the entry is enabled
|
||||||
|
* @param view The view to use for the entry. If nullptr, the shortcut will work globally
|
||||||
|
*/
|
||||||
|
void addMenuItem(
|
||||||
|
const std::vector<UnlocalizedString> &unlocalizedMainMenuNames,
|
||||||
|
const Icon &icon,
|
||||||
|
u32 priority,
|
||||||
|
const Shortcut &shortcut,
|
||||||
|
const impl::MenuCallback &function,
|
||||||
|
const impl::EnabledCallback& enabledCallback, View *view
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu entry
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param icon The icon to use for the entry
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param shortcut The shortcut to use for the entry
|
||||||
|
* @param function The function to call when the entry is clicked
|
||||||
|
* @param enabledCallback The function to call to determine if the entry is enabled
|
||||||
|
* @param selectedCallback The function to call to determine if the entry is selected
|
||||||
|
* @param view The view to use for the entry. If nullptr, the shortcut will work globally
|
||||||
|
*/
|
||||||
|
void addMenuItem(
|
||||||
|
const std::vector<UnlocalizedString> &unlocalizedMainMenuNames,
|
||||||
|
const Icon &icon,
|
||||||
|
u32 priority,
|
||||||
|
Shortcut shortcut,
|
||||||
|
const impl::MenuCallback &function,
|
||||||
|
const impl::EnabledCallback& enabledCallback = []{ return true; },
|
||||||
|
const impl::SelectedCallback &selectedCallback = []{ return false; },
|
||||||
|
View *view = nullptr
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu entry
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param shortcut The shortcut to use for the entry
|
||||||
|
* @param function The function to call when the entry is clicked
|
||||||
|
* @param enabledCallback The function to call to determine if the entry is enabled
|
||||||
|
* @param selectedCallback The function to call to determine if the entry is selected
|
||||||
|
* @param view The view to use for the entry. If nullptr, the shortcut will work globally
|
||||||
|
*/
|
||||||
|
void addMenuItem(
|
||||||
|
const std::vector<UnlocalizedString> &unlocalizedMainMenuNames,
|
||||||
|
u32 priority,
|
||||||
|
const Shortcut &shortcut,
|
||||||
|
const impl::MenuCallback &function,
|
||||||
|
const impl::EnabledCallback& enabledCallback = []{ return true; },
|
||||||
|
const impl::SelectedCallback &selectedCallback = []{ return false; },
|
||||||
|
View *view = nullptr
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu sub-menu entry
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param function The function to call when the entry is clicked
|
||||||
|
* @param enabledCallback The function to call to determine if the entry is enabled
|
||||||
|
* @param view The view to use for the entry. If nullptr, the item will always be visible
|
||||||
|
* @param showOnWelcomeScreen If this entry should be shown on the welcome screen
|
||||||
|
*/
|
||||||
|
void addMenuItemSubMenu(
|
||||||
|
std::vector<UnlocalizedString> unlocalizedMainMenuNames,
|
||||||
|
u32 priority,
|
||||||
|
const impl::MenuCallback &function,
|
||||||
|
const impl::EnabledCallback& enabledCallback = []{ return true; },
|
||||||
|
View *view = nullptr,
|
||||||
|
bool showOnWelcomeScreen = false
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu sub-menu entry
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param icon The icon to use for the entry
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param function The function to call when the entry is clicked
|
||||||
|
* @param enabledCallback The function to call to determine if the entry is enabled
|
||||||
|
* @param view The view to use for the entry. If nullptr, the item will always be visible
|
||||||
|
* @param showOnWelcomeScreen If this entry should be shown on the welcome screen
|
||||||
|
*/
|
||||||
|
void addMenuItemSubMenu(
|
||||||
|
std::vector<UnlocalizedString> unlocalizedMainMenuNames,
|
||||||
|
const char *icon,
|
||||||
|
u32 priority,
|
||||||
|
const impl::MenuCallback &function,
|
||||||
|
const impl::EnabledCallback& enabledCallback = []{ return true; },
|
||||||
|
View *view = nullptr,
|
||||||
|
bool showOnWelcomeScreen = false
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new main menu separator
|
||||||
|
* @param unlocalizedMainMenuNames The unlocalized names of the main menu entries
|
||||||
|
* @param priority The priority of the entry. Lower values are displayed first
|
||||||
|
* @param view The view to use for the entry. If nullptr, the item will always be visible
|
||||||
|
*/
|
||||||
|
void addMenuItemSeparator(std::vector<UnlocalizedString> unlocalizedMainMenuNames, u32 priority, View *view = nullptr);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new welcome screen entry
|
||||||
|
* @param function The function to call to draw the entry
|
||||||
|
*/
|
||||||
|
void addWelcomeScreenEntry(const impl::DrawCallback &function);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new footer item
|
||||||
|
* @param function The function to call to draw the item
|
||||||
|
*/
|
||||||
|
void addFooterItem(const impl::DrawCallback &function);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new toolbar item
|
||||||
|
* @param function The function to call to draw the item
|
||||||
|
*/
|
||||||
|
void addToolbarItem(const impl::DrawCallback &function);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a menu item to the toolbar
|
||||||
|
* @param unlocalizedName Unlocalized name of the menu item
|
||||||
|
* @param color Color of the toolbar icon
|
||||||
|
*/
|
||||||
|
void addMenuItemToToolbar(const UnlocalizedString &unlocalizedName, ImGuiCustomCol color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Reconstructs the toolbar items list after they have been modified
|
||||||
|
*/
|
||||||
|
void updateToolbarItems();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new sidebar item
|
||||||
|
* @param icon The icon to use for the item
|
||||||
|
* @param function The function to call to draw the item
|
||||||
|
* @param enabledCallback The function
|
||||||
|
*/
|
||||||
|
void addSidebarItem(
|
||||||
|
const std::string &icon,
|
||||||
|
const impl::DrawCallback &function,
|
||||||
|
const impl::EnabledCallback &enabledCallback = []{ return true; }
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new title bar button
|
||||||
|
* @param icon The icon to use for the button
|
||||||
|
* @param color The color of the icon
|
||||||
|
* @param unlocalizedTooltip The unlocalized tooltip to use for the button
|
||||||
|
* @param function The function to call when the button is clicked
|
||||||
|
*/
|
||||||
|
void addTitleBarButton(
|
||||||
|
const std::string &icon,
|
||||||
|
ImGuiCustomCol color,
|
||||||
|
const UnlocalizedString &unlocalizedTooltip,
|
||||||
|
const impl::ClickCallback &function
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new welcome screen quick settings toggle
|
||||||
|
* @param icon The icon to use for the button
|
||||||
|
* @param unlocalizedTooltip The unlocalized tooltip to use for the button
|
||||||
|
* @param defaultState The default state of the toggle
|
||||||
|
* @param function The function to call when the button is clicked
|
||||||
|
*/
|
||||||
|
void addWelcomeScreenQuickSettingsToggle(
|
||||||
|
const std::string &icon,
|
||||||
|
const UnlocalizedString &unlocalizedTooltip,
|
||||||
|
bool defaultState,
|
||||||
|
const impl::ToggleCallback &function
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new welcome screen quick settings toggle
|
||||||
|
* @param onIcon The icon to use for the button when it's on
|
||||||
|
* @param offIcon The icon to use for the button when it's off
|
||||||
|
* @param unlocalizedTooltip The unlocalized tooltip to use for the button
|
||||||
|
* @param defaultState The default state of the toggle
|
||||||
|
* @param function The function to call when the button is clicked
|
||||||
|
*/
|
||||||
|
void addWelcomeScreenQuickSettingsToggle(
|
||||||
|
const std::string &onIcon,
|
||||||
|
const std::string &offIcon,
|
||||||
|
const UnlocalizedString &unlocalizedTooltip,
|
||||||
|
bool defaultState,
|
||||||
|
const impl::ToggleCallback &function
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex.hpp>
|
||||||
|
|
||||||
|
#include <hex/api/localization_manager.hpp>
|
||||||
|
#include <hex/ui/view.hpp>
|
||||||
|
|
||||||
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
EXPORT_MODULE namespace hex {
|
||||||
|
|
||||||
|
/* View Registry. Allows adding of new windows */
|
||||||
|
namespace ContentRegistry::Views {
|
||||||
|
|
||||||
|
namespace impl {
|
||||||
|
|
||||||
|
void add(std::unique_ptr<View> &&view);
|
||||||
|
void setFullScreenView(std::unique_ptr<View> &&view);
|
||||||
|
|
||||||
|
const std::map<UnlocalizedString, std::unique_ptr<View>>& getEntries();
|
||||||
|
const std::unique_ptr<View>& getFullScreenView();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Adds a new view to ImHex
|
||||||
|
* @tparam T The custom view class that extends View
|
||||||
|
* @tparam Args Arguments types
|
||||||
|
* @param args Arguments passed to the constructor of the view
|
||||||
|
*/
|
||||||
|
template<std::derived_from<View> T, typename... Args>
|
||||||
|
void add(Args &&...args) {
|
||||||
|
return impl::add(std::make_unique<T>(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Sets a view as a full-screen view. This will cause the view to take up the entire ImHex window
|
||||||
|
* @tparam T The custom view class that extends View
|
||||||
|
* @tparam Args Arguments types
|
||||||
|
* @param args Arguments passed to the constructor of the view
|
||||||
|
*/
|
||||||
|
template<std::derived_from<View> T, typename... Args>
|
||||||
|
void setFullScreenView(Args &&...args) {
|
||||||
|
return impl::setFullScreenView(std::make_unique<T>(std::forward<Args>(args)...));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets a view by its unlocalized name
|
||||||
|
* @param unlocalizedName The unlocalized name of the view
|
||||||
|
* @return The view if it exists, nullptr otherwise
|
||||||
|
*/
|
||||||
|
View* getViewByName(const UnlocalizedString &unlocalizedName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Gets the currently focused view
|
||||||
|
* @return The view that is focused right now. nullptr if none is focused
|
||||||
|
*/
|
||||||
|
View* getFocusedView();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -9,39 +9,48 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
#include <hex/api/imhex_api.hpp>
|
|
||||||
#include <hex/helpers/logger.hpp>
|
#include <hex/helpers/logger.hpp>
|
||||||
#include <hex/helpers/patches.hpp>
|
|
||||||
|
|
||||||
#include <wolv/types/type_name.hpp>
|
#include <wolv/types/type_name.hpp>
|
||||||
|
|
||||||
#define EVENT_DEF_IMPL(event_name, event_name_string, should_log, ...) \
|
#define EVENT_DEF_IMPL(event_name, event_name_string, should_log, ...) \
|
||||||
struct event_name final : public hex::impl::Event<__VA_ARGS__> { \
|
struct event_name final : public hex::impl::Event<__VA_ARGS__> { \
|
||||||
constexpr static auto Id = [] { return hex::impl::EventId(event_name_string); }(); \
|
constexpr static auto Id = [] { return hex::impl::EventId(event_name_string); }(); \
|
||||||
constexpr static auto ShouldLog = (should_log); \
|
constexpr static auto ShouldLog = (should_log); \
|
||||||
explicit event_name(Callback func) noexcept : Event(std::move(func)) { } \
|
explicit event_name(Callback func) noexcept : Event(std::move(func)) { } \
|
||||||
\
|
\
|
||||||
static EventManager::EventList::iterator subscribe(Event::Callback function) { return EventManager::subscribe<event_name>(std::move(function)); } \
|
static EventManager::EventList::iterator subscribe(Event::Callback function) { \
|
||||||
static void subscribe(void *token, Event::Callback function) { EventManager::subscribe<event_name>(token, std::move(function)); } \
|
return EventManager::subscribe<event_name>(std::move(function)); \
|
||||||
static void unsubscribe(const EventManager::EventList::iterator &token) noexcept { EventManager::unsubscribe(token); } \
|
} \
|
||||||
static void unsubscribe(void *token) noexcept { EventManager::unsubscribe<event_name>(token); } \
|
template<typename = void> \
|
||||||
static void post(auto &&...args) { EventManager::post<event_name>(std::forward<decltype(args)>(args)...); } \
|
static EventManager::EventList::iterator subscribe(Event::BaseCallback function) \
|
||||||
|
requires (!std::same_as<Event::Callback, Event::BaseCallback>) { \
|
||||||
|
return EventManager::subscribe<event_name>([function = std::move(function)](auto && ...) { function(); }); \
|
||||||
|
} \
|
||||||
|
static void subscribe(void *token, Event::Callback function) { \
|
||||||
|
EventManager::subscribe<event_name>(token, std::move(function)); \
|
||||||
|
} \
|
||||||
|
template<typename = void> \
|
||||||
|
static void subscribe(void *token, Event::BaseCallback function) \
|
||||||
|
requires (!std::same_as<Event::Callback, Event::BaseCallback>) { \
|
||||||
|
return EventManager::subscribe<event_name>(token, [function = std::move(function)](auto && ...) { function(); }); \
|
||||||
|
} \
|
||||||
|
static void unsubscribe(const EventManager::EventList::iterator &token) noexcept { \
|
||||||
|
EventManager::unsubscribe(token); \
|
||||||
|
} \
|
||||||
|
static void unsubscribe(void *token) noexcept { \
|
||||||
|
EventManager::unsubscribe<event_name>(token); \
|
||||||
|
} \
|
||||||
|
static void post(auto &&...args) { \
|
||||||
|
EventManager::post<event_name>(std::forward<decltype(args)>(args)...); \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EVENT_DEF(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, true, __VA_ARGS__)
|
#define EVENT_DEF(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, true, __VA_ARGS__)
|
||||||
#define EVENT_DEF_NO_LOG(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, false, __VA_ARGS__)
|
#define EVENT_DEF_NO_LOG(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, false, __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
/* Forward declarations */
|
EXPORT_MODULE namespace hex {
|
||||||
struct GLFWwindow;
|
|
||||||
namespace hex {
|
|
||||||
class Achievement;
|
|
||||||
class View;
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace pl::ptrn { class Pattern; }
|
|
||||||
|
|
||||||
namespace hex {
|
|
||||||
|
|
||||||
namespace impl {
|
namespace impl {
|
||||||
|
|
||||||
|
|
@ -75,17 +84,22 @@ namespace hex {
|
||||||
template<typename... Params>
|
template<typename... Params>
|
||||||
struct Event : EventBase {
|
struct Event : EventBase {
|
||||||
using Callback = std::function<void(Params...)>;
|
using Callback = std::function<void(Params...)>;
|
||||||
|
using BaseCallback = std::function<void()>;
|
||||||
|
|
||||||
explicit Event(Callback func) noexcept : m_func(std::move(func)) { }
|
explicit Event(Callback func) noexcept : m_func(std::move(func)) { }
|
||||||
|
|
||||||
template<typename E>
|
template<typename E>
|
||||||
void call(Params... params) const {
|
void call(auto&& ... params) const {
|
||||||
try {
|
#if defined(DEBUG)
|
||||||
m_func(params...);
|
m_func(std::forward<decltype(params)>(params)...);
|
||||||
} catch (const std::exception &e) {
|
#else
|
||||||
log::error("An exception occurred while handling event {}: {}", wolv::type::getTypeName<E>(), e.what());
|
try {
|
||||||
throw;
|
m_func(std::forward<decltype(params)>(params)...);
|
||||||
}
|
} catch (const std::exception &e) {
|
||||||
|
log::error("An exception occurred while handling event {}: {}", wolv::type::getTypeName<E>(), e.what());
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -100,7 +114,8 @@ namespace hex {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The EventManager allows subscribing to and posting events to different parts of the program.
|
* @brief The EventManager allows subscribing to and posting events to different parts of the program.
|
||||||
* To create a new event, use the EVENT_DEF macro. This will create a new event type with the given name and parameters
|
* To create a new event, use the EVENT_DEF macro. This will create a new event type with the given name and parameters.
|
||||||
|
* Events should be created in an `events_*.hpp` category file under the `events` folder, and never directly here.
|
||||||
*/
|
*/
|
||||||
class EventManager {
|
class EventManager {
|
||||||
public:
|
public:
|
||||||
|
|
@ -113,8 +128,8 @@ namespace hex {
|
||||||
* @return Token to unsubscribe from the event
|
* @return Token to unsubscribe from the event
|
||||||
*/
|
*/
|
||||||
template<impl::EventType E>
|
template<impl::EventType E>
|
||||||
static EventList::iterator subscribe(typename E::Callback function) {
|
static EventList::iterator subscribe(E::Callback function) {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
auto &events = getEvents();
|
auto &events = getEvents();
|
||||||
return events.insert({ E::Id, std::make_unique<E>(function) });
|
return events.insert({ E::Id, std::make_unique<E>(function) });
|
||||||
|
|
@ -127,15 +142,15 @@ namespace hex {
|
||||||
* @param function Function to call when the event is posted
|
* @param function Function to call when the event is posted
|
||||||
*/
|
*/
|
||||||
template<impl::EventType E>
|
template<impl::EventType E>
|
||||||
static void subscribe(void *token, typename E::Callback function) {
|
static void subscribe(void *token, E::Callback function) {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
if (isAlreadyRegistered(token, E::Id)) {
|
if (isAlreadyRegistered(token, E::Id)) {
|
||||||
log::fatal("The token '{}' has already registered the same event ('{}')", token, wolv::type::getTypeName<E>());
|
log::fatal("The token '{}' has already registered the same event ('{}')", token, wolv::type::getTypeName<E>());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTokenStore().insert({ token, subscribe<E>(function) });
|
getTokenStore().insert({ token, subscribe<E>(std::move(function)) });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -143,7 +158,7 @@ namespace hex {
|
||||||
* @param token Token returned by subscribe
|
* @param token Token returned by subscribe
|
||||||
*/
|
*/
|
||||||
static void unsubscribe(const EventList::iterator &token) noexcept {
|
static void unsubscribe(const EventList::iterator &token) noexcept {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
getEvents().erase(token);
|
getEvents().erase(token);
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +170,7 @@ namespace hex {
|
||||||
*/
|
*/
|
||||||
template<impl::EventType E>
|
template<impl::EventType E>
|
||||||
static void unsubscribe(void *token) noexcept {
|
static void unsubscribe(void *token) noexcept {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
unsubscribe(token, E::Id);
|
unsubscribe(token, E::Id);
|
||||||
}
|
}
|
||||||
|
|
@ -167,9 +182,9 @@ namespace hex {
|
||||||
*/
|
*/
|
||||||
template<impl::EventType E>
|
template<impl::EventType E>
|
||||||
static void post(auto && ...args) {
|
static void post(auto && ...args) {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
auto [begin, end] = getEvents().equal_range(E::Id);
|
const auto &[begin, end] = getEvents().equal_range(E::Id);
|
||||||
for (auto it = begin; it != end; ++it) {
|
for (auto it = begin; it != end; ++it) {
|
||||||
const auto &[id, event] = *it;
|
const auto &[id, event] = *it;
|
||||||
(*static_cast<E *const>(event.get())).template call<E>(std::forward<decltype(args)>(args)...);
|
(*static_cast<E *const>(event.get())).template call<E>(std::forward<decltype(args)>(args)...);
|
||||||
|
|
@ -185,7 +200,7 @@ namespace hex {
|
||||||
* @brief Unsubscribe all subscribers from all events
|
* @brief Unsubscribe all subscribers from all events
|
||||||
*/
|
*/
|
||||||
static void clear() noexcept {
|
static void clear() noexcept {
|
||||||
std::scoped_lock lock(getEventMutex());
|
std::lock_guard lock(getEventMutex());
|
||||||
|
|
||||||
getEvents().clear();
|
getEvents().clear();
|
||||||
getTokenStore().clear();
|
getTokenStore().clear();
|
||||||
|
|
@ -200,123 +215,4 @@ namespace hex {
|
||||||
static void unsubscribe(void *token, impl::EventId id);
|
static void unsubscribe(void *token, impl::EventId id);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Default Events */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when Imhex finished startup, and will enter the main window rendering loop
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventImHexStartupFinished);
|
|
||||||
|
|
||||||
EVENT_DEF(EventFileLoaded, std::fs::path);
|
|
||||||
EVENT_DEF(EventDataChanged, prv::Provider *);
|
|
||||||
EVENT_DEF(EventHighlightingChanged);
|
|
||||||
EVENT_DEF(EventWindowClosing, GLFWwindow *);
|
|
||||||
EVENT_DEF(EventRegionSelected, ImHexApi::HexEditor::ProviderRegion);
|
|
||||||
EVENT_DEF(EventAbnormalTermination, int);
|
|
||||||
EVENT_DEF(EventThemeChanged);
|
|
||||||
EVENT_DEF(EventOSThemeChanged);
|
|
||||||
EVENT_DEF(EventDPIChanged, float, float);
|
|
||||||
EVENT_DEF(EventWindowFocused, bool);
|
|
||||||
EVENT_DEF(EventImHexUpdated, SemanticVersion, SemanticVersion);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when the provider is created.
|
|
||||||
* This event is responsible for (optionally) initializing the provider and calling EventProviderOpened
|
|
||||||
* (although the event can also be called manually without problem)
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventProviderCreated, prv::Provider *);
|
|
||||||
EVENT_DEF(EventProviderChanged, prv::Provider *, prv::Provider *);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called as a continuation of EventProviderCreated
|
|
||||||
* this event is normally called immediately after EventProviderCreated successfully initialized the provider.
|
|
||||||
* If no initialization (Provider::skipLoadInterface() has been set), this event should be called manually
|
|
||||||
* If skipLoadInterface failed, this event is not called
|
|
||||||
*
|
|
||||||
* @note this is not related to Provider::open()
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventProviderOpened, prv::Provider *);
|
|
||||||
EVENT_DEF(EventProviderClosing, prv::Provider *, bool *);
|
|
||||||
EVENT_DEF(EventProviderClosed, prv::Provider *);
|
|
||||||
EVENT_DEF(EventProviderDeleted, prv::Provider *);
|
|
||||||
EVENT_DEF(EventProviderSaved, prv::Provider *);
|
|
||||||
EVENT_DEF(EventWindowInitialized);
|
|
||||||
EVENT_DEF(EventWindowDeinitializing, GLFWwindow *);
|
|
||||||
EVENT_DEF(EventBookmarkCreated, ImHexApi::Bookmarks::Entry&);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called upon creation of an IPS patch.
|
|
||||||
* As for now, the event only serves a purpose for the achievement unlock.
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventPatchCreated, const u8*, u64, const PatchKind);
|
|
||||||
EVENT_DEF(EventPatternEvaluating);
|
|
||||||
EVENT_DEF(EventPatternExecuted, const std::string&);
|
|
||||||
EVENT_DEF(EventPatternEditorChanged, const std::string&);
|
|
||||||
EVENT_DEF(EventStoreContentDownloaded, const std::fs::path&);
|
|
||||||
EVENT_DEF(EventStoreContentRemoved, const std::fs::path&);
|
|
||||||
EVENT_DEF(EventImHexClosing);
|
|
||||||
EVENT_DEF(EventAchievementUnlocked, const Achievement&);
|
|
||||||
EVENT_DEF(EventSearchBoxClicked, u32);
|
|
||||||
EVENT_DEF(EventViewOpened, View*);
|
|
||||||
EVENT_DEF(EventFirstLaunch);
|
|
||||||
|
|
||||||
EVENT_DEF(EventFileDragged, bool);
|
|
||||||
EVENT_DEF(EventFileDropped, std::fs::path);
|
|
||||||
|
|
||||||
EVENT_DEF(EventProviderDataModified, prv::Provider *, u64, u64, const u8*);
|
|
||||||
EVENT_DEF(EventProviderDataInserted, prv::Provider *, u64, u64);
|
|
||||||
EVENT_DEF(EventProviderDataRemoved, prv::Provider *, u64, u64);
|
|
||||||
EVENT_DEF(EventProviderDirtied, prv::Provider *);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Called when a project has been loaded
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventProjectOpened);
|
|
||||||
|
|
||||||
EVENT_DEF_NO_LOG(EventFrameBegin);
|
|
||||||
EVENT_DEF_NO_LOG(EventFrameEnd);
|
|
||||||
EVENT_DEF_NO_LOG(EventSetTaskBarIconState, u32, u32, u32);
|
|
||||||
EVENT_DEF_NO_LOG(EventImGuiElementRendered, ImGuiID, const std::array<float, 4>&);
|
|
||||||
|
|
||||||
EVENT_DEF(RequestAddInitTask, std::string, bool, std::function<bool()>);
|
|
||||||
EVENT_DEF(RequestAddExitTask, std::string, std::function<bool()>);
|
|
||||||
EVENT_DEF(RequestOpenWindow, std::string);
|
|
||||||
EVENT_DEF(RequestHexEditorSelectionChange, Region);
|
|
||||||
EVENT_DEF(RequestPatternEditorSelectionChange, u32, u32);
|
|
||||||
EVENT_DEF(RequestJumpToPattern, const pl::ptrn::Pattern*);
|
|
||||||
EVENT_DEF(RequestAddBookmark, Region, std::string, std::string, color_t, u64*);
|
|
||||||
EVENT_DEF(RequestRemoveBookmark, u64);
|
|
||||||
EVENT_DEF(RequestSetPatternLanguageCode, std::string);
|
|
||||||
EVENT_DEF(RequestRunPatternCode);
|
|
||||||
EVENT_DEF(RequestLoadPatternLanguageFile, std::fs::path);
|
|
||||||
EVENT_DEF(RequestSavePatternLanguageFile, std::fs::path);
|
|
||||||
EVENT_DEF(RequestUpdateWindowTitle);
|
|
||||||
EVENT_DEF(RequestCloseImHex, bool);
|
|
||||||
EVENT_DEF(RequestRestartImHex);
|
|
||||||
EVENT_DEF(RequestOpenFile, std::fs::path);
|
|
||||||
EVENT_DEF(RequestChangeTheme, std::string);
|
|
||||||
EVENT_DEF(RequestOpenPopup, std::string);
|
|
||||||
EVENT_DEF(RequestAddVirtualFile, std::fs::path, std::vector<u8>, Region);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Creates a provider from it's unlocalized name, and add it to the provider list
|
|
||||||
*/
|
|
||||||
EVENT_DEF(RequestCreateProvider, std::string, bool, bool, hex::prv::Provider **);
|
|
||||||
EVENT_DEF(RequestInitThemeHandlers);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Send an event to the main Imhex instance
|
|
||||||
*/
|
|
||||||
EVENT_DEF(SendMessageToMainInstance, const std::string, const std::vector<u8>&);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Move the data from all PerProvider instances from one provider to another.
|
|
||||||
* The 'from' provider should not have any per provider data after this, and should be immediately deleted
|
|
||||||
*/
|
|
||||||
EVENT_DEF(MovePerProviderData, prv::Provider *, prv::Provider *);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when ImHex managed to catch an error in a general try/catch to prevent/recover from a crash
|
|
||||||
*/
|
|
||||||
EVENT_DEF(EventCrashRecovered, const std::exception &);
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,118 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <hex/api/event_manager.hpp>
|
||||||
|
|
||||||
|
/* Forward declarations */
|
||||||
|
struct GLFWwindow;
|
||||||
|
using ImGuiID = unsigned int;
|
||||||
|
namespace hex { class View; }
|
||||||
|
|
||||||
|
/* GUI events definitions */
|
||||||
|
namespace hex {
|
||||||
|
/**
|
||||||
|
* @brief Signals a newly opened view
|
||||||
|
*
|
||||||
|
* This event is sent when the view has just been opened by the Window manager.
|
||||||
|
*
|
||||||
|
* FIXME: This is currently only used for the introduction tutorial.
|
||||||
|
* If the event's only purpose is this, maybe rename it?
|
||||||
|
*
|
||||||
|
* @param view the new view reference
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventViewOpened, View*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals a newly closed view
|
||||||
|
*
|
||||||
|
* This event is sent when the view has just been closed.
|
||||||
|
*
|
||||||
|
* @param view the closed view reference
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventViewClosed, View*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals a change in the DPI scale.
|
||||||
|
*
|
||||||
|
* This event is called once at startup to signal native scale definition (by passing the same value twice).
|
||||||
|
* On Windows OS, this event can also be posted if the window DPI has been changed.
|
||||||
|
*
|
||||||
|
* @param oldScale the old scale
|
||||||
|
* @param newScale the current scale that's now in use
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventDPIChanged, float, float);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals the focus of the ImHex main window.
|
||||||
|
*
|
||||||
|
* This is directly tied as a GLFW window focus callback, and will be called accordingly when GLFW detects
|
||||||
|
* a change in focus.
|
||||||
|
*
|
||||||
|
* @param isFocused true if the window is focused
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventWindowFocused, bool);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals a window being closed.
|
||||||
|
*
|
||||||
|
* Allows reactive clean up of running tasks, and prevents ImHex from closing
|
||||||
|
* by displaying an exit confirmation popup.
|
||||||
|
*
|
||||||
|
* @param window The window reference
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventWindowClosing, GLFWwindow*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Informs that the main window is deinitializing
|
||||||
|
*
|
||||||
|
* Allows for lifecycle cleanup before ImHex shutdown.
|
||||||
|
*
|
||||||
|
* @param window The window reference
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventWindowDeinitializing, GLFWwindow*);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals a theme change in the host OS
|
||||||
|
*
|
||||||
|
* Allows ImHex to react to OS theme changes dynamically during execution.
|
||||||
|
*/
|
||||||
|
EVENT_DEF(EventOSThemeChanged);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* silent (no-logging) GUI events definitions */
|
||||||
|
namespace hex {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals the start of a new ImGui frame
|
||||||
|
*/
|
||||||
|
EVENT_DEF_NO_LOG(EventFrameBegin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Signals the end of an ImGui frame
|
||||||
|
*/
|
||||||
|
EVENT_DEF_NO_LOG(EventFrameEnd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Windows OS: Sets the taskbar icon state
|
||||||
|
*
|
||||||
|
* This event is used on Windows OS to display progress through the taskbar icon (the famous "green loading bar"
|
||||||
|
* in the taskbar).
|
||||||
|
*
|
||||||
|
* @param progressState the progress state (converted from the TaskProgressState enum)
|
||||||
|
* @param progressType the type of progress (converted from the TaskProgressType enum)
|
||||||
|
* @param percentage actual progress percentage (expected from 0 to 100)
|
||||||
|
*
|
||||||
|
* @see hex::ImHexApi::System::TaskProgressState
|
||||||
|
* @see hex::ImHexApi::System::TaskProgressType
|
||||||
|
*/
|
||||||
|
EVENT_DEF_NO_LOG(EventSetTaskBarIconState, u32, u32, u32);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Informs of an ImGui element being rendered
|
||||||
|
*
|
||||||
|
* @param elementId the element's ID
|
||||||
|
* @param boundingBox the bounding box (composed of 4 floats)
|
||||||
|
*/
|
||||||
|
EVENT_DEF_NO_LOG(EventImGuiElementRendered, ImGuiID, const std::array<float, 4>&);
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue