Compare commits
881
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f3594f270 | ||
|
|
08dc3b7fa8 | ||
|
|
c027a792c9 | ||
|
|
b165c5241c | ||
|
|
cb47b28c0b | ||
|
|
418c55f1a8 | ||
|
|
b9134341c7 | ||
|
|
98e0a77dbf | ||
|
|
8ff9a881e0 | ||
|
|
6ff6b3f92c | ||
|
|
a7a223c443 | ||
|
|
4ca17d6538 | ||
|
|
2b7d2a1904 | ||
|
|
5a837f7023 | ||
|
|
45d0e6cdcb | ||
|
|
c5ad372702 | ||
|
|
b240acbb00 | ||
|
|
f58a30dfc6 | ||
|
|
7900739500 | ||
|
|
4c6715b653 | ||
|
|
0bac402d49 | ||
|
|
21da75fb8a | ||
|
|
d2b0c03d14 | ||
|
|
d7e4fb5f98 | ||
|
|
61df87d20f | ||
|
|
4e921072e6 | ||
|
|
896fe42698 | ||
|
|
abb4968e2c | ||
|
|
9e429042e2 | ||
|
|
03aca30b53 | ||
|
|
1cb571053b | ||
|
|
dc95e9c513 | ||
|
|
3ab17a5625 | ||
|
|
cb115a7165 | ||
|
|
a54e5b27b7 | ||
|
|
aa2b617f47 | ||
|
|
b7f367451a | ||
|
|
fc1cdcd9aa | ||
|
|
8bba61609f | ||
|
|
9698ea666d | ||
|
|
8ac5c8693c | ||
|
|
9dff397f38 | ||
|
|
ff27238d4e | ||
|
|
dabbb72483 | ||
|
|
2714146f0e | ||
|
|
60c3e88777 | ||
|
|
fe54643fe3 | ||
|
|
00f3322411 | ||
|
|
562eacc974 | ||
|
|
76c54de0e7 | ||
|
|
3507c8fefc | ||
|
|
a416fddb52 | ||
|
|
038b60671f | ||
|
|
167842ed32 | ||
|
|
ae506a509d | ||
|
|
215a8dd6b2 | ||
|
|
2b5aebbeff | ||
|
|
2313755619 | ||
|
|
86c3e2c19f | ||
|
|
2f750acf42 | ||
|
|
28573db03a | ||
|
|
499503d1bd | ||
|
|
8cc8535344 | ||
|
|
95a26efe1f | ||
|
|
1af33bffe9 | ||
|
|
6ef787c91a | ||
|
|
227a88282c | ||
|
|
82cedfe516 | ||
|
|
f6c9cbfe78 | ||
|
|
2e7a95844c | ||
|
|
c719c4e6ba | ||
|
|
e4b4091cba | ||
|
|
c4255935e4 | ||
|
|
1f208904e9 | ||
|
|
19eefd9e08 | ||
|
|
db6074d00e | ||
|
|
a27b986882 | ||
|
|
ff03a9d3e7 | ||
|
|
33bfcead27 | ||
|
|
5787c0f57c | ||
|
|
adf7266284 | ||
|
|
f1c908976b | ||
|
|
f808da8400 | ||
|
|
6374b6b11c | ||
|
|
d12f5710ca | ||
|
|
6310d4a06c | ||
|
|
f90dc14753 | ||
|
|
f0b254cb47 | ||
|
|
8f808d447d | ||
|
|
a7743d72b4 | ||
|
|
5b851c9839 | ||
|
|
013ea34be8 | ||
|
|
08df4324b8 | ||
|
|
5fb4f0cfa0 | ||
|
|
f999e49345 | ||
|
|
6afae6c314 | ||
|
|
b4e598c447 | ||
|
|
1f0dff6c67 | ||
|
|
2ff359890e | ||
|
|
ad1d344654 | ||
|
|
e1b54248b0 | ||
|
|
6dba6d8a2f | ||
|
|
c40dcea762 | ||
|
|
5c7c8222ce | ||
|
|
aa5c6378f2 | ||
|
|
6f48fb1216 | ||
|
|
0762ca3cf4 | ||
|
|
7fce27408a | ||
|
|
9599415297 | ||
|
|
baa063c823 | ||
|
|
836620bfbb | ||
|
|
22d994946d | ||
|
|
a1e0155007 | ||
|
|
8d33da12d9 | ||
|
|
f4d7a9bbf3 | ||
|
|
500115fd00 | ||
|
|
497b95e3de | ||
|
|
7e70586046 | ||
|
|
8e0c432655 | ||
|
|
e661bb7422 | ||
|
|
3e8fa7f946 | ||
|
|
543085258b | ||
|
|
d585c1e5ae | ||
|
|
6369464dc5 | ||
|
|
c302d3f9b3 | ||
|
|
6bc35d818c | ||
|
|
6877ce7aba | ||
|
|
1b18d17a7e | ||
|
|
0dc02df3ef | ||
|
|
8f4e011544 | ||
|
|
75e359bec0 | ||
|
|
a8097e5def | ||
|
|
0ad68c228b | ||
|
|
9d97cc0e2d | ||
|
|
81c2a633b2 | ||
|
|
024916cf18 | ||
|
|
2babf12d93 | ||
|
|
b9829e2142 | ||
|
|
d9e949a463 | ||
|
|
84f963a716 | ||
|
|
3d4ff6fedf | ||
|
|
9260bae262 | ||
|
|
14bbcabac8 | ||
|
|
223fcbeb37 | ||
|
|
d864b91780 | ||
|
|
93bc909d42 | ||
|
|
c678f6bdfb | ||
|
|
55209582b0 | ||
|
|
968d9c24ab | ||
|
|
065752b757 | ||
|
|
43afe84570 | ||
|
|
a1ec0f815f | ||
|
|
553b927219 | ||
|
|
9b950314bd | ||
|
|
6a3eadcbd4 | ||
|
|
38ded048e9 | ||
|
|
149a6d18b3 | ||
|
|
5a19dc9d73 | ||
|
|
6df39ede51 | ||
|
|
4575a6632f | ||
|
|
5bc816c29b | ||
|
|
b447488189 | ||
|
|
488876d0b5 | ||
|
|
0bf18b8c24 | ||
|
|
625d84ca1e | ||
|
|
7058c31e2c | ||
|
|
851366cec4 | ||
|
|
60363f283c | ||
|
|
ebb2b966ba | ||
|
|
f409d0c35c | ||
|
|
971a8deac4 | ||
|
|
bb75e178cc | ||
|
|
dc66460141 | ||
|
|
494f116c6b | ||
|
|
0e72c53729 | ||
|
|
8a9c4021ed | ||
|
|
8df6f13e41 | ||
|
|
39a2acd259 | ||
|
|
c4069b6b81 | ||
|
|
c93ee79b2a | ||
|
|
9d9cfbb306 | ||
|
|
5d35ebfbef | ||
|
|
48917ef526 | ||
|
|
abcf929efb | ||
|
|
803c7e63a3 | ||
|
|
a5faa5927e | ||
|
|
8fc5137b3d | ||
|
|
03a61fe300 | ||
|
|
e07ac780dc | ||
|
|
f23ced2f4f | ||
|
|
58d1e79b7e | ||
|
|
d717340c92 | ||
|
|
cd37b09a52 | ||
|
|
3133df09d2 | ||
|
|
e4b453bfcf | ||
|
|
c87188341f | ||
|
|
940d5009cb | ||
|
|
6b0446b16e | ||
|
|
682abb0264 | ||
|
|
238ce93ecf | ||
|
|
9bfe8b1c37 | ||
|
|
a22ebad74f | ||
|
|
294cdc0808 | ||
|
|
aecae14f07 | ||
|
|
1e9b12bd14 | ||
|
|
f8b5dc5232 | ||
|
|
0d217ef67b | ||
|
|
5b60645b8c | ||
|
|
56a2e2294f | ||
|
|
62435492f0 | ||
|
|
e1e92aefea | ||
|
|
fc7cc1c8a3 | ||
|
|
68738194c9 | ||
|
|
14ab0a9657 | ||
|
|
afee334c6d | ||
|
|
927d5593d1 | ||
|
|
0783b74c54 | ||
|
|
0b386c22ba | ||
|
|
8ae7dc4cf9 | ||
|
|
1de8788c3c | ||
|
|
dd291ae174 | ||
|
|
2cdd2ae8ff | ||
|
|
0397b96569 | ||
|
|
3f35394efa | ||
|
|
23d37113a2 | ||
|
|
841d02e241 | ||
|
|
266868cae3 | ||
|
|
99d540edc2 | ||
|
|
45ddb0ecf7 | ||
|
|
5bb039128f | ||
|
|
055e3c41c3 | ||
|
|
e1eeada181 | ||
|
|
c97ec00f8e | ||
|
|
0614b7f2cf | ||
|
|
c1489422bd | ||
|
|
0e5db4ea90 | ||
|
|
86760c53d8 | ||
|
|
f97627cd58 | ||
|
|
eb8fd41011 | ||
|
|
d69111b359 | ||
|
|
175c7f4f60 | ||
|
|
ff370cc72c | ||
|
|
8b2df0d4ad | ||
|
|
913a2c8cea | ||
|
|
7f338c324d | ||
|
|
aee7f1e00b | ||
|
|
25f593be71 | ||
|
|
9ca593a482 | ||
|
|
1f8d43edb2 | ||
|
|
d38d4038de | ||
|
|
2520288b3a | ||
|
|
af3536f7c9 | ||
|
|
6761851b5f | ||
|
|
c000b17be0 | ||
|
|
cc288c7215 | ||
|
|
930310d4bd | ||
|
|
646af9f6ce | ||
|
|
8cae0420d9 | ||
|
|
e2ef1ea659 | ||
|
|
b086796f43 | ||
|
|
dde9a3ca80 | ||
|
|
94275484bd | ||
|
|
7d369634cb | ||
|
|
ac3b57deb1 | ||
|
|
9a4f609aa6 | ||
|
|
60de925b10 | ||
|
|
ca6068a002 | ||
|
|
d29052e7ff | ||
|
|
60cb785431 | ||
|
|
d3ad812008 | ||
|
|
2c0bf31cc0 | ||
|
|
4eaff7bc80 | ||
|
|
cb43b6ec59 | ||
|
|
63418db430 | ||
|
|
6ceddad9cc | ||
|
|
9281f6a699 | ||
|
|
327abf6ad5 | ||
|
|
0abb0b30a5 | ||
|
|
a9542aa24a | ||
|
|
3bc18f4906 | ||
|
|
1de204ada8 | ||
|
|
09c2a30eb9 | ||
|
|
259bf7091f | ||
|
|
41166332a2 | ||
|
|
1e425fc3c5 | ||
|
|
1c46aed72e | ||
|
|
a2f0f26ab9 | ||
|
|
5c5d524a92 | ||
|
|
573ea6a2f3 | ||
|
|
2cd4d99fc6 | ||
|
|
a5cf726667 | ||
|
|
dd02054bb5 | ||
|
|
535375ff7e | ||
|
|
9e8f30cd23 | ||
|
|
3c25311b17 | ||
|
|
29b79cbece | ||
|
|
80fec167b0 | ||
|
|
35ae8dc742 | ||
|
|
531377b388 | ||
|
|
844df9d340 | ||
|
|
1cc49b2f3e | ||
|
|
339c92121c | ||
|
|
3439a448e6 | ||
|
|
738f60b555 | ||
|
|
d4fa8d18c3 | ||
|
|
81b8b6fb01 | ||
|
|
2eab480a15 | ||
|
|
7eebe97298 | ||
|
|
db5b5f93e9 | ||
|
|
37176a49b2 | ||
|
|
1abc368975 | ||
|
|
6ce389cae9 | ||
|
|
3fcdbdc74d | ||
|
|
f8f4bb77a1 | ||
|
|
e9862f4e85 | ||
|
|
441bb4620b | ||
|
|
793657de4a | ||
|
|
0ff950c080 | ||
|
|
e54ef047c5 | ||
|
|
11c4d4de16 | ||
|
|
9448caf756 | ||
|
|
a11b1b72a9 | ||
|
|
f7171b620f | ||
|
|
c84c8f04f9 | ||
|
|
52a5d5dcc9 | ||
|
|
f1b35862c8 | ||
|
|
bd6f6272a5 | ||
|
|
b5df89fbd6 | ||
|
|
68caa323ea | ||
|
|
426b2406bb | ||
|
|
7ebe5fd8cf | ||
|
|
68fa8898fb | ||
|
|
28552b543b | ||
|
|
deffb40fab | ||
|
|
5aa3d72c09 | ||
|
|
9c0c01a7bc | ||
|
|
40245aef53 | ||
|
|
e1bd74698e | ||
|
|
c1a7332233 | ||
|
|
8dc62e85e7 | ||
|
|
8d244837cf | ||
|
|
69d777e4c0 | ||
|
|
917a118769 | ||
|
|
fbe2640c44 | ||
|
|
de58725db9 | ||
|
|
7c1d66da6e | ||
|
|
fd7f68258e | ||
|
|
1e7b4beb00 | ||
|
|
de49dceba9 | ||
|
|
b0366b3388 | ||
|
|
efd36faa80 | ||
|
|
56dab60d5a | ||
|
|
6d88ded3da | ||
|
|
102a6171a7 | ||
|
|
dacd4cd1f5 | ||
|
|
33a8e16976 | ||
|
|
d75f90d8dd | ||
|
|
a07a8b83d2 | ||
|
|
4e8838a5a7 | ||
|
|
313343b681 | ||
|
|
a2100f9aeb | ||
|
|
8b8b84d180 | ||
|
|
fb86a0a103 | ||
|
|
c58b8dbf09 | ||
|
|
b4c96c41c1 | ||
|
|
590eb2626f | ||
|
|
7b6f8484ee | ||
|
|
e573911098 | ||
|
|
4479894a07 | ||
|
|
b63dca262f | ||
|
|
36106937d1 | ||
|
|
ca6ddf5cdd | ||
|
|
ca485c3921 | ||
|
|
c796782a1f | ||
|
|
5fc182b1d5 | ||
|
|
e81ae09f77 | ||
|
|
ccd41bb820 | ||
|
|
b06aa7ae7b | ||
|
|
7a4291bcf1 | ||
|
|
94aa4db095 | ||
|
|
3f233e5a95 | ||
|
|
c6a6471cbf | ||
|
|
72e7f8178c | ||
|
|
3e951ba3f7 | ||
|
|
86c2d48512 | ||
|
|
a0ffe4592b | ||
|
|
5cf93ae26d | ||
|
|
f2c54ee5cf | ||
|
|
89ad5b378a | ||
|
|
445083677d | ||
|
|
d3ae4debe7 | ||
|
|
f7a127eac3 | ||
|
|
86e1769fb0 | ||
|
|
ee4e12a442 | ||
|
|
699ae7ed96 | ||
|
|
8c7b2911a3 | ||
|
|
0f8bea0275 | ||
|
|
0459322666 | ||
|
|
ccaca6028b | ||
|
|
94d0e05697 | ||
|
|
e81492631f | ||
|
|
0120636b12 | ||
|
|
19dd162314 | ||
|
|
f00553ec14 | ||
|
|
538b6a5ebf | ||
|
|
27be4e6b2d | ||
|
|
086c49fb7a | ||
|
|
ec233a499f | ||
|
|
7908c18a72 | ||
|
|
42207c97ed | ||
|
|
11b5d7ce9e | ||
|
|
4cc1dd26be | ||
|
|
8784fb5aa5 | ||
|
|
c56dfab748 | ||
|
|
7559d2d0e8 | ||
|
|
864bf8180c | ||
|
|
b8e7216f1f | ||
|
|
442fb46395 | ||
|
|
91a4710fc5 | ||
|
|
07b3241fe1 | ||
|
|
b6de8801b2 | ||
|
|
e45dfb71bb | ||
|
|
e98d6e7d0a | ||
|
|
17b86f8b37 | ||
|
|
11f65a051e | ||
|
|
6cdc09388c | ||
|
|
0dc889591e | ||
|
|
1090999cc0 | ||
|
|
ba294bd181 | ||
|
|
b11bc1ebd2 | ||
|
|
6dfe3870a7 | ||
|
|
a3f034d767 | ||
|
|
3def579f75 | ||
|
|
78dec19bbd | ||
|
|
8d65798590 | ||
|
|
4fb6145bd3 | ||
|
|
d0fb24a2a8 | ||
|
|
0127c29e09 | ||
|
|
f8d30efa17 | ||
|
|
e4f23d14d3 | ||
|
|
cf14dae8a8 | ||
|
|
0913977621 | ||
|
|
0f4ed10aba | ||
|
|
b8b2ae0b02 | ||
|
|
0fa2d49924 | ||
|
|
68f51a7708 | ||
|
|
a526c52233 | ||
|
|
165b9f6535 | ||
|
|
388fc5e46f | ||
|
|
77c633cc22 | ||
|
|
7115533c1e | ||
|
|
3cca7ba4b2 | ||
|
|
144e5fe76d | ||
|
|
201a87e25c | ||
|
|
2b5a5eb339 | ||
|
|
53ea6eae0b | ||
|
|
5c1f3613cb | ||
|
|
544332db2c | ||
|
|
33276acad7 | ||
|
|
06df59cefe | ||
|
|
ca0b20aa74 | ||
|
|
c8cc69c77e | ||
|
|
d1906ad2d5 | ||
|
|
02327492c8 | ||
|
|
94adbf5f2a | ||
|
|
e5285687d0 | ||
|
|
dbc9d9f9fa | ||
|
|
bf931df303 | ||
|
|
cd81ed3ba6 | ||
|
|
1bcd416433 | ||
|
|
27261eb427 | ||
|
|
3581c8e3bf | ||
|
|
155febcb77 | ||
|
|
24c3295a4c | ||
|
|
f3abf22971 | ||
|
|
fa41703c1a | ||
|
|
fae9ae78d6 | ||
|
|
e8811ec19f | ||
|
|
f27947b8e0 | ||
|
|
8da28da98e | ||
|
|
6a40c07614 | ||
|
|
48cf0dbd41 | ||
|
|
c59a66ade1 | ||
|
|
3ee28a5079 | ||
|
|
92305cfa2c | ||
|
|
77330160ea | ||
|
|
39b21e4319 | ||
|
|
8a32bcb963 | ||
|
|
c31361c188 | ||
|
|
5584fdf129 | ||
|
|
88cadfdb3b | ||
|
|
d574f58004 | ||
|
|
93e2e65a6f | ||
|
|
2001d8c9b7 | ||
|
|
9b2bd35380 | ||
|
|
0e04b4a44e | ||
|
|
993f24bdc1 | ||
|
|
990dbcaa77 | ||
|
|
5915877834 | ||
|
|
32b5234cf9 | ||
|
|
0ff2f093c0 | ||
|
|
e31dfeb3cc | ||
|
|
5e70549e0f | ||
|
|
1921d282aa | ||
|
|
222a160cf5 | ||
|
|
81f8792e8c | ||
|
|
d28e879ad3 | ||
|
|
ce0ba58a54 | ||
|
|
eeebbaf819 | ||
|
|
0ad4b8c5c0 | ||
|
|
ecbedb4d09 | ||
|
|
47d707f3a5 | ||
|
|
d7e7fcce18 | ||
|
|
b39d4e330e | ||
|
|
ea4a6b299f | ||
|
|
62929828ce | ||
|
|
5c21a22cde | ||
|
|
bc31ee5dce | ||
|
|
7bd0c8aa6f | ||
|
|
cd7a7e1240 | ||
|
|
01867d52ed | ||
|
|
2de226dcd9 | ||
|
|
919c52597f | ||
|
|
f979004437 | ||
|
|
932f58cbf4 | ||
|
|
ce3ff3f573 | ||
|
|
b267a99cb8 | ||
|
|
de60b62424 | ||
|
|
beb49468ff | ||
|
|
7c3b4a3f9f | ||
|
|
f864b71d02 | ||
|
|
ab85865f27 | ||
|
|
42df4964f0 | ||
|
|
b29613f4e9 | ||
|
|
24d48ad0b5 | ||
|
|
f4bf30dfbc | ||
|
|
f954c50e74 | ||
|
|
9673580c5a | ||
|
|
dfb67f2a2d | ||
|
|
ff72aa9242 | ||
|
|
8a2ec4eeae | ||
|
|
2f7620f527 | ||
|
|
4800a80769 | ||
|
|
999daa3ce7 | ||
|
|
ff8bc78393 | ||
|
|
cb7132c776 | ||
|
|
3d1663f31c | ||
|
|
fa10efc138 | ||
|
|
ab1387add8 | ||
|
|
d4e767b3d9 | ||
|
|
fd1cc42b6d | ||
|
|
3eac86c9e6 | ||
|
|
8e2964f722 | ||
|
|
38b7f9279b | ||
|
|
ad4e824b97 | ||
|
|
339a08fa60 | ||
|
|
9f7230eeb0 | ||
|
|
a3660898af | ||
|
|
a9210e5af3 | ||
|
|
16508f9426 | ||
|
|
fec7d0190f | ||
|
|
4c67c5b5de | ||
|
|
27d406be96 | ||
|
|
3d44a66cf9 | ||
|
|
469c799e56 | ||
|
|
bd138c5f3c | ||
|
|
3af17efa70 | ||
|
|
c10e90df15 | ||
|
|
b0e4bdb99d | ||
|
|
306f34e992 | ||
|
|
b2b7fb96ec | ||
|
|
f31c8ff58d | ||
|
|
da6ca93e7d | ||
|
|
9c7b9aa81c | ||
|
|
b441c2862d | ||
|
|
402e7a9b02 | ||
|
|
f7acc24723 | ||
|
|
c23cccb7f9 | ||
|
|
33703bc4d1 | ||
|
|
e6ec359a3d | ||
|
|
59332990ac | ||
|
|
4d5d2a4f0d | ||
|
|
f763b51274 | ||
|
|
525a870011 | ||
|
|
d2d9839af8 | ||
|
|
fa57fa69e5 | ||
|
|
2b68ae5383 | ||
|
|
93245d3c7f | ||
|
|
62499ca1ab | ||
|
|
2646cf042b | ||
|
|
5f0cec2167 | ||
|
|
2a31841aec | ||
|
|
35b201bdf0 | ||
|
|
393fc9cabb | ||
|
|
9906e2a024 | ||
|
|
221bf8792e | ||
|
|
3f82c9ef82 | ||
|
|
bca2738a33 | ||
|
|
e300b98120 | ||
|
|
69b6d53723 | ||
|
|
7c3f631948 | ||
|
|
fe10cd9fd7 | ||
|
|
4d2e96a0bf | ||
|
|
a78251c92c | ||
|
|
588ad8e2a6 | ||
|
|
839ef18dc0 | ||
|
|
0fd4757351 | ||
|
|
318aab9690 | ||
|
|
c80b627484 | ||
|
|
a0b33d7e7d | ||
|
|
8316dacf0b | ||
|
|
f21b38f0c6 | ||
|
|
3f18682c61 | ||
|
|
3e11bf782b | ||
|
|
b51dc15964 | ||
|
|
9d3e02b6db | ||
|
|
2c54bd6930 | ||
|
|
221ba21f15 | ||
|
|
122b86199f | ||
|
|
7911cddb64 | ||
|
|
ac880b2e82 | ||
|
|
a8b5f85917 | ||
|
|
572d79537e | ||
|
|
93614a089b | ||
|
|
93bb5926ec | ||
|
|
bf557275a9 | ||
|
|
022f1636d7 | ||
|
|
f614400193 | ||
|
|
0fb0368ed3 | ||
|
|
c0e988e571 | ||
|
|
b88f20e04f | ||
|
|
0b75c6fe7c | ||
|
|
0b73a52700 | ||
|
|
235be8ea65 | ||
|
|
4c4a82a6f4 | ||
|
|
1dfa26fa12 | ||
|
|
3c76f67038 | ||
|
|
fc8aa9aadd | ||
|
|
c533aeffe3 | ||
|
|
51cad8a2a4 | ||
|
|
d4faafa481 | ||
|
|
e46074212d | ||
|
|
9aec6c0570 | ||
|
|
b014790b10 | ||
|
|
807b257acd | ||
|
|
132ac2d971 | ||
|
|
ef824c71bc | ||
|
|
b2b56a7107 | ||
|
|
2a26324093 | ||
|
|
be3fc43c72 | ||
|
|
465475f5f4 | ||
|
|
6314d2b8f7 | ||
|
|
7faf45f80c | ||
|
|
97d96daa09 | ||
|
|
5330d36aea | ||
|
|
6d18b3b062 | ||
|
|
393500d2cc | ||
|
|
cc11e22206 | ||
|
|
73d91dd66d | ||
|
|
f7698825a7 | ||
|
|
96240ed47b | ||
|
|
d078438b87 | ||
|
|
9c5c513dd5 | ||
|
|
acd253fcd7 | ||
|
|
41a9730d33 | ||
|
|
a09b9ac78e | ||
|
|
d447511a64 | ||
|
|
6d1a230da2 | ||
|
|
54d0a72c8e | ||
|
|
4d8211a2bd | ||
|
|
10fa404f5e | ||
|
|
573c885de5 | ||
|
|
307e113f8e | ||
|
|
8d46eafe14 | ||
|
|
6dbb551af3 | ||
|
|
ec17282da3 | ||
|
|
a996621de2 | ||
|
|
1c9c8522b6 | ||
|
|
d30b870715 | ||
|
|
2b7b21aec0 | ||
|
|
e0086cef46 | ||
|
|
5f0ff7094d | ||
|
|
9d627769f0 | ||
|
|
690d9f9987 | ||
|
|
d62d481a7f | ||
|
|
630929ee2d | ||
|
|
27f32e9060 | ||
|
|
a3a7a933ff | ||
|
|
3f056100a4 | ||
|
|
a076f51d51 | ||
|
|
5aba7e8bf5 | ||
|
|
88c28b16f4 | ||
|
|
fe432fe881 | ||
|
|
78fad9758e | ||
|
|
129e542ab3 | ||
|
|
b9b0adf65a | ||
|
|
082fc725fe | ||
|
|
b0f421bd5e | ||
|
|
638aa18708 | ||
|
|
5087d6f1e4 | ||
|
|
a4af271cc0 | ||
|
|
1c112ee57c | ||
|
|
dee8ad2d88 | ||
|
|
480b92574c | ||
|
|
9502c2b7ec | ||
|
|
00e4a684a3 | ||
|
|
0fe1a8452b | ||
|
|
6217d70643 | ||
|
|
737f2a9394 | ||
|
|
9d28a065df | ||
|
|
979d0ec661 | ||
|
|
cddd8dd076 | ||
|
|
acadc088ed | ||
|
|
7f02b5084d | ||
|
|
d1e095e194 | ||
|
|
7a62df9b58 | ||
|
|
6b49ec5807 | ||
|
|
a228ad308d | ||
|
|
fb983d1764 | ||
|
|
16c987247e | ||
|
|
3ec4d301aa | ||
|
|
f5ed2dff32 | ||
|
|
21efe57265 | ||
|
|
7cd186ddfa | ||
|
|
0808283f8b | ||
|
|
bb2bd6c679 | ||
|
|
90a25eda22 | ||
|
|
7c6a474387 | ||
|
|
0384b53478 | ||
|
|
16962f2f36 | ||
|
|
58f499a222 | ||
|
|
d87dfb24ac | ||
|
|
cea9fc5ca9 | ||
|
|
6f74de8095 | ||
|
|
ada25284df | ||
|
|
03e923030c | ||
|
|
ca50c91301 | ||
|
|
bcd9b27df3 | ||
|
|
c01dc6af49 | ||
|
|
66fcfcc4e7 | ||
|
|
e13f2d5157 | ||
|
|
2b13595323 | ||
|
|
78d2f4b9d3 | ||
|
|
a900afb238 | ||
|
|
e6d3f28e7b | ||
|
|
3f2046e221 | ||
|
|
8dd8a255a8 | ||
|
|
0c7c79bea2 | ||
|
|
3aa5497b5e | ||
|
|
fac0e7840e | ||
|
|
e6503fe74e | ||
|
|
47a78077b4 | ||
|
|
6ddc7e4145 | ||
|
|
e082255c32 | ||
|
|
df97777811 | ||
|
|
529d5a8679 | ||
|
|
ded37c5b92 | ||
|
|
002f356ed0 | ||
|
|
879c4c5b3b | ||
|
|
3ec79f96b0 | ||
|
|
b113795dbb | ||
|
|
5280c511ec | ||
|
|
ad50afbdbf | ||
|
|
1a1d2ec9e7 | ||
|
|
262ad9735a | ||
|
|
e25dcc3f90 | ||
|
|
1e0bc5d522 | ||
|
|
87cc6f8d4b | ||
|
|
9044fb6fc2 | ||
|
|
8eaf0669e1 | ||
|
|
77b94c0a4e | ||
|
|
fcf5daea07 | ||
|
|
a9759992cc | ||
|
|
af3040dcd6 | ||
|
|
67dac6bd8a | ||
|
|
874b4c2512 | ||
|
|
be2be83eb6 | ||
|
|
e907b5989d | ||
|
|
98a08fc18e | ||
|
|
94f35ef40d | ||
|
|
2f61f29e84 | ||
|
|
5fe14ae8ae | ||
|
|
1c0df938db | ||
|
|
c9c3b79334 | ||
|
|
78c3196d67 | ||
|
|
a7270ae577 | ||
|
|
07df2f030f | ||
|
|
267bab415a | ||
|
|
0c472ca906 | ||
|
|
23546d4bad | ||
|
|
d0ed158094 | ||
|
|
1c3e1d05b4 | ||
|
|
05168d085a | ||
|
|
6b737986ba | ||
|
|
6a98c63b06 | ||
|
|
2ed2b61c09 | ||
|
|
1eb2df6e47 | ||
|
|
78006bc772 | ||
|
|
9961f6629d | ||
|
|
8bd5e5824a | ||
|
|
1a44327d19 | ||
|
|
29f7e9d86f | ||
|
|
00a00150d0 | ||
|
|
021705297d | ||
|
|
e5ef1da160 | ||
|
|
c6db72896f | ||
|
|
2a2c56a173 | ||
|
|
a27bd6a644 | ||
|
|
dffcff5df7 | ||
|
|
3ade2736c0 | ||
|
|
b8409a73c2 | ||
|
|
befbf6b4a0 | ||
|
|
5c43eadcd1 | ||
|
|
04b2fb88ac | ||
|
|
f4281b07e6 | ||
|
|
293500897d | ||
|
|
068512c331 | ||
|
|
b5b845a076 | ||
|
|
e8be94770c | ||
|
|
d1c16a2f8f | ||
|
|
d5dc7fdda0 | ||
|
|
d7b962d782 | ||
|
|
dd95b2fbab | ||
|
|
9de43ed301 | ||
|
|
a807fecf91 | ||
|
|
beb05cae8d | ||
|
|
84b053793c | ||
|
|
dd96f0129c | ||
|
|
b4c2f47563 | ||
|
|
f8b7dd7031 | ||
|
|
db0bf3e794 | ||
|
|
8e9eb84785 | ||
|
|
ad312da094 | ||
|
|
6e4722624a | ||
|
|
8e9a68aded | ||
|
|
84d1388e5e | ||
|
|
c0a05dc6ec | ||
|
|
b3d6b20085 | ||
|
|
e89db0c1c9 | ||
|
|
3c959daa58 | ||
|
|
3414ded8cd | ||
|
|
1f52f26c13 | ||
|
|
b820df0bd7 | ||
|
|
ed4f9b5bb6 | ||
|
|
c36120abdb | ||
|
|
8ef47cd979 | ||
|
|
0030630df4 | ||
|
|
88030da9a8 | ||
|
|
1ecfbf1fd8 | ||
|
|
2ad31be179 | ||
|
|
02ecdd12b3 | ||
|
|
660f26ebf4 | ||
|
|
1f3b19ea21 | ||
|
|
71f64b9dab | ||
|
|
bab28ae062 | ||
|
|
2b6b2d488e | ||
|
|
5b6eefbe9c | ||
|
|
65d6b150d6 | ||
|
|
9e9d26f70b | ||
|
|
3185d59870 | ||
|
|
73e23deb60 | ||
|
|
752ab8a3ce | ||
|
|
f70b2371b9 | ||
|
|
c6381bbcc1 | ||
|
|
f999ea6456 | ||
|
|
ac939a645f | ||
|
|
cc165d2aba | ||
|
|
5b8ef83022 | ||
|
|
6a90b3457f | ||
|
|
d34d20c198 | ||
|
|
22a6ffa0bd | ||
|
|
1781ba0f61 | ||
|
|
6e328569fb | ||
|
|
00d9cc7c25 | ||
|
|
bff5411884 | ||
|
|
c225890973 | ||
|
|
96193a0488 | ||
|
|
5936e85d02 | ||
|
|
e41c3280ec | ||
|
|
e4a7f679a8 | ||
|
|
97bf8b65ff |
+1
-1
@@ -1 +1 @@
|
||||
github: [romainthomas]
|
||||
github: [lief-project]
|
||||
|
||||
@@ -4,7 +4,6 @@ about: You identified a bug or a problem in LIEF
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: romainthomas
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
@@ -23,3 +22,12 @@ A clear and concise description of what you expected to happen (if applicable)
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
|
||||
**NOTICE**
|
||||
|
||||
If the issue does not contain enough information to be reproduced,
|
||||
it will be flagged as [incomplete](https://github.com/lief-project/LIEF/issues?q=is%3Aissue+is%3Aclosed+label%3AIncomplete)
|
||||
and closed.
|
||||
|
||||
**/NOTICE**
|
||||
|
||||
@@ -4,6 +4,6 @@ bucket = "lief"
|
||||
endpoint = "https://s3.fr-par.scw.cloud"
|
||||
|
||||
[lief.deploy]
|
||||
branches = ["master", "deploy", "devel"]
|
||||
main-branches = ["master", "main"]
|
||||
branches = ["main", "master", "deploy", "devel"]
|
||||
main-branches = ["main", "master"]
|
||||
default-dir = "latest"
|
||||
|
||||
+39
-28
@@ -12,17 +12,18 @@ import os
|
||||
import sys
|
||||
import tempfile
|
||||
import tomli
|
||||
import re
|
||||
|
||||
LOG_LEVEL = logging.INFO
|
||||
|
||||
CURRENTDIR = Path(__file__).resolve().parent
|
||||
REPODIR = CURRENTDIR.parent
|
||||
ASSET_DIR = CURRENTDIR / "assets"
|
||||
CONFIG_DIR = CURRENTDIR / "config"
|
||||
LIEF_S3_KEY = os.getenv("LIEF_S3_KEY", None)
|
||||
LIEF_S3_SECRET = os.getenv("LIEF_S3_SECRET", None)
|
||||
OWNED_ORGS = ["lief-project/", "romainthomas/"]
|
||||
RELEASE_KEYWRD = "release-"
|
||||
CURRENTDIR = Path(__file__).resolve().parent
|
||||
REPODIR = CURRENTDIR.parent
|
||||
ASSET_DIR = CURRENTDIR / "assets"
|
||||
CONFIG_DIR = CURRENTDIR / "config"
|
||||
LIEF_S3_KEY = os.getenv("LIEF_S3_KEY", None)
|
||||
LIEF_S3_SECRET = os.getenv("LIEF_S3_SECRET", None)
|
||||
OWNED_ORGS = ["lief-project/", "romainthomas/"]
|
||||
RELEASE_KEYWORD = ["release-", "release/"]
|
||||
|
||||
DEFAULT_CONFIG = CONFIG_DIR / "gh-ci.toml"
|
||||
DEFAULT_TEMPLATE = (ASSET_DIR / "index.j2").read_text()
|
||||
@@ -122,7 +123,8 @@ class S3Manager:
|
||||
self._s3_push(index, dst)
|
||||
|
||||
def process_sdk_wheels(self, directory: Path, maxdepth: int = 0,
|
||||
depth: int = 0, recurse: bool = True):
|
||||
depth: int = 0, recurse: bool = True,
|
||||
skip_sdk: bool = False):
|
||||
logger.info("Processing directory: %s", directory)
|
||||
for item in directory.iterdir():
|
||||
if item.is_dir() and recurse:
|
||||
@@ -132,7 +134,7 @@ class S3Manager:
|
||||
self.process_sdk_wheels(item, maxdepth, depth + 1, recurse)
|
||||
elif item.is_file():
|
||||
extension = item.suffix
|
||||
if extension in (".zip", ".gz"):
|
||||
if extension in (".zip", ".gz") and not skip_sdk:
|
||||
logger.info("[SDK ] Uploading '%s'", item.as_posix())
|
||||
self.push_sdk(item.as_posix())
|
||||
elif extension in (".whl", ):
|
||||
@@ -140,9 +142,10 @@ class S3Manager:
|
||||
self.push_wheel(item.as_posix())
|
||||
|
||||
|
||||
def upload_wheels_sdk(self, src_dir: Path, maxdepth: int):
|
||||
def upload_wheels_sdk(self, src_dir: Path, maxdepth: int, skip_sdk: bool):
|
||||
logger.info("Looking for wheels and sdk from: %s", src_dir)
|
||||
self.process_sdk_wheels(src_dir, maxdepth=maxdepth, recurse=True)
|
||||
self.process_sdk_wheels(src_dir, maxdepth=maxdepth, recurse=True,
|
||||
skip_sdk=skip_sdk)
|
||||
|
||||
wheels_index = self.generate_index(self.s3_lief_wheel,
|
||||
DEFAULT_TEMPLATE,
|
||||
@@ -248,35 +251,43 @@ class GithubDeploy:
|
||||
def is_main_branch(self, name: str) -> bool:
|
||||
return name in self._main_branches
|
||||
|
||||
def deploy(self, directories: list[str]):
|
||||
def should_be_deployed(self, branch: str) -> bool:
|
||||
if any(re.match(s, branch) for s in self._branches):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def deploy(self, directories: list[str], skip_sdk: bool = False):
|
||||
s3dir = None
|
||||
if GithubDeploy.is_tagged():
|
||||
s3dir = GithubDeploy.tag_name()
|
||||
else:
|
||||
branch = GithubDeploy.branch()
|
||||
if branch is None:
|
||||
logger.warning("Can't resolve the branch name")
|
||||
sys.exit(1)
|
||||
|
||||
branch = GithubDeploy.branch()
|
||||
|
||||
if branch is None:
|
||||
logger.warning("Can't resolve the branch name")
|
||||
sys.exit(1)
|
||||
|
||||
s3dir = self._default_dir
|
||||
|
||||
if not self.should_be_deployed(branch):
|
||||
logger.info("Skipping deployment for branch: %s", branch)
|
||||
return
|
||||
|
||||
if branch.startswith(RELEASE_KEYWRD):
|
||||
_, s3dir = branch.split(RELEASE_KEYWRD)
|
||||
elif self.is_main_branch(branch):
|
||||
s3dir = self._default_dir
|
||||
else:
|
||||
s3dir = branch.replace("/", "-").replace("_", "-")
|
||||
if s3dir is None:
|
||||
logger.error("Target directory is not set")
|
||||
sys.exit(1)
|
||||
|
||||
logger.info("s3dir: %s", s3dir)
|
||||
self.s3_manager.change_dir(s3dir)
|
||||
for dirname in directories:
|
||||
dirpath = Path(dirname).resolve().absolute().expanduser()
|
||||
self.s3_manager.upload_wheels_sdk(dirpath, maxdepth=1)
|
||||
self.s3_manager.upload_wheels_sdk(dirpath, maxdepth=1,
|
||||
skip_sdk=skip_sdk)
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--config", "-c")
|
||||
parser.add_argument("--dry-run", "-n", action="store_true", default=False)
|
||||
parser.add_argument("--skip-sdk", action="store_true", default=False)
|
||||
parser.add_argument("directories", nargs="+")
|
||||
|
||||
args = parser.parse_args()
|
||||
@@ -291,7 +302,7 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
gh_deploy = GithubDeploy.from_config(config_path)
|
||||
gh_deploy.deploy(args.directories)
|
||||
gh_deploy.deploy(args.directories, args.skip_sdk)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
setuptools
|
||||
boto3
|
||||
requests
|
||||
twine
|
||||
tomli
|
||||
mako
|
||||
wheel
|
||||
@@ -9,7 +9,7 @@ jobs:
|
||||
arch: ['arm', 'arm64']
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: android-${{ runner.os }}-${{ matrix.arch }}-${{ steps.get-date.outputs.date }}
|
||||
@@ -36,9 +36,9 @@ jobs:
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
--rm liefproject/android-${ARCH} bash /work/scripts/docker/android-${ARCH}.sh
|
||||
--rm liefproject/android-${ARCH} bash /work/scripts/docker/android-sdk-${ARCH}
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: android-sdk-${{ matrix.arch }}
|
||||
path: build/*.tar.gz
|
||||
@@ -48,11 +48,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build-sdk
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Display artifacts
|
||||
|
||||
@@ -1,24 +1,16 @@
|
||||
name: 'iOS'
|
||||
on: push
|
||||
|
||||
env:
|
||||
python-version: '3.10'
|
||||
|
||||
jobs:
|
||||
ios-sdk:
|
||||
runs-on: macos-11.0
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ env.python-version }}
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: ${{ env.python-version }}
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
brew install cmake ninja ccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
@@ -29,7 +21,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p ~/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/.ccache
|
||||
key: ios-${{ runner.os }}-${{ steps.get-date.outputs.date }}
|
||||
@@ -45,7 +37,7 @@ jobs:
|
||||
run: |
|
||||
bash scripts/osx/package_ios.sh
|
||||
- name: 'Upload Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ios-sdk
|
||||
path: build/*.tar.gz
|
||||
@@ -55,11 +47,11 @@ jobs:
|
||||
if: ${{ always() }}
|
||||
needs: ios-sdk
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Display artifacts
|
||||
@@ -80,7 +72,8 @@ jobs:
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_S3_KEY=$LIEF_S3_KEY \
|
||||
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \
|
||||
liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
liefproject/deploy \
|
||||
python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ jobs:
|
||||
linux-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: linux-aarch64-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
|
||||
@@ -24,22 +24,27 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p $RUNNER_TEMP/lief-install
|
||||
docker run --name lief_sdk --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux2014-aarch64 bash /work/scripts/docker/linux-aarch64.sh
|
||||
mkdir -p $HOME/.ccache
|
||||
|
||||
chmod -R 777 $HOME/.ccache
|
||||
|
||||
docker run --name lief-sdk -u 1001:1001 --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux2014-aarch64 \
|
||||
bash /src/scripts/docker/linux-sdk-aarch64
|
||||
- name: 'Upload SDK Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-aarch64-sdk
|
||||
path: build/*.tar.gz
|
||||
retention-days: 3
|
||||
- name: 'Upload Install Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-aarch64-install
|
||||
path: ${{ runner.temp }}/lief-install
|
||||
@@ -49,9 +54,9 @@ jobs:
|
||||
needs: linux-sdk
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10', '3.11']
|
||||
python-version: [3.9, '3.10', '3.11', '3.12']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -60,14 +65,14 @@ jobs:
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: linux-aarch64-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-aarch64-${{ runner.os }}-${{ matrix.python-version }}
|
||||
- name: Download LIEF install dir
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-aarch64-install
|
||||
path: ${{ runner.temp }}/lief-install
|
||||
@@ -76,20 +81,25 @@ jobs:
|
||||
env:
|
||||
PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
mkdir -p $HOME/.ccache
|
||||
chmod -R 777 $HOME/.ccache
|
||||
|
||||
PYTHON_VERSION_ALT=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.8 -> 38
|
||||
docker run --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION_ALT \
|
||||
-e PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION} \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
liefproject/manylinux2014-aarch64 bash /work/scripts/docker/manylinux2014-aarch64.sh
|
||||
PYTHON_BINARY="/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION}"
|
||||
docker run -u 1001:1001 --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION_ALT \
|
||||
-e PYTHON_BINARY=$PYTHON_BINARY \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
liefproject/manylinux2014-aarch64 \
|
||||
bash /src/scripts/docker/linux-py-aarch64
|
||||
- name: 'Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-aarch64-python${{ matrix.python-version }}-wheel
|
||||
path: dist/*.whl
|
||||
@@ -99,12 +109,14 @@ jobs:
|
||||
if: ${{ always() }}
|
||||
needs: [linux-sdk, wheels]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: linux-aarch64-*
|
||||
merge-multiple: true
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Display artifacts
|
||||
run: ls -R
|
||||
@@ -124,6 +136,7 @@ jobs:
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_S3_KEY=$LIEF_S3_KEY \
|
||||
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \
|
||||
liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
liefproject/deploy \
|
||||
python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,22 @@ on: push
|
||||
jobs:
|
||||
linux-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: liefproject/manylinux_2_28_x86_64
|
||||
env:
|
||||
CCACHE_DIR: "/home/pylief/.ccache"
|
||||
CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libstdc++ -static-libgcc"
|
||||
CFLAGS: "-ffunction-sections -fdata-sections -static-libstdc++ -static-libgcc"
|
||||
LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
|
||||
BUILD_DIR_STATIC: "/tmp/build/linux-x86-64/static-release"
|
||||
BUILD_DIR_SHARED: "/tmp/build/linux-x86-64/shared-release"
|
||||
CLICOLOR_FORCE: "1"
|
||||
ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
|
||||
ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
|
||||
ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
|
||||
options: --user 1001:1001
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -13,42 +27,76 @@ jobs:
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Prepare ccache
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p /home/pylief/.ccache/tmp
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
path: /home/pylief/.ccache
|
||||
key: linux-x86-64-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-x86-64-${{ runner.os }}-sdk
|
||||
- name: Build SDK
|
||||
- name: CMake - Static
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p $RUNNER_TEMP/lief-install
|
||||
docker run --name lief_sdk --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux_2_28_x86_64 bash /src/scripts/docker/run_linux_sdk.sh
|
||||
mkdir -p ${BUILD_DIR_STATIC}
|
||||
cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_STATIC} -GNinja \
|
||||
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||
-DCMAKE_LINK_WHAT_YOU_USE=on \
|
||||
-DBUILD_SHARED_LIBS=off \
|
||||
-DLIEF_INSTALL_COMPILED_EXAMPLES=on \
|
||||
-DCMAKE_INSTALL_PREFIX=/install \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- name: Compile - Static
|
||||
shell: bash
|
||||
run: |
|
||||
cmake --build ${BUILD_DIR_STATIC} --target install
|
||||
- name: CMake - Shared
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ${BUILD_DIR_SHARED}
|
||||
cmake -S $GITHUB_WORKSPACE -B ${BUILD_DIR_SHARED} -GNinja \
|
||||
-DCMAKE_INSTALL_LIBDIR="lib" \
|
||||
-DCMAKE_LINK_WHAT_YOU_USE=on \
|
||||
-DBUILD_SHARED_LIBS=on \
|
||||
-DLIEF_INSTALL_COMPILED_EXAMPLES=off \
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
- name: Compile - Shared
|
||||
run: |
|
||||
cmake --build ${BUILD_DIR_SHARED} --target all
|
||||
- name: Package
|
||||
run: |
|
||||
cd /tmp/build/linux-x86-64
|
||||
cpack --config $GITHUB_WORKSPACE/cmake/cpack.config.cmake
|
||||
- name: 'Upload SDK Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-x86-64-sdk
|
||||
path: build/*.tar.gz
|
||||
path: /tmp/build/linux-x86-64/*.tar.gz
|
||||
retention-days: 3
|
||||
- name: 'Upload Install Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-x86-64-install
|
||||
path: ${{ runner.temp }}/lief-install
|
||||
path: /install
|
||||
retention-days: 1
|
||||
testing:
|
||||
if: "!contains(github.event.commits[0].message, '[skip-test]')"
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: liefproject/manylinux_2_28_x86_64
|
||||
env:
|
||||
PYTHON_BINARY: "/opt/python/cp312-cp312/bin/python3.12"
|
||||
LIEF_SAMPLES_DIR: "/tmp/samples"
|
||||
LIEF_BUILD_DIR: "/tmp/lief-build"
|
||||
LIEF_VENV: "/tmp/venv"
|
||||
CLICOLOR_FORCE: "1"
|
||||
PYTEST_ADDOPTS: "--color=yes"
|
||||
options: --user 1001:1001
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -57,35 +105,90 @@ jobs:
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: linux-x86-64-${{ runner.os }}-test-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-x86-64-${{ runner.os }}-test
|
||||
- name: Python 3.8 -- Wheel & Test
|
||||
- name: Prepare Python virtual env
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: 38
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION \
|
||||
-e PYTHON_BINARY=/opt/python/cp38-cp38/bin/python3.8 \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux_2_28_x86_64 bash /src/scripts/docker/run_linux_test.sh
|
||||
$PYTHON_BINARY -m venv ${LIEF_VENV}
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
python -m pip install \
|
||||
-r tests/requirements.txt \
|
||||
-r api/python/build-requirements.txt
|
||||
- name: Build & install LIEF
|
||||
shell: bash
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
export PYLIEF_CONF="${GITHUB_WORKSPACE}/scripts/docker/config/pylinux-test-x64.toml"
|
||||
python -m pip -vvv install api/python
|
||||
- name: Prepare test samples
|
||||
shell: bash
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
mkdir -p ${LIEF_SAMPLES_DIR}
|
||||
python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
|
||||
- name: Run tests
|
||||
timeout-minutes: 5
|
||||
shell: bash
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
python tests/run_pytest.py
|
||||
python tests/run_tools_check.py ${LIEF_BUILD_DIR}/
|
||||
ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/
|
||||
- name: Fuzzing [ls x86-64]
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
|
||||
python tests/elf/fuzzing.py \
|
||||
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
|
||||
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_ls.bin -n 100
|
||||
- name: Fuzzing [openssl x86-64]
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
|
||||
python tests/elf/fuzzing.py \
|
||||
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
|
||||
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_openssl.bin -n 100
|
||||
- name: Fuzzing [nm x86-64]
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
source ${LIEF_VENV}/bin/activate
|
||||
export PYTHONPATH="${GITHUB_WORKSPACE}/tests:$PYTHONPATH"
|
||||
python tests/elf/fuzzing.py \
|
||||
${LIEF_BUILD_DIR}/tests/Melkor/src/MELKOR/melkor \
|
||||
--input-seed ${LIEF_SAMPLES_DIR}/ELF/ELF64_x86-64_binary_nm.bin -n 100
|
||||
|
||||
pywheels:
|
||||
runs-on: ubuntu-latest
|
||||
needs: linux-sdk
|
||||
container:
|
||||
image: liefproject/manylinux_2_28_x86_64
|
||||
env:
|
||||
CCACHE_DIR: "/home/pylief/.ccache"
|
||||
CXXFLAGS: "-ffunction-sections -fdata-sections -fvisibility-inlines-hidden -static-libgcc"
|
||||
CFLAGS: "-ffunction-sections -fdata-sections -static-libgcc"
|
||||
LDFLAGS: "-Wl,--gc-sections -Wl,--exclude-libs,ALL"
|
||||
CLICOLOR_FORCE: "1"
|
||||
FORCE_COLOR: "1"
|
||||
LIEF_BUILD_DIR: "/tmp/lief-build"
|
||||
ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
|
||||
ACTIONS_RUNTIME_TOKEN: "${{ env.ACTIONS_RUNTIME_TOKEN }}"
|
||||
ACTIONS_CACHE_URL: "${{ env.ACTIONS_CACHE_URL }}"
|
||||
options: --user 1001:1001
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
||||
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
@@ -93,37 +196,42 @@ jobs:
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Prepare ccache
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p /home/pylief/.ccache/tmp
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.ccache
|
||||
path: /home/pylief/.ccache
|
||||
key: linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-x86-64-${{ runner.os }}-${{ matrix.python-version }}
|
||||
- name: Download LIEF install dir
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: linux-x86-64-install
|
||||
path: ${{ runner.temp }}/lief-install
|
||||
- name: Python ${{ matrix.python-version }} -- Wheel
|
||||
shell: bash
|
||||
path: /install
|
||||
- name: Generate wheel
|
||||
env:
|
||||
PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
shell: bash
|
||||
run: |
|
||||
export PYLIEF_CONF=$GITHUB_WORKSPACE/scripts/docker/config/pylinux-x64.toml
|
||||
PYTHON_VERSION_ALT=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.8 -> 38
|
||||
docker run --rm \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION_ALT \
|
||||
-e PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION} \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
-v $RUNNER_TEMP/lief-install:/install \
|
||||
liefproject/manylinux_2_28_x86_64 bash /src/scripts/docker/run_linux.sh
|
||||
PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION_ALT}-cp${PYTHON_VERSION_ALT}/bin/python${PYTHON_VERSION}
|
||||
$PYTHON_BINARY -m pip -vvv wheel --disable-pip-version-check \
|
||||
--wheel-dir=$GITHUB_WORKSPACE/wheel_stage \
|
||||
$GITHUB_WORKSPACE/api/python
|
||||
- name: Run auditwheel
|
||||
shell: bash
|
||||
run: |
|
||||
ls -alh $GITHUB_WORKSPACE/wheel_stage
|
||||
find $GITHUB_WORKSPACE/wheel_stage -exec \
|
||||
auditwheel repair -w $GITHUB_WORKSPACE/dist {} \;
|
||||
ls -alh $GITHUB_WORKSPACE/dist
|
||||
- name: 'Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: linux-x86-64-python${{ matrix.python-version }}-wheel
|
||||
path: dist/*.whl
|
||||
@@ -131,14 +239,16 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ always() }}
|
||||
needs: [linux-sdk, pywheels]
|
||||
needs: [pywheels]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: linux-x86-64-*
|
||||
merge-multiple: true
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Display artifacts
|
||||
run: ls -R
|
||||
@@ -158,20 +268,5 @@ jobs:
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_S3_KEY=$LIEF_S3_KEY \
|
||||
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \
|
||||
liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
documentation:
|
||||
needs: [deploy]
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: liefproject/manylinux_2_28_x86_64
|
||||
env:
|
||||
CIRCLE_CI_URL: "https://circleci.com/api/v2/project/gh/lief-project/doc/pipeline"
|
||||
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
|
||||
steps:
|
||||
- name: Trigger documentation
|
||||
if: github.ref == 'refs/heads/master'
|
||||
run: |
|
||||
curl --request POST --url ${CIRCLE_CI_URL} \
|
||||
--header "Circle-Token: ${CIRCLE_CI_TOKEN}" \
|
||||
--header 'content-type: application/json' \
|
||||
--data '{"parameters":{"lief-branch":"master"}}'
|
||||
liefproject/deploy \
|
||||
python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
|
||||
|
||||
+45
-38
@@ -6,9 +6,9 @@ env:
|
||||
|
||||
jobs:
|
||||
osx-sdk:
|
||||
runs-on: macos-11.0
|
||||
runs-on: macos-13
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install system dependencies
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p $RUNNER_TEMP/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/.ccache
|
||||
key: osx-${{ runner.os }}-sdk-${{ steps.get-date.outputs.date }}
|
||||
@@ -33,6 +33,7 @@ jobs:
|
||||
- name: Build SDK
|
||||
shell: bash
|
||||
env:
|
||||
CLICOLOR_FORCE: "1"
|
||||
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
||||
CCACHE_DIR: ${{ runner.temp }}/.ccache
|
||||
CCACHE_MAXSIZE: 10.0G
|
||||
@@ -41,38 +42,37 @@ jobs:
|
||||
run: |
|
||||
bash scripts/osx/package_sdk.sh
|
||||
- name: 'Upload SDK Artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-sdk
|
||||
path: build/*.tar.gz
|
||||
retention-days: 3
|
||||
- name: 'Upload install artifact [arm64]'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-arm64-install
|
||||
path: install/arm64
|
||||
retention-days: 1
|
||||
- name: 'Upload install artifact [x64]'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-x64-install
|
||||
path: install/x64
|
||||
retention-days: 1
|
||||
osx-testing:
|
||||
runs-on: macos-11.0
|
||||
runs-on: macos-13
|
||||
if: "!contains(github.event.commits[0].message, '[skip-test]')"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ env.python-test-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-test-version }}
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
brew install cmake ninja ccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
run: |
|
||||
mkdir -p $RUNNER_TEMP/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/.ccache
|
||||
key: osx-${{ runner.os }}-test-${{ steps.get-date.outputs.date }}
|
||||
@@ -92,12 +92,16 @@ jobs:
|
||||
- name: Upgrade pip
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools
|
||||
python -m pip install --upgrade pip
|
||||
- name: Build Python 3.10 with tests
|
||||
shell: bash
|
||||
env:
|
||||
LIEF_SAMPLES_DIR: "/tmp/samples"
|
||||
BUILD_DIR: "/tmp/lief-build"
|
||||
LIEF_BUILD_DIR: "/tmp/lief-build"
|
||||
PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/osx-testing-x64.toml"
|
||||
CLICOLOR_FORCE: "1"
|
||||
PYTEST_ADDOPTS: "--color=yes"
|
||||
FORCE_COLOR: "1"
|
||||
MACOSX_TARGET: "11.7"
|
||||
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
||||
CCACHE_DIR: ${{ runner.temp }}/.ccache
|
||||
@@ -106,37 +110,39 @@ jobs:
|
||||
CCACHE_COMPRESS: 1
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python -m pip -vvv install api/python
|
||||
python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
|
||||
cd api/python
|
||||
PYLIEF_CONF=${GITHUB_WORKSPACE}/scripts/osx/osx-testing-x64.toml \
|
||||
python ./setup.py build \
|
||||
--build-base=${BUILD_DIR}/base \
|
||||
--build-temp=${BUILD_DIR}/temp \
|
||||
install --user
|
||||
cd ${GITHUB_WORKSPACE}
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
LIEF_SAMPLES_DIR: "/tmp/samples"
|
||||
LIEF_BUILD_DIR: "/tmp/lief-build"
|
||||
PYTEST_ADDOPTS: "--color=yes"
|
||||
run: |
|
||||
python tests/run_pytest.py
|
||||
python tests/run_tools_check.py ${BUILD_DIR}/temp
|
||||
ctest --output-on-failure --test-dir ${BUILD_DIR}/temp
|
||||
python tests/run_tools_check.py ${LIEF_BUILD_DIR}/
|
||||
ctest --output-on-failure --test-dir ${LIEF_BUILD_DIR}/
|
||||
wheels:
|
||||
runs-on: macos-11.0
|
||||
runs-on: macos-13
|
||||
needs: osx-sdk
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10', '3.11']
|
||||
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
|
||||
arch: ['x64', 'arm64']
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
brew install cmake ninja ccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
python -m pip install --upgrade pip
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
@@ -147,18 +153,14 @@ jobs:
|
||||
run: |
|
||||
mkdir -p $RUNNER_TEMP/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{ runner.temp }}/.ccache
|
||||
key: osx-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
osx-${{ runner.os }}-${{ matrix.arch }}-${{ matrix.python-version }}
|
||||
- name: Upgrade pip
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools
|
||||
- name: Download LIEF install dir
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: osx-${{ matrix.arch }}-install
|
||||
path: ~/lief-${{ matrix.arch }}-install
|
||||
@@ -166,6 +168,8 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: "11.0"
|
||||
FORCE_COLOR: "1"
|
||||
CLICOLOR_FORCE: "1"
|
||||
CCACHE_DIR: ${{ runner.temp }}/.ccache
|
||||
CCACHE_MAXSIZE: 10.0G
|
||||
CCACHE_CPP2: 1
|
||||
@@ -174,7 +178,7 @@ jobs:
|
||||
run: |
|
||||
python -m pip -vv wheel --wheel-dir=dist/ api/python
|
||||
- name: 'Upload Python wheel artifact - ${{ matrix.python-version }}'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: osx-wheel-${{ matrix.arch }}-${{ matrix.python-version }}
|
||||
path: dist/*.whl
|
||||
@@ -182,14 +186,16 @@ jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ always() }}
|
||||
needs: [osx-sdk, wheels]
|
||||
needs: [wheels]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: osx-*
|
||||
merge-multiple: true
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Display artifacts
|
||||
run: ls -R
|
||||
@@ -209,6 +215,7 @@ jobs:
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_S3_KEY=$LIEF_S3_KEY \
|
||||
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \
|
||||
liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
liefproject/deploy \
|
||||
python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
|
||||
|
||||
|
||||
|
||||
+24
-31
@@ -9,39 +9,34 @@ jobs:
|
||||
osx:
|
||||
runs-on: macos-11.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-osx-version }}
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
brew install cmake ninja ccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
python -m pip install --upgrade pip
|
||||
- name: Build with Python ${{ env.python-osx-version }} & Test
|
||||
shell: bash
|
||||
env:
|
||||
LIEF_SAMPLES_DIR: "/tmp/samples"
|
||||
BUILD_DIR: "/tmp/lief-build"
|
||||
LIEF_BUILD_DIR: "/tmp/lief-build"
|
||||
PYLIEF_CONF: "${{ github.workspace }}/scripts/osx/osx-testing-x64.toml"
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python -m pip install -e api/python
|
||||
python tests/dl_samples.py ${LIEF_SAMPLES_DIR}
|
||||
cd api/python
|
||||
PYLIEF_CONF=${GITHUB_WORKSPACE}/scripts/osx/osx-testing-x64.toml \
|
||||
python ./setup.py build \
|
||||
--build-base=${BUILD_DIR}/base \
|
||||
--build-temp=${BUILD_DIR}/temp \
|
||||
install --user
|
||||
cd ${GITHUB_WORKSPACE}
|
||||
python tests/run_pytest.py
|
||||
python tests/run_tools_check.py ${BUILD_DIR}/temp
|
||||
ctest --output-on-failure --test-dir ${BUILD_DIR}/temp
|
||||
python tests/run_tools_check.py ${BUILD_DIR}
|
||||
ctest --output-on-failure --test-dir ${BUILD_DIR}
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Build & Test
|
||||
@@ -49,48 +44,46 @@ jobs:
|
||||
env:
|
||||
PYTHON_VERSION: 39
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION \
|
||||
docker run --rm \
|
||||
-e PYTHON_VERSION=$PYTHON_VERSION \
|
||||
-e PYTHON_BINARY=/opt/python/cp39-cp39/bin/python3.9 \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
liefproject/manylinux_2_28_x86_64 bash /src/scripts/docker/run_linux_test.sh
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
liefproject/manylinux_2_28_x86_64 \
|
||||
bash /src/scripts/docker/test-linux-x64
|
||||
windows:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ env.python-win-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-win-version }}
|
||||
architecture: x64
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
choco install ninja
|
||||
python -m pip install --upgrade pip setuptools
|
||||
python -m pip install --upgrade pip
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
vsversion: "2022"
|
||||
- name: Set env variables
|
||||
run: |
|
||||
chcp 65001 #set code page to utf-8
|
||||
echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
|
||||
echo ("BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
|
||||
echo ("LIEF_BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
|
||||
echo ("PYLIEF_CONF=" + $env:GITHUB_WORKSPACE + "/scripts/windows/py-x64-test.toml") >> $env:GITHUB_ENV
|
||||
- name: Build Python ${{ env.python-win-version }}
|
||||
shell: cmd
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python -m pip install api/python
|
||||
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
|
||||
cd api/python
|
||||
python ./setup.py build ^
|
||||
--build-base=%BUILD_DIR%/base ^
|
||||
--build-temp=%BUILD_DIR%/temp ^
|
||||
install --user
|
||||
shell: cmd
|
||||
- name: Run tests
|
||||
timeout-minutes: 20
|
||||
shell: cmd
|
||||
run: |
|
||||
cd %GITHUB_WORKSPACE%
|
||||
python tests/run_pytest.py
|
||||
ctest --output-on-failure --test-dir %BUILD_DIR%/temp/Release
|
||||
shell: cmd
|
||||
ctest --output-on-failure --test-dir %BUILD_DIR%
|
||||
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
name: 'sanitize'
|
||||
on: workflow_dispatch
|
||||
|
||||
jobs:
|
||||
gcc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: compile
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e BUILD_DIR=/tmp/build_gcc \
|
||||
-e SRC_DIR=/src \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
liefproject/sanity:latest bash /src/scripts/docker/gcc.sh
|
||||
clang:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: compile
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e BUILD_DIR=/tmp/build_clang \
|
||||
-e SRC_DIR=/src \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
liefproject/sanity:latest bash /src/scripts/docker/clang.sh
|
||||
asan:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: compile
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
liefproject/sanity:latest bash /src/scripts/docker/asan_check.sh
|
||||
@@ -2,8 +2,10 @@ name: LIEF Windows
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'master'
|
||||
- 'release-**'
|
||||
- 'release/**'
|
||||
tags:
|
||||
- '**'
|
||||
|
||||
@@ -13,7 +15,7 @@ env:
|
||||
|
||||
jobs:
|
||||
build-sdk:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
matrix:
|
||||
arch: ['x64', 'x86']
|
||||
@@ -22,11 +24,11 @@ jobs:
|
||||
SCCACHE_CACHE_SIZE: 2G
|
||||
SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-version }}
|
||||
architecture: ${{ matrix.arch }}
|
||||
@@ -36,14 +38,14 @@ jobs:
|
||||
choco install sccache
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
vsversion: "2022"
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Setup sccache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
continue-on-error: false
|
||||
with:
|
||||
path: ${{ vars.SCCACHE_DIR }}
|
||||
@@ -56,13 +58,13 @@ jobs:
|
||||
run: |
|
||||
python ./scripts/windows/package_sdk.py
|
||||
- name: 'Upload SDK artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.arch }}-sdk
|
||||
path: build/*.zip
|
||||
retention-days: 3
|
||||
- name: 'Upload install artifact'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.arch }}-install
|
||||
path: ${{ runner.temp }}/lief-install
|
||||
@@ -72,7 +74,7 @@ jobs:
|
||||
- name: stop sccache server
|
||||
run: sccache --stop-server || true
|
||||
tests:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
if: "!contains(github.event.commits[0].message, '[skip-test]')"
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -82,11 +84,11 @@ jobs:
|
||||
SCCACHE_CACHE_SIZE: 2G
|
||||
SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ env.python-test-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-test-version }}
|
||||
architecture: ${{ matrix.arch }}
|
||||
@@ -96,14 +98,14 @@ jobs:
|
||||
choco install sccache
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
vsversion: "2022"
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Setup sccache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
continue-on-error: false
|
||||
with:
|
||||
path: ${{ vars.SCCACHE_DIR }}
|
||||
@@ -127,44 +129,46 @@ jobs:
|
||||
run: |
|
||||
chcp 65001 #set code page to utf-8
|
||||
echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
|
||||
echo ("BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
|
||||
echo ("LIEF_BUILD_DIR=" + $env:RUNNER_TEMP + "/lief-build") >> $env:GITHUB_ENV
|
||||
- name: Build Python ${{ env.python-test-version }}
|
||||
shell: cmd
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
|
||||
cd api/python
|
||||
python ./setup.py build ^
|
||||
--build-base=%BUILD_DIR%/base ^
|
||||
--build-temp=%BUILD_DIR%/temp ^
|
||||
install --user
|
||||
python -m pip -vvv install --user api/python
|
||||
- name: Download samples
|
||||
shell: cmd
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
|
||||
- name: Run tests
|
||||
timeout-minutes: 20
|
||||
shell: cmd
|
||||
run: |
|
||||
cd %GITHUB_WORKSPACE%
|
||||
python tests/run_pytest.py
|
||||
ctest --output-on-failure --test-dir %BUILD_DIR%/temp/Release
|
||||
shell: cmd
|
||||
ctest --output-on-failure --test-dir %LIEF_BUILD_DIR%/
|
||||
- name: sccache stats
|
||||
run: sccache --show-stats
|
||||
- name: stop sccache server
|
||||
run: sccache --stop-server || true
|
||||
wheels:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
needs: build-sdk
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8, 3.9, '3.10', '3.11', '3.12-dev']
|
||||
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
|
||||
arch: ['x86', 'x64']
|
||||
fail-fast: false
|
||||
env:
|
||||
SCCACHE_CACHE_SIZE: 2G
|
||||
SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
architecture: ${{ matrix.arch }}
|
||||
@@ -172,17 +176,17 @@ jobs:
|
||||
run: |
|
||||
choco install ninja
|
||||
choco install sccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
python -m pip install --upgrade pip
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
vsversion: "2022"
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Save sccache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
continue-on-error: false
|
||||
with:
|
||||
path: ${{ vars.SCCACHE_DIR }}
|
||||
@@ -190,16 +194,12 @@ jobs:
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ matrix.arch }}-sccache-${{ matrix.python-version }}
|
||||
- name: Download LIEF install dir
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.arch }}-install
|
||||
path: ~/lief-${{ matrix.arch }}-install
|
||||
- name: Start sccache server
|
||||
run: sccache --start-server
|
||||
- name: Upgrade pip
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
shell: cmd
|
||||
- name: Set arch specific env
|
||||
if: matrix.arch == 'x64'
|
||||
run: |
|
||||
@@ -216,10 +216,10 @@ jobs:
|
||||
chcp 65001 #set code page to utf-8
|
||||
- name: Build Python ${{ matrix.python-version }}
|
||||
run: |
|
||||
python -m pip -vv wheel --wheel-dir=dist/ api/python
|
||||
python -m pip -vvv wheel --wheel-dir=dist/ ./api/python
|
||||
shell: cmd
|
||||
- name: 'Upload Python artifacts [${{ matrix.python-version }}]'
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: windows-${{ matrix.arch }}-wheel-${{ matrix.python-version }}
|
||||
path: dist/*.whl
|
||||
@@ -227,14 +227,17 @@ jobs:
|
||||
deploy:
|
||||
if: ${{ always() }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build-sdk, wheels]
|
||||
#needs: [build-sdk, wheels]
|
||||
needs: [wheels]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: windows-*
|
||||
merge-multiple: true
|
||||
path: ${{ runner.temp }}/artifacts
|
||||
- name: Deploy
|
||||
env:
|
||||
@@ -251,5 +254,5 @@ jobs:
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_S3_KEY=$LIEF_S3_KEY \
|
||||
-e LIEF_S3_SECRET=$LIEF_S3_SECRET \
|
||||
liefproject/deploy python3 /src/.github/deploy.py /runner_tmp/artifacts
|
||||
liefproject/deploy python3 /src/.github/deploy.py --skip-sdk /runner_tmp/artifacts
|
||||
|
||||
|
||||
@@ -4,16 +4,18 @@ on:
|
||||
branches:
|
||||
- '**'
|
||||
- '!master'
|
||||
- '!main'
|
||||
- '!release-**'
|
||||
- '!release/**'
|
||||
tags-ignore:
|
||||
- "**"
|
||||
|
||||
env:
|
||||
python-version: '3.9'
|
||||
python-version: '3.12'
|
||||
|
||||
jobs:
|
||||
quick-test:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2022
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [x64, x86]
|
||||
@@ -22,11 +24,11 @@ jobs:
|
||||
SCCACHE_CACHE_SIZE: 2G
|
||||
SCCACHE_DIR: ${{ vars.SCCACHE_DIR }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ env.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ env.python-version }}
|
||||
architecture: ${{ matrix.python-version }}
|
||||
@@ -34,17 +36,17 @@ jobs:
|
||||
run: |
|
||||
choco install ninja
|
||||
choco install sccache
|
||||
python -m pip install --upgrade pip setuptools wheel
|
||||
python -m pip install --upgrade pip
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
vsversion: "2022"
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "date=$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
- name: Save sccache
|
||||
uses: actions/cache@v3
|
||||
uses: actions/cache@v4
|
||||
continue-on-error: false
|
||||
with:
|
||||
path: ${{ vars.SCCACHE_DIR }}
|
||||
@@ -57,20 +59,20 @@ jobs:
|
||||
run: |
|
||||
chcp 65001 #set code page to utf-8
|
||||
echo ("LIEF_SAMPLES_DIR=" + $env:RUNNER_TEMP + "/samples") >> $env:GITHUB_ENV
|
||||
- name: Upgrade pip
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
shell: cmd
|
||||
- name: Build Python ${{ env.python-version }}
|
||||
shell: cmd
|
||||
run: |
|
||||
python -m pip install -r tests/requirements.txt
|
||||
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
|
||||
python -m pip -vv install api/python
|
||||
python -m pip -vvv install api/python
|
||||
- name: Download samples
|
||||
shell: cmd
|
||||
run: |
|
||||
python tests/dl_samples.py %LIEF_SAMPLES_DIR%
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
timeout-minutes: 20
|
||||
run: |
|
||||
python ./tests/run_pytest.py
|
||||
shell: cmd
|
||||
- name: sccache stats
|
||||
run: sccache --show-stats
|
||||
- name: sccache server
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
build/
|
||||
*.so
|
||||
*.whl
|
||||
*.dll
|
||||
*.dylib
|
||||
*.lib
|
||||
lief.egg-info/
|
||||
dist/
|
||||
api/rust/cargo/target/*
|
||||
api/rust/examples/target/*
|
||||
tools/target/*
|
||||
plugins/ghidra/bin/
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
include:
|
||||
- project: 'LIEF/ci'
|
||||
ref: main
|
||||
file: 'main.yml'
|
||||
+101
-283
@@ -1,4 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(LIEF LANGUAGES C CXX)
|
||||
|
||||
enable_language(C)
|
||||
enable_language(CXX)
|
||||
|
||||
# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
|
||||
@@ -18,56 +22,38 @@ include(CheckCCompilerFlag)
|
||||
include(ExternalProject)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
|
||||
AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
# Information from git
|
||||
# ====================
|
||||
find_package(Git)
|
||||
if (DEFINED ENV{LIEF_VERSION_ENV})
|
||||
string(REGEX MATCHALL "([0-9]+)" VERSION_STRING "$ENV{LIEF_VERSION_ENV}")
|
||||
if (NOT VERSION_STRING)
|
||||
message(FATAL_ERROR "Invalid version")
|
||||
endif()
|
||||
list(GET VERSION_STRING 0 LIEF_VERSION_MAJOR)
|
||||
list(GET VERSION_STRING 1 LIEF_VERSION_MINOR)
|
||||
list(GET VERSION_STRING 2 LIEF_VERSION_PATCH)
|
||||
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git"
|
||||
AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.git" AND Git_FOUND)
|
||||
include(LIEFGit)
|
||||
else()
|
||||
set(LIEF_VERSION_MAJOR "0")
|
||||
set(LIEF_VERSION_MINOR "14")
|
||||
set(LIEF_VERSION_PATCH "0")
|
||||
set(LIEF_VERSION_MAJOR 0)
|
||||
set(LIEF_VERSION_MINOR 17)
|
||||
set(LIEF_VERSION_PATCH 6)
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{LIEF_COMMIT})
|
||||
set(LIEF_COMMIT_HASH "$ENV{LIEF_COMMIT}")
|
||||
endif()
|
||||
|
||||
if (DEFINED ENV{LIEF_BRANCH})
|
||||
set(LIEF_GIT_BRANCH "$ENV{LIEF_BRANCH}")
|
||||
endif()
|
||||
|
||||
# LIEF Project
|
||||
# ============
|
||||
project(
|
||||
LIEF
|
||||
VERSION ${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH})
|
||||
project(LIEF VERSION
|
||||
${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH})
|
||||
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION}")
|
||||
|
||||
# Select the MSVC runtime based on the LIEF_USE_CRT_XXX variable
|
||||
if(MSVC)
|
||||
foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE})
|
||||
string(TOUPPER "${build_type}" build)
|
||||
if(DEFINED "LIEF_USE_CRT_${build}")
|
||||
set(runtime "${LIEF_USE_CRT_${build}}")
|
||||
if(build_type STREQUAL Debug)
|
||||
set(default_runtime MDd)
|
||||
else()
|
||||
set(default_runtime MD)
|
||||
endif()
|
||||
if(runtime AND NOT "${runtime}" STREQUAL "${default_runtime}")
|
||||
if(runtime STREQUAL "MT")
|
||||
set(runtime_library "MultiThreaded")
|
||||
elseif(runtime STREQUAL "MD")
|
||||
set(runtime_library "MultiThreadedDLL")
|
||||
elseif(runtime STREQUAL "MTd")
|
||||
set(runtime_library "MultiThreadedDebug")
|
||||
elseif(runtime STREQUAL "MDd")
|
||||
set(runtime_library "MultiThreadedDebugDLL")
|
||||
else()
|
||||
message(FATAL_ERROR "Unsupported value LIEF_USE_CRT_${build}=${runtime}")
|
||||
endif()
|
||||
message(STATUS "LIEF_CRT_${build}: ${runtime}")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "${CMAKE_MSVC_RUNTIME_LIBRARY}$<$<CONFIG:${build_type}>:${runtime_library}>")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
# LIEF options
|
||||
# =============
|
||||
include(LIEFOptions)
|
||||
@@ -111,6 +97,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
endif()
|
||||
|
||||
message(STATUS "CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
|
||||
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "CMAKE_CXX_LINK_EXECUTABLE: ${CMAKE_CXX_LINK_EXECUTABLE}")
|
||||
message(STATUS "CMAKE_CXX_LINK_FLAGS: ${CMAKE_CXX_LINK_FLAGS}")
|
||||
@@ -123,131 +111,51 @@ message(STATUS "CMAKE_LINK_LIBRARY_FILE_FLAG: ${CMAKE_LINK_LIBRARY_FILE_FLA
|
||||
message(STATUS "CMAKE_LINK_INTERFACE_LIBRARIES: ${CMAKE_LINK_INTERFACE_LIBRARIES}")
|
||||
message(STATUS "CMAKE_CXX_IMPLICIT_LINK_LIBRARIES: ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}")
|
||||
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||
message(STATUS "CMAKE_MSVC_RUNTIME_LIBRARY: ${CMAKE_MSVC_RUNTIME_LIBRARY}")
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
# LIEF Source definition
|
||||
# ======================
|
||||
|
||||
set(LIEF_PRIVATE_INCLUDE_DIR)
|
||||
set(LIEF_PUBLIC_INCLUDE_DIR)
|
||||
|
||||
set(LIEF_PUBLIC_INCLUDE_FILES)
|
||||
set(LIEF_PRIVATE_INCLUDE_FILES)
|
||||
|
||||
set(LIBLIEF_SOURCE_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/errors.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/hash_stream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/logging.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/iostream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/utils.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal_utils.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/Object.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/Object.tcc"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/Visitor.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/BinaryStream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/VectorStream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/FileStream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/MemoryStream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/SpanStream.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/BinaryStream/Convert.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/hash.cpp")
|
||||
|
||||
# Grouping basic headers together
|
||||
# ===============================
|
||||
set(LIEF_INC_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/errors.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/span.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/ELF.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Abstract.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/iostream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/iterators.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/LIEF.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/logging.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/MachO.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/PE.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/types.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/utils.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/visibility.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Object.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/Visitor.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/visitor_macros.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/BinaryStream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/VectorStream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/FileStream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/MemoryStream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/SpanStream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/BinaryStream/Convert.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/internal_utils.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/hash_stream.hpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/frozen.hpp"
|
||||
)
|
||||
|
||||
set(LIEF_VISITOR_INCLUDE_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/hash.hpp")
|
||||
|
||||
set(LIEF_INCLUDE_FILES ${LIEF_INC_FILES} ${LIEF_VISITOR_INCLUDE_FILES})
|
||||
|
||||
set(LIEF_JSON_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/visitors/json.cpp")
|
||||
set(LIEF_JSON_HDR "${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/third-party/json.hpp")
|
||||
|
||||
list(APPEND LIEF_INC_FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/json.hpp")
|
||||
list(APPEND LIBLIEF_SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/json_api.cpp")
|
||||
|
||||
if(LIEF_ENABLE_JSON)
|
||||
list(APPEND LIBLIEF_SOURCE_FILES "${LIEF_JSON_SRC}")
|
||||
list(APPEND LIEF_INC_FILES "${LIEF_JSON_HDR}")
|
||||
endif()
|
||||
|
||||
source_group("Header Files" FILES ${LIEF_INC_FILES})
|
||||
source_group("Source Files" FILES ${LIBLIEF_SOURCE_FILES})
|
||||
|
||||
source_group("Header Files\\visitors" FILES ${LIEF_VISITOR_INCLUDE_FILES})
|
||||
|
||||
add_library(LIB_LIEF ${LIBLIEF_SOURCE_FILES} ${LIEF_INCLUDE_FILES})
|
||||
add_library(LIB_LIEF src/Object.cpp)
|
||||
add_subdirectory(src)
|
||||
|
||||
if(NOT LIEF_PY_LIEF_EXT)
|
||||
add_library(LIEF::LIEF ALIAS LIB_LIEF)
|
||||
endif()
|
||||
|
||||
if(NOT LIEF_OPT_MBEDTLS_EXTERNAL)
|
||||
set_source_files_properties(${mbedtls_src_crypto} PROPERTIES GENERATED TRUE)
|
||||
set_source_files_properties(${mbedtls_src_x509} PROPERTIES GENERATED TRUE)
|
||||
set_source_files_properties(${mbedtls_src_tls} PROPERTIES GENERATED TRUE)
|
||||
target_sources(LIB_LIEF PRIVATE
|
||||
"${mbedtls_src_crypto}"
|
||||
"${mbedtls_src_x509}"
|
||||
"${mbedtls_src_tls}")
|
||||
set_source_files_properties(${mbedtls_src_files} PROPERTIES GENERATED TRUE)
|
||||
target_sources(LIB_LIEF PRIVATE ${mbedtls_src_files})
|
||||
target_compile_definitions(LIB_LIEF PRIVATE -DMBEDTLS_NO_PLATFORM_ENTROPY)
|
||||
|
||||
source_group("mbedtls\\crypto" FILES ${mbedtls_src_crypto})
|
||||
source_group("mbedtls\\x509" FILES ${mbedtls_src_x509})
|
||||
source_group("mbedtls\\tls" FILES ${mbedtls_src_tls})
|
||||
|
||||
target_include_directories(
|
||||
LIB_LIEF SYSTEM PRIVATE
|
||||
"${MBEDTLS_INCLUDE_DIRS}"
|
||||
"${MBEDTLS_SOURCE_DIR}/library"
|
||||
target_include_directories(LIB_LIEF SYSTEM PRIVATE
|
||||
${MBEDTLS_INCLUDE_DIRS}
|
||||
"${MBEDTLS_SOURCE_DIR}/library"
|
||||
)
|
||||
|
||||
add_dependencies(LIB_LIEF lief_mbed_tls)
|
||||
else()
|
||||
find_package(MbedTLS REQUIRED)
|
||||
target_link_libraries(LIB_LIEF PRIVATE
|
||||
MbedTLS::mbedcrypto
|
||||
MbedTLS::mbedx509)
|
||||
MbedTLS::mbedcrypto MbedTLS::mbedx509)
|
||||
endif()
|
||||
|
||||
if(WINDOWS AND BUILD_SHARED_LIBS)
|
||||
target_link_libraries(LIB_LIEF ws2_32)
|
||||
target_compile_definitions(LIB_LIEF PRIVATE
|
||||
-DMBEDTLS_CONFIG_FILE="${CMAKE_CURRENT_SOURCE_DIR}/config/mbedtls/config.h"
|
||||
)
|
||||
|
||||
if(WIN32 AND BUILD_SHARED_LIBS)
|
||||
target_link_libraries(LIB_LIEF PRIVATE ws2_32)
|
||||
if (LIEF_IMPORT_SUFFIX)
|
||||
set_target_properties(LIB_LIEF PROPERTIES IMPORT_SUFFIX "${LIEF_IMPORT_SUFFIX}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options(/bigobj)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug AND WINDOWS)
|
||||
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_SECURE_SCL=0
|
||||
-D_HAS_ITERATOR_DEBUGGING=0)
|
||||
endif()
|
||||
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug AND UNIX)
|
||||
target_compile_options(LIB_LIEF PRIVATE -g -O0)
|
||||
endif()
|
||||
@@ -258,88 +166,30 @@ else()
|
||||
target_compile_definitions(LIB_LIEF PRIVATE -DLIEF_STATIC)
|
||||
endif()
|
||||
|
||||
# Abstract part
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/src/Abstract/CMakeLists.txt")
|
||||
|
||||
# ELF Part
|
||||
# ========
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/src/ELF/CMakeLists.txt")
|
||||
if(LIEF_ELF)
|
||||
set(ENABLE_ELF_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_ELF_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# PE Part
|
||||
# =======
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/src/PE/CMakeLists.txt")
|
||||
if(LIEF_PE)
|
||||
set(ENABLE_PE_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_PE_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# MachO part
|
||||
# ==========
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/src/MachO/CMakeLists.txt")
|
||||
if(LIEF_MACHO)
|
||||
set(ENABLE_MACHO_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_MACHO_SUPPORT 0)
|
||||
if(LIEF_ENABLE_JSON)
|
||||
# Make nlohmann/json is only using C++11 API.
|
||||
# Especially, MSVC[14.37.32822] is buggy with (no)rtti & std::any
|
||||
# Ref:
|
||||
# - https://github.com/nlohmann/json/issues/3900
|
||||
# - https://github.com/microsoft/STL/issues/4349#issuecomment-1920093172
|
||||
target_compile_definitions(LIB_LIEF PRIVATE JSON_HAS_CPP_11)
|
||||
endif()
|
||||
|
||||
# Logging Configuration
|
||||
# =====================
|
||||
|
||||
target_compile_definitions(LIB_LIEF PRIVATE SPDLOG_DISABLE_DEFAULT_LOGGER
|
||||
SPDLOG_NO_EXCEPTIONS
|
||||
SPDLOG_FUNCTION=)
|
||||
|
||||
if (MSVC AND NOT CLANG_CL AND NOT LIEF_EXTERNAL_SPDLOG)
|
||||
target_compile_definitions(LIB_LIEF PRIVATE FMT_UNICODE=0)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
||||
target_compile_definitions(LIB_LIEF PRIVATE SPDLOG_NO_THREAD_ID)
|
||||
endif()
|
||||
|
||||
|
||||
# OAT part
|
||||
# ========
|
||||
if(LIEF_OAT)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/src/OAT/CMakeLists.txt)
|
||||
set(ENABLE_OAT_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_OAT_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# DEX part
|
||||
# ========
|
||||
if(LIEF_DEX)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/src/DEX/CMakeLists.txt)
|
||||
set(ENABLE_DEX_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_DEX_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# VDEX part
|
||||
# =========
|
||||
if(LIEF_VDEX)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/src/VDEX/CMakeLists.txt)
|
||||
set(ENABLE_VDEX_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_VDEX_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# ART part
|
||||
# ========
|
||||
if(LIEF_ART)
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/src/ART/CMakeLists.txt)
|
||||
set(ENABLE_ART_SUPPORT 1)
|
||||
else()
|
||||
set(ENABLE_ART_SUPPORT 0)
|
||||
endif()
|
||||
|
||||
# Platforms
|
||||
# =========
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/src/platforms/CMakeLists.txt)
|
||||
|
||||
# LIEF includes
|
||||
# =============
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/version.h.in"
|
||||
@@ -348,16 +198,18 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/version.h.in"
|
||||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF/config.h.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/include/LIEF/config.h" @ONLY)
|
||||
|
||||
list(APPEND LIEF_PUBLIC_INCLUDE_DIR
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/include/")
|
||||
set(LIEF_PUBLIC_INCLUDE_DIR
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/
|
||||
${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
|
||||
list(APPEND LIEF_PRIVATE_INCLUDE_DIR "${LIEF_PUBLIC_INCLUDE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
set(LIEF_PRIVATE_INCLUDE_DIR
|
||||
${LIEF_PUBLIC_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEF.pc.in ${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc
|
||||
@ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEF.pc.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LIEF.pc @ONLY)
|
||||
|
||||
target_include_directories(LIB_LIEF
|
||||
PUBLIC "$<BUILD_INTERFACE:${LIEF_PUBLIC_INCLUDE_DIR}>"
|
||||
@@ -382,6 +234,7 @@ if(LIEF_ENABLE_JSON)
|
||||
target_include_directories(LIB_LIEF PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/)
|
||||
endif()
|
||||
target_compile_definitions(LIB_LIEF PRIVATE JSON_NOEXCEPTION)
|
||||
endif()
|
||||
|
||||
if(LIEF_FROZEN_ENABLED)
|
||||
@@ -423,7 +276,7 @@ endif()
|
||||
|
||||
if(LIEF_OPT_UTFCPP_EXTERNAL)
|
||||
find_package(utf8cpp REQUIRED)
|
||||
target_link_libraries(LIB_LIEF PRIVATE utf8cpp)
|
||||
target_link_libraries(LIB_LIEF PRIVATE utf8cpp::utf8cpp)
|
||||
else()
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/internal/utfcpp/utf8.h
|
||||
COMMAND
|
||||
@@ -462,28 +315,23 @@ endif()
|
||||
|
||||
target_link_libraries(LIB_LIEF PRIVATE lief_spdlog)
|
||||
|
||||
if(ANDROID AND BUILD_SHARED_LIBS AND LIEF_LOGGING)
|
||||
if(ANDROID AND LIEF_LOGGING)
|
||||
target_link_libraries(LIB_LIEF PUBLIC log)
|
||||
endif()
|
||||
|
||||
# Flags definition
|
||||
# ----------------
|
||||
|
||||
# cmake-format: off
|
||||
set_target_properties(
|
||||
LIB_LIEF
|
||||
set_target_properties(LIB_LIEF
|
||||
PROPERTIES POSITION_INDEPENDENT_CODE ON
|
||||
CXX_STANDARD 17
|
||||
CXX_STANDARD_REQUIRED ON
|
||||
VISIBILITY_INLINES_HIDDEN ON
|
||||
CXX_VISIBILITY_PRESET hidden
|
||||
C_VISIBILITY_PRESET hidden)
|
||||
# cmake-format: on
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
set_property(
|
||||
TARGET LIB_LIEF
|
||||
APPEND
|
||||
PROPERTY LINK_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
||||
set_property(TARGET LIB_LIEF APPEND
|
||||
PROPERTY LINK_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")
|
||||
endif()
|
||||
|
||||
target_compile_definitions(LIB_LIEF PUBLIC -D_GLIBCXX_USE_CXX11_ABI=1)
|
||||
@@ -497,7 +345,7 @@ if(LIEF_ASAN)
|
||||
|
||||
set_property(TARGET LIB_LIEF
|
||||
APPEND PROPERTY LINK_FLAGS -fsanitize=address)
|
||||
target_link_libraries(LIB_LIEF INTERFACE asan)
|
||||
target_link_libraries(LIB_LIEF INTERFACE libclang_rt.asan.so)
|
||||
endif()
|
||||
|
||||
if(LIEF_LSAN)
|
||||
@@ -539,27 +387,27 @@ endif()
|
||||
if(LIEF_SANITIZER)
|
||||
message("LIEF Sanitizer enabled: ${SANITIZER_FLAGS}")
|
||||
target_compile_options(LIB_LIEF PUBLIC ${SANITIZER_FLAGS})
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests/sanitizer")
|
||||
add_subdirectory(tests/sanitizer)
|
||||
endif()
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
# Fuzzing options
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if(LIEF_FUZZING)
|
||||
set(FUZZING_FLAGS -fno-omit-frame-pointer -g -O2 -fsanitize=address,fuzzer-no-link)
|
||||
set(FUZZING_LINKER_FLAGS -fsanitize=address,fuzzer-no-link)
|
||||
set(FUZZING_FLAGS -fno-omit-frame-pointer -g -O2 -fsanitize=fuzzer-no-link)
|
||||
set(FUZZING_LINKER_FLAGS -fsanitize=fuzzer-no-link)
|
||||
set_property(TARGET LIB_LIEF
|
||||
APPEND PROPERTY LINK_FLAGS ${FUZZING_LINKER_FLAGS})
|
||||
|
||||
target_compile_options(LIB_LIEF PRIVATE ${FUZZING_FLAGS})
|
||||
target_link_libraries(LIB_LIEF PUBLIC asan pthread)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/fuzzing")
|
||||
target_link_libraries(LIB_LIEF PUBLIC pthread)
|
||||
add_subdirectory(fuzzing)
|
||||
endif()
|
||||
|
||||
include(LIEFCompilerFlags)
|
||||
|
||||
if(LIEF_PROFILING)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/profiling")
|
||||
add_subdirectory(profiling)
|
||||
endif()
|
||||
|
||||
set_target_properties(LIB_LIEF PROPERTIES
|
||||
@@ -567,6 +415,12 @@ set_target_properties(LIB_LIEF PROPERTIES
|
||||
EXPORT_NAME LIEF
|
||||
CLEAN_DIRECT_OUTPUT 1)
|
||||
|
||||
if (LIEF_SO_VERSION)
|
||||
set_target_properties(LIB_LIEF PROPERTIES
|
||||
VERSION "${LIEF_VERSION_MAJOR}.${LIEF_VERSION_MINOR}.${LIEF_VERSION_PATCH}"
|
||||
SOVERSION "${LIEF_VERSION_MAJOR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Set a default build type if none was specified
|
||||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||
@@ -586,28 +440,15 @@ if(APPLE)
|
||||
set_target_properties(LIB_LIEF PROPERTIES MACOSX_RPATH ON)
|
||||
endif()
|
||||
|
||||
# API
|
||||
# ======================
|
||||
include(LIEFApi)
|
||||
add_subdirectory(api)
|
||||
|
||||
# Examples
|
||||
# ======================
|
||||
if(LIEF_EXAMPLES)
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/examples")
|
||||
add_subdirectory(examples)
|
||||
endif()
|
||||
|
||||
# Tests
|
||||
# ======================
|
||||
|
||||
if(LIEF_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/tests")
|
||||
endif()
|
||||
|
||||
# Documentation
|
||||
# ======================
|
||||
if(LIEF_DOC)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/doc)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
# Post-build operations
|
||||
@@ -638,10 +479,8 @@ if(LIEF_INSTALL)
|
||||
|
||||
# Find Package Config
|
||||
# ======================
|
||||
configure_file(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEFConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake
|
||||
@ONLY)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/LIEFConfig.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake @ONLY)
|
||||
|
||||
write_basic_package_version_file(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
|
||||
@@ -663,25 +502,6 @@ if(LIEF_INSTALL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Installation
|
||||
# ======================
|
||||
|
||||
if(UNIX)
|
||||
include(GNUInstallDirs)
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
else()
|
||||
if(WIN32)
|
||||
set(CMAKE_INSTALL_LIBDIR "lib")
|
||||
set(CMAKE_INSTALL_DATADIR "share")
|
||||
set(CMAKE_INSTALL_INCLUDEDIR "include")
|
||||
set(CMAKE_INSTALL_BINDIR "bin")
|
||||
set(CMAKE_INSTALL_DATAROOTDIR "share")
|
||||
message(STATUS "Setting installation destination on Windows to: ${CMAKE_INSTALL_PREFIX}")
|
||||
else()
|
||||
message(FATAL_ERROR "System not UNIX nor WIN32 - not implemented yet")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(
|
||||
TARGETS LIB_LIEF lief_spdlog
|
||||
EXPORT LIEFExport
|
||||
@@ -700,7 +520,7 @@ if(LIEF_INSTALL)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_BINARY_DIR}/LIEFConfig.cmake
|
||||
${CMAKE_CURRENT_BINARY_DIR}/LIEFConfigVersion.cmake
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LIEF
|
||||
COMPONENT config)
|
||||
|
||||
install(
|
||||
@@ -717,7 +537,7 @@ if(LIEF_INSTALL)
|
||||
install(
|
||||
EXPORT LIEFExport
|
||||
NAMESPACE LIEF::
|
||||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/LIEF/cmake
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/LIEF
|
||||
FILE LIEFExport-${lib_type}.cmake
|
||||
COMPONENT config)
|
||||
|
||||
@@ -726,7 +546,5 @@ if(LIEF_INSTALL)
|
||||
NAMESPACE LIEF::
|
||||
FILE LIEFExport-${lib_type}.cmake)
|
||||
|
||||
# Package
|
||||
# ======================
|
||||
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/package")
|
||||
add_subdirectory(package)
|
||||
endif()
|
||||
|
||||
@@ -186,8 +186,8 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 - 2023 R. Thomas
|
||||
Copyright 2017 - 2023 Quarkslab
|
||||
Copyright 2017 - 2025 R. Thomas
|
||||
Copyright 2017 - 2025 Quarkslab
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,87 +1,60 @@
|
||||
<p align="center" >
|
||||
<img width="90%" src="https://github.com/lief-project/LIEF/blob/master/.github/images/architecture.png"/><br />
|
||||
<img width="90%" src="https://github.com/lief-project/LIEF/blob/main/.github/images/architecture.png"/><br />
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://discord.gg/7hRFGWYedu">
|
||||
<img src="https://img.shields.io/discord/1117013848914931762">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/linux-x86-64.yml">
|
||||
<img alt="Linux x86-64 CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/linux-x86-64.yml?branch=master&label=Linux%20x86-64&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/linux-aarch64.yml">
|
||||
<img alt="Linux AArch64 CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/linux-aarch64.yml?branch=master&label=Linux%20AArch64&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/android.yml">
|
||||
<img alt="Android CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/android.yml?branch=master&label=Android&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/osx.yml">
|
||||
<img alt="macOS CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/osx.yml?branch=master&label=macOS&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/ios.yml">
|
||||
<img alt="iOS CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/ios.yml?branch=master&label=iOS&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions/workflows/windows-all.yml">
|
||||
<img alt="Windows CI status" src="https://img.shields.io/github/actions/workflow/status/lief-project/LIEF/windows-all.yml?branch=master&label=Windows&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/releases">
|
||||
<img src="https://img.shields.io/github/v/release/lief-project/LIEF?style=flat-square">
|
||||
</a>
|
||||
|
||||
<a href="https://twitter.com/LIEF_project">
|
||||
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/lief_project">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br />
|
||||
|
||||
<p align="center">
|
||||
<a href="https://lief-project.github.io/blog/"><b>Blog</b></a> •
|
||||
<a href="https://lief-project.github.io/doc/latest/index.html"><b>Documentation</b></a> •
|
||||
<a href="https://lief.re/blog/"><b>Blog</b></a> •
|
||||
<a href="https://lief.re/doc/latest/index.html"><b>Documentation</b></a> •
|
||||
<a href="#user-content-about-1"><b>About</b></a>
|
||||
</p>
|
||||
<br />
|
||||
|
||||
# About
|
||||
|
||||
The purpose of this project is to provide a cross platform library which can parse,
|
||||
The purpose of this project is to provide a cross-platform library to parse,
|
||||
modify and abstract ELF, PE and MachO formats.
|
||||
|
||||
Main features:
|
||||
**Main features**:
|
||||
|
||||
* **Parsing**: LIEF can parse ELF, PE, MachO, OAT, DEX, VDEX, ART and provides an user-friendly API to access to format internals.
|
||||
* **Modify**: LIEF enables to modify some parts of these formats
|
||||
* **Parsing**: LIEF can parse [ELF](https://lief.re/doc/latest/formats/elf/index.html), [PE](https://lief.re/doc/latest/formats/pe/index.html), [MachO](https://lief.re/doc/latest/formats/macho/index.html), [COFF](https://lief.re/doc/latest/formats/coff/index.html), OAT, DEX, VDEX, ART and provides an user-friendly API to access to internals.
|
||||
* **Modify**: LIEF can use to modify some parts of these formats (adding a section, changing a symbol's name, ...)
|
||||
* **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.
|
||||
* **API**: LIEF can be used in C, C++ and Python
|
||||
* **API**: LIEF can be used in [C++](https://lief.re/doc/latest/doxygen/), Python, [Rust](https://lief-rs.s3.fr-par.scw.cloud/doc/latest/lief/index.html) and C
|
||||
|
||||
**Extended features**:
|
||||
|
||||
* [**DWARF/PDB** Support](https://lief.re/doc/latest/extended/debug_info/index.html)
|
||||
* [**Objective-C** Metadata](https://lief.re/doc/latest/extended/objc/index.html)
|
||||
* [**Dyld Shared Cache**](https://lief.re/doc/latest/extended/dsc/index.html) with support for extracting Dylib
|
||||
* [**Disassembler**](https://lief.re/doc/latest/extended/disassembler/index.html): AArch64, x86/x86-64, ARM, RISC-V, Mips, PowerPC, eBPF
|
||||
* [**Assembler**](https://lief.re/doc/latest/extended/assembler/index.html): AArch64, x86/x86-64
|
||||
|
||||
**Plugins**:
|
||||
|
||||
* [**Ghidra**](https://lief.re/doc/latest/plugins/ghidra/index.html)
|
||||
* [**BinaryNinja**](https://lief.re/doc/latest/plugins/binaryninja/index.html)
|
||||
|
||||
# Content
|
||||
|
||||
- [About](#about)
|
||||
- [Download / Install](#downloads--install)
|
||||
- [Getting started](#getting-started)
|
||||
- [Blog](https://lief.re/blog/)
|
||||
- [Documentation](#documentation)
|
||||
- [Sphinx](https://lief-project.github.io/doc/stable/index.html)
|
||||
- [Doxygen](https://lief-project.github.io/doc/latest/doxygen/index.html)
|
||||
- [Rust](https://lief.re/doc/stable/rust/lief/)
|
||||
- [Sphinx](https://lief.re/doc/latest/index.html)
|
||||
- [Doxygen](https://lief.re/doc/latest/doxygen/index.html)
|
||||
- Tutorials:
|
||||
- [Parse and manipulate formats](https://lief-project.github.io/doc/latest/tutorials/01_play_with_formats.html)
|
||||
- [Create a PE from scratch](https://lief-project.github.io/doc/latest/tutorials/02_pe_from_scratch.html)
|
||||
- [Play with ELF symbols](https://lief-project.github.io/doc/latest/tutorials/03_elf_change_symbols.html)
|
||||
- [ELF Hooking](https://lief-project.github.io/doc/latest/tutorials/04_elf_hooking.html)
|
||||
- [Infecting the plt/got](https://lief-project.github.io/doc/latest/tutorials/05_elf_infect_plt_got.html)
|
||||
- [PE Hooking](https://lief-project.github.io/doc/latest/tutorials/06_pe_hooking.html)
|
||||
- [PE Resources](https://lief-project.github.io/doc/latest/tutorials/07_pe_resource.html)
|
||||
- [Transforming an ELF executable into a library](https://lief-project.github.io/doc/latest/tutorials/08_elf_bin2lib.html)
|
||||
- [How to use frida on a non-rooted device](https://lief-project.github.io/doc/latest/tutorials/09_frida_lief.html)
|
||||
- [Android formats](https://lief-project.github.io/doc/latest/tutorials/10_android_formats.html)
|
||||
- [Mach-O modification](https://lief-project.github.io/doc/latest/tutorials/11_macho_modification.html)
|
||||
- [ELF Coredump](https://lief-project.github.io/doc/latest/tutorials/12_elf_coredump.html)
|
||||
- [PE Authenticode](https://lief-project.github.io/doc/latest/tutorials/13_pe_authenticode.html)
|
||||
- [Parse and manipulate formats](https://lief.re/doc/latest/tutorials/01_play_with_formats.html)
|
||||
- [Play with ELF symbols](https://lief.re/doc/latest/tutorials/03_elf_change_symbols.html)
|
||||
- [PE Resources](https://lief.re/doc/latest/tutorials/07_pe_resource.html)
|
||||
- [Transforming an ELF executable into a library](https://lief.re/doc/latest/tutorials/08_elf_bin2lib.html)
|
||||
- [How to use frida on a non-rooted device](https://lief.re/doc/latest/tutorials/09_frida_lief.html)
|
||||
- [Android formats](https://lief.re/doc/latest/tutorials/10_android_formats.html)
|
||||
- [Mach-O modification](https://lief.re/doc/latest/tutorials/11_macho_modification.html)
|
||||
- [ELF Coredump](https://lief.re/doc/latest/tutorials/12_elf_coredump.html)
|
||||
- [PE Authenticode](https://lief.re/doc/latest/tutorials/13_pe_authenticode.html)
|
||||
- [Contact](#contact)
|
||||
- [About](#about)
|
||||
- [Authors](#authors)
|
||||
@@ -90,12 +63,27 @@ Main features:
|
||||
|
||||
## Downloads / Install
|
||||
|
||||
First, make sure to have an updated version of setuptools:
|
||||
## C++
|
||||
|
||||
```console
|
||||
pip install setuptools --upgrade
|
||||
```cmake
|
||||
find_package(LIEF REQUIRED)
|
||||
target_link_libraries(my-project LIEF::LIEF)
|
||||
```
|
||||
|
||||
## Rust
|
||||
|
||||
```toml
|
||||
[package]
|
||||
name = "my-awesome-project"
|
||||
version = "0.0.1"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
lief = "0.17.6"
|
||||
```
|
||||
|
||||
## Python
|
||||
|
||||
To install the latest **version** (release):
|
||||
|
||||
```console
|
||||
@@ -105,22 +93,23 @@ pip install lief
|
||||
To install nightly build:
|
||||
|
||||
```console
|
||||
pip install [--user] --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==0.14.0.dev0
|
||||
pip install [--user] --force-reinstall --index-url https://lief.s3-website.fr-par.scw.cloud/latest lief==1.0.0.dev0
|
||||
```
|
||||
|
||||
### Packages
|
||||
|
||||
- LIEF Extended: https://extended.lief.re (GitHub OAuth)
|
||||
- **Nightly**:
|
||||
* SDK: https://lief.s3-website.fr-par.scw.cloud/latest/sdk
|
||||
* Python Wheels: https://lief.s3-website.fr-par.scw.cloud/latest/lief
|
||||
- **v0.13.2**: https://github.com/lief-project/LIEF/releases/tag/0.13.2
|
||||
- **v0.17.6**: https://github.com/lief-project/LIEF/releases/tag/0.17.6
|
||||
|
||||
Here are guides to install or integrate LIEF:
|
||||
|
||||
* [Python](https://lief-project.github.io/doc/latest/installation.html#python)
|
||||
* [VisualStudio](https://lief-project.github.io/doc/latest/installation.html#visual-studio-integration)
|
||||
* [XCode](https://lief-project.github.io/doc/latest/installation.html#xcode-integration)
|
||||
* [CMake](https://lief-project.github.io/doc/latest/installation.html#cmake-integration)
|
||||
* [Python](https://lief.re/doc/latest/installation.html#python)
|
||||
* [Visual Studio](https://lief.re/doc/latest/installation.html#visual-studio-integration)
|
||||
* [XCode](https://lief.re/doc/latest/installation.html#xcode-integration)
|
||||
* [CMake](https://lief.re/doc/latest/installation.html#cmake-integration)
|
||||
|
||||
## Getting started
|
||||
|
||||
@@ -131,15 +120,34 @@ import lief
|
||||
|
||||
# ELF
|
||||
binary = lief.parse("/usr/bin/ls")
|
||||
print(binary)
|
||||
for section in binary.sections:
|
||||
print(section.name, section.virtual_address)
|
||||
|
||||
# PE
|
||||
binary = lief.parse("C:\\Windows\\explorer.exe")
|
||||
print(binary)
|
||||
|
||||
if rheader := pe.rich_header:
|
||||
print(rheader.key)
|
||||
|
||||
# Mach-O
|
||||
binary = lief.parse("/usr/bin/ls")
|
||||
print(binary)
|
||||
for fixup in binary.dyld_chained_fixups:
|
||||
print(fixup)
|
||||
```
|
||||
|
||||
### Rust
|
||||
|
||||
```rust
|
||||
use lief::Binary;
|
||||
use lief::pe::debug::Entries::CodeViewPDB;
|
||||
|
||||
if let Some(Binary::PE(pe)) = Binary::parse(path.as_str()) {
|
||||
for entry in pe.debug() {
|
||||
if let CodeViewPDB(pdb_view) = entry {
|
||||
println!("{}", pdb_view.filename());
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### C++
|
||||
@@ -150,17 +158,23 @@ print(binary)
|
||||
int main(int argc, char** argv) {
|
||||
// ELF
|
||||
if (std::unique_ptr<const LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse("/bin/ls")) {
|
||||
std::cout << *elf << '\n';
|
||||
for (const LIEF::ELF::Section& section : elf->sections()) {
|
||||
std::cout << section->name() << ' ' << section->virtual_address() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// PE
|
||||
if (std::unique_ptr<const LIEF::PE::Binary> pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe")) {
|
||||
std::cout << *pe << '\n';
|
||||
if (const LIEF::PE::RichHeader* rheader : pe->rich_header()) {
|
||||
std::cout << rheader->key() << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
// Mach-O
|
||||
if (std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse("/bin/ls")) {
|
||||
std::cout << *macho << '\n';
|
||||
for (const LIEF::MachO::DyldChainedFixups& fixup : macho->dyld_chained_fixups()) {
|
||||
std::cout << fixup << '\n';
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -189,10 +203,9 @@ int main(int argc, char** argv) {
|
||||
|
||||
## Documentation
|
||||
|
||||
* [Main documentation](https://lief-project.github.io/doc/latest/index.html)
|
||||
* [Tutorial](https://lief-project.github.io/doc/latest/tutorials/index.html)
|
||||
* [API](https://lief-project.github.io/doc/latest/api/index.html)
|
||||
* [Doxygen](https://lief-project.github.io/doc/latest/doxygen/index.html)
|
||||
* [Main documentation](https://lief.re/doc/latest/index.html)
|
||||
* [Doxygen](https://lief.re/doc/latest/doxygen/index.html)
|
||||
* [Rust](https://lief.re/doc/stable/rust/lief/)
|
||||
|
||||
## Contact
|
||||
|
||||
@@ -203,11 +216,11 @@ int main(int argc, char** argv) {
|
||||
|
||||
### Authors
|
||||
|
||||
Romain Thomas ([@rh0main](https://twitter.com/rh0main)) - [Quarkslab](https://www.quarkslab.com)
|
||||
Romain Thomas ([@rh0main](https://www.romainthomas.fr/)) - Formerly at [Quarkslab](https://www.quarkslab.com)
|
||||
|
||||
### License
|
||||
|
||||
LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/LIEF/blob/0.13.0/LICENSE).
|
||||
LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/LIEF/blob/0.17.6/LICENSE).
|
||||
|
||||
### Bibtex
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
if (LIEF_PYTHON_API)
|
||||
add_subdirectory(python)
|
||||
endif()
|
||||
|
||||
if(LIEF_C_API)
|
||||
add_subdirectory(c)
|
||||
endif()
|
||||
|
||||
if(LIEF_RUST_API)
|
||||
add_subdirectory(rust)
|
||||
endif()
|
||||
|
||||
+9
-26
@@ -1,32 +1,15 @@
|
||||
include_directories(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
)
|
||||
|
||||
set(LIEF_C_INCLUDE_FILES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/LIEF.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/logging.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/types.h"
|
||||
)
|
||||
|
||||
set(LIEF_C_SRC "${CMAKE_CURRENT_LIST_DIR}/logging.cpp")
|
||||
|
||||
if (LIEF_ELF)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/ELF/CMakeLists.txt")
|
||||
if(LIEF_ELF)
|
||||
add_subdirectory(ELF)
|
||||
endif()
|
||||
|
||||
if (LIEF_PE)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/PE/CMakeLists.txt")
|
||||
if(LIEF_PE)
|
||||
add_subdirectory(PE)
|
||||
endif()
|
||||
|
||||
if (LIEF_MACHO)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/MachO/CMakeLists.txt")
|
||||
if(LIEF_MACHO)
|
||||
add_subdirectory(MachO)
|
||||
endif()
|
||||
|
||||
source_group("Header Files\\C API" FILES ${LIEF_C_INCLUDE_FILES})
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_C_SRC}" ${LIEF_C_INCLUDE_FILES})
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE logging.cpp)
|
||||
target_include_directories(LIB_LIEF PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>")
|
||||
|
||||
+8
-11
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,7 @@ namespace LIEF {
|
||||
namespace ELF {
|
||||
void init_c_binary(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->handler = reinterpret_cast<void*>(binary);
|
||||
c_binary->type = static_cast<enum LIEF_ELF_ELF_CLASS>(binary->type());
|
||||
c_binary->type = static_cast<uint32_t>(binary->type());
|
||||
c_binary->interpreter = nullptr;
|
||||
if (binary->has_interpreter()) {
|
||||
const std::string& interp = binary->interpreter();
|
||||
@@ -48,15 +48,12 @@ void init_c_binary(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
reinterpret_cast<char*>(const_cast<char*>(c_binary->interpreter))[interp.size()] = '\0';
|
||||
}
|
||||
|
||||
|
||||
init_c_header(c_binary, binary);
|
||||
init_c_sections(c_binary, binary);
|
||||
init_c_segments(c_binary, binary);
|
||||
init_c_dynamic_symbols(c_binary, binary);
|
||||
init_c_static_symbols(c_binary, binary);
|
||||
init_c_symtab_symbols(c_binary, binary);
|
||||
init_c_dynamic_entries(c_binary, binary);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -81,9 +78,9 @@ Elf_Binary_t* elf_parse(const char *file) {
|
||||
int elf_binary_save_header(Elf_Binary_t* binary) {
|
||||
Header& hdr = reinterpret_cast<Binary*>(binary->handler)->header();
|
||||
|
||||
hdr.file_type(static_cast<LIEF::ELF::E_TYPE>(binary->header.file_type));
|
||||
hdr.machine_type(static_cast<LIEF::ELF::ARCH>(binary->header.machine_type));
|
||||
hdr.object_file_version(static_cast<LIEF::ELF::VERSION>(binary->header.object_file_version));
|
||||
hdr.file_type(LIEF::ELF::Header::FILE_TYPE(binary->header.file_type));
|
||||
hdr.machine_type(LIEF::ELF::ARCH(binary->header.machine_type));
|
||||
hdr.object_file_version(LIEF::ELF::Header::VERSION(binary->header.object_file_version));
|
||||
hdr.program_headers_offset(binary->header.program_headers_offset);
|
||||
hdr.section_headers_offset(binary->header.section_headers_offset);
|
||||
hdr.processor_flag(binary->header.processor_flags);
|
||||
@@ -104,7 +101,7 @@ void elf_binary_destroy(Elf_Binary_t* binary) {
|
||||
destroy_sections(binary);
|
||||
destroy_segments(binary);
|
||||
destroy_dynamic_symbols(binary);
|
||||
destroy_static_symbols(binary);
|
||||
destroy_symtab_symbols(binary);
|
||||
destroy_dynamic_entries(binary);
|
||||
|
||||
if (binary->interpreter != nullptr) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,44 +1,9 @@
|
||||
include_directories(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
target_sources(LIB_LIEF PRIVATE
|
||||
Symbol.cpp
|
||||
Section.cpp
|
||||
Segment.cpp
|
||||
DynamicEntry.cpp
|
||||
Header.cpp
|
||||
Binary.cpp
|
||||
utils.cpp
|
||||
)
|
||||
|
||||
set(LIEF_C_ELF_SRC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Symbol.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Segment.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DynamicEntry.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/utils.cpp"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_API_C_ELF_INCLUDE_FILES_CPP
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DynamicEntry.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Segment.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Symbol.hpp"
|
||||
)
|
||||
|
||||
set(LIEF_API_C_ELF_INCLUDE_FILES_C
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Binary.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/DynamicEntry.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/EnumToString.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Header.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Section.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Segment.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/Symbol.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/enums.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/ELF/utils.h"
|
||||
)
|
||||
|
||||
set(LIEF_C_ELF_INC "${LIEF_API_C_ELF_INCLUDE_FILES_C}" "${LIEF_API_C_ELF_INCLUDE_FILES_CPP}")
|
||||
|
||||
source_group("Source Files\\C API\\ELF" FILES ${LIEF_API_C_ELF_SRC})
|
||||
source_group("Header Files\\C API\\ELF" FILES ${LIEF_C_ELF_INC})
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}")
|
||||
|
||||
+30
-59
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,13 +34,12 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
for (size_t i = 0; i < dyn_entries.size(); ++i) {
|
||||
DynamicEntry& entry = dyn_entries[i];
|
||||
switch(entry.tag()) {
|
||||
case DYNAMIC_TAGS::DT_NEEDED:
|
||||
case DynamicEntry::TAG::NEEDED:
|
||||
{
|
||||
|
||||
auto* e = static_cast<Elf_DynamicEntry_Library_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Library_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->name = reinterpret_cast<DynamicEntryLibrary*>(&entry)->name().c_str();
|
||||
|
||||
@@ -48,12 +47,12 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_SONAME:
|
||||
case DynamicEntry::TAG::SONAME:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_SharedObject_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_SharedObject_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->name = reinterpret_cast<DynamicSharedObject*>(&entry)->name().c_str();
|
||||
|
||||
@@ -61,42 +60,42 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_RPATH:
|
||||
case DynamicEntry::TAG::RPATH:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_Rpath_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Rpath_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->rpath = reinterpret_cast<DynamicEntryRpath*>(&entry)->name().c_str();
|
||||
e->rpath = reinterpret_cast<DynamicEntryRpath*>(&entry)->rpath().c_str();
|
||||
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_RUNPATH:
|
||||
case DynamicEntry::TAG::RUNPATH:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_RunPath_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_RunPath_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->runpath = reinterpret_cast<DynamicEntryRunPath*>(&entry)->name().c_str();
|
||||
e->runpath = reinterpret_cast<DynamicEntryRunPath*>(&entry)->runpath().c_str();
|
||||
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_INIT_ARRAY:
|
||||
case DYNAMIC_TAGS::DT_FINI_ARRAY:
|
||||
case DYNAMIC_TAGS::DT_PREINIT_ARRAY:
|
||||
case DynamicEntry::TAG::INIT_ARRAY:
|
||||
case DynamicEntry::TAG::FINI_ARRAY:
|
||||
case DynamicEntry::TAG::PREINIT_ARRAY:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_Array_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Array_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const std::vector<uint64_t>& array = reinterpret_cast<DynamicEntryArray*>(&entry)->array();
|
||||
e->array = static_cast<uint64_t*>(malloc((array.size() + 1) * sizeof(uint64_t)));
|
||||
@@ -109,55 +108,33 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_FLAGS:
|
||||
case DynamicEntry::TAG::FLAGS:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_Flags_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Flags_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const DynamicEntryFlags::flags_list_t& flags = reinterpret_cast<DynamicEntryFlags*>(&entry)->flags();
|
||||
e->flags = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS*>(malloc((flags.size() + 1) * sizeof(enum LIEF_ELF_DYNAMIC_FLAGS)));
|
||||
e->flags_1 = nullptr;
|
||||
|
||||
auto it = std::begin(flags);
|
||||
|
||||
for (size_t i = 0; it != std::end(flags); ++i, ++it) {
|
||||
e->flags[i] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS>(*it);
|
||||
}
|
||||
|
||||
e->flags[flags.size()] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS>(0);
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_FLAGS_1:
|
||||
case DynamicEntry::TAG::FLAGS_1:
|
||||
{
|
||||
auto* e = static_cast<Elf_DynamicEntry_Flags_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Flags_t)));
|
||||
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<uint64_t>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const DynamicEntryFlags::flags_list_t& flags = reinterpret_cast<DynamicEntryFlags*>(&entry)->flags();
|
||||
e->flags_1 = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS_1*>(malloc((flags.size() + 1) * sizeof(enum LIEF_ELF_DYNAMIC_FLAGS_1)));
|
||||
e->flags = nullptr;
|
||||
|
||||
auto it = std::begin(flags);
|
||||
|
||||
for (size_t i = 0; it != std::end(flags); ++i, ++it) {
|
||||
e->flags_1[i] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS_1>(*it);
|
||||
}
|
||||
|
||||
e->flags_1[flags.size()] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS_1>(0);
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
{
|
||||
c_binary->dynamic_entries[i] =
|
||||
@@ -170,7 +147,6 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
}
|
||||
|
||||
c_binary->dynamic_entries[dyn_entries.size()] = nullptr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -179,34 +155,34 @@ void destroy_dynamic_entries(Elf_Binary_t* c_binary) {
|
||||
|
||||
Elf_DynamicEntry_t **dynamic_entries = c_binary->dynamic_entries;
|
||||
for (size_t idx = 0; dynamic_entries[idx] != nullptr; ++idx) {
|
||||
switch(static_cast<DYNAMIC_TAGS>(dynamic_entries[idx]->tag)) {
|
||||
case DYNAMIC_TAGS::DT_NEEDED:
|
||||
switch(DynamicEntry::TAG(dynamic_entries[idx]->tag)) {
|
||||
case DynamicEntry::TAG::NEEDED:
|
||||
{
|
||||
free(reinterpret_cast<Elf_DynamicEntry_Library_t*>(dynamic_entries[idx]));
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_SONAME:
|
||||
case DynamicEntry::TAG::SONAME:
|
||||
{
|
||||
free(reinterpret_cast<Elf_DynamicEntry_SharedObject_t*>(dynamic_entries[idx]));
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_RPATH:
|
||||
case DynamicEntry::TAG::RPATH:
|
||||
{
|
||||
free(reinterpret_cast<Elf_DynamicEntry_Rpath_t*>(dynamic_entries[idx]));
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_RUNPATH:
|
||||
case DynamicEntry::TAG::RUNPATH:
|
||||
{
|
||||
free(reinterpret_cast<Elf_DynamicEntry_RunPath_t*>(dynamic_entries[idx]));
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_INIT_ARRAY:
|
||||
case DYNAMIC_TAGS::DT_FINI_ARRAY:
|
||||
case DYNAMIC_TAGS::DT_PREINIT_ARRAY:
|
||||
case DynamicEntry::TAG::INIT_ARRAY:
|
||||
case DynamicEntry::TAG::FINI_ARRAY:
|
||||
case DynamicEntry::TAG::PREINIT_ARRAY:
|
||||
{
|
||||
Elf_DynamicEntry_Array_t* entry_array=reinterpret_cast<Elf_DynamicEntry_Array_t*>(dynamic_entries[idx]);
|
||||
free(entry_array->array);
|
||||
@@ -214,24 +190,21 @@ void destroy_dynamic_entries(Elf_Binary_t* c_binary) {
|
||||
break;
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_FLAGS:
|
||||
case DynamicEntry::TAG::FLAGS:
|
||||
{
|
||||
Elf_DynamicEntry_Flags_t* entry_flags=reinterpret_cast<Elf_DynamicEntry_Flags_t*>(dynamic_entries[idx]);
|
||||
free(entry_flags->flags);
|
||||
free(entry_flags);
|
||||
break;
|
||||
}
|
||||
case DYNAMIC_TAGS::DT_FLAGS_1:
|
||||
case DynamicEntry::TAG::FLAGS_1:
|
||||
{
|
||||
Elf_DynamicEntry_Flags_t* entry_flags=reinterpret_cast<Elf_DynamicEntry_Flags_t*>(dynamic_entries[idx]);
|
||||
free(entry_flags->flags_1);
|
||||
free(entry_flags);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
free(dynamic_entries[idx]);
|
||||
}
|
||||
|
||||
@@ -244,5 +217,3 @@ void destroy_dynamic_entries(Elf_Binary_t* c_binary) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "LIEF/ELF/EnumToString.h"
|
||||
#include "LIEF/ELF/EnumToString.hpp"
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
#include "LIEF/ELF/enums.hpp"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
const char* E_TYPE_to_string(enum LIEF_ELF_E_TYPE e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::E_TYPE>(e));
|
||||
}
|
||||
|
||||
const char* SYMBOL_BINDINGS_to_string(enum LIEF_ELF_SYMBOL_BINDINGS e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::SYMBOL_BINDINGS>(e));
|
||||
}
|
||||
|
||||
const char* VERSION_to_string(enum LIEF_ELF_VERSION e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::VERSION>(e));
|
||||
}
|
||||
|
||||
const char* ARCH_to_string(enum LIEF_ELF_ARCH e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ARCH>(e));
|
||||
}
|
||||
|
||||
const char* SEGMENT_TYPES_to_string(enum LIEF_ELF_SEGMENT_TYPES e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::SEGMENT_TYPES>(e));
|
||||
}
|
||||
|
||||
const char* DYNAMIC_TAGS_to_string(enum LIEF_ELF_DYNAMIC_TAGS e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::DYNAMIC_TAGS>(e));
|
||||
}
|
||||
|
||||
const char* ELF_SECTION_TYPES_to_string(enum LIEF_ELF_ELF_SECTION_TYPES e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ELF_SECTION_TYPES>(e));
|
||||
}
|
||||
|
||||
const char* ELF_SECTION_FLAGS_to_string(enum LIEF_ELF_ELF_SECTION_FLAGS e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ELF_SECTION_FLAGS>(e));
|
||||
}
|
||||
|
||||
const char* ELF_SYMBOL_TYPES_to_string(enum LIEF_ELF_ELF_SYMBOL_TYPES e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ELF_SYMBOL_TYPES>(e));
|
||||
}
|
||||
|
||||
const char* ELF_CLASS_to_string(enum LIEF_ELF_ELF_CLASS e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ELF_CLASS>(e));
|
||||
}
|
||||
|
||||
const char* ELF_DATA_to_string(enum LIEF_ELF_ELF_DATA e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::ELF_DATA>(e));
|
||||
}
|
||||
|
||||
const char* OS_ABI_to_string(enum LIEF_ELF_OS_ABI e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::OS_ABI>(e));
|
||||
}
|
||||
|
||||
const char* DYNAMIC_FLAGS_to_string(enum LIEF_ELF_DYNAMIC_FLAGS e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::DYNAMIC_FLAGS>(e));
|
||||
}
|
||||
|
||||
const char* DYNAMIC_FLAGS_1_to_string(enum LIEF_ELF_DYNAMIC_FLAGS_1 e) {
|
||||
return LIEF::ELF::to_string(static_cast<LIEF::ELF::DYNAMIC_FLAGS_1>(e));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,9 +21,9 @@ namespace ELF {
|
||||
void init_c_header(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
const Header& hdr = binary->header();
|
||||
c_binary->header.file_type = static_cast<enum LIEF_ELF_E_TYPE>(hdr.file_type());
|
||||
c_binary->header.machine_type = static_cast<enum LIEF_ELF_ARCH>(hdr.machine_type());
|
||||
c_binary->header.object_file_version = static_cast<enum LIEF_ELF_VERSION>(hdr.object_file_version());
|
||||
c_binary->header.file_type = static_cast<uint32_t>(hdr.file_type());
|
||||
c_binary->header.machine_type = static_cast<uint32_t>(hdr.machine_type());
|
||||
c_binary->header.object_file_version = static_cast<uint32_t>(hdr.object_file_version());
|
||||
c_binary->header.program_headers_offset = hdr.program_headers_offset();
|
||||
c_binary->header.section_headers_offset = hdr.section_headers_offset();
|
||||
c_binary->header.processor_flags = hdr.processor_flag();
|
||||
@@ -35,10 +35,7 @@ void init_c_header(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->header.name_string_table_idx = hdr.section_name_table_idx();
|
||||
c_binary->header.entrypoint = hdr.entrypoint();
|
||||
const Header::identity_t& ident = hdr.identity();
|
||||
std::copy(
|
||||
std::begin(ident),
|
||||
std::end(ident),
|
||||
c_binary->header.identity);
|
||||
std::copy(std::begin(ident), std::end(ident), c_binary->header.identity);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,7 +31,7 @@ void init_c_sections(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
c_binary->sections[i]->name = b_section.fullname().c_str();
|
||||
c_binary->sections[i]->flags = b_section.flags();
|
||||
c_binary->sections[i]->type = static_cast<enum LIEF_ELF_ELF_SECTION_TYPES>(b_section.type());
|
||||
c_binary->sections[i]->type = static_cast<uint32_t>(b_section.type());
|
||||
c_binary->sections[i]->virtual_address = b_section.virtual_address();
|
||||
c_binary->sections[i]->offset = b_section.file_offset();
|
||||
c_binary->sections[i]->original_size = b_section.original_size();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,7 +29,7 @@ void init_c_segments(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
span<const uint8_t> segment_content = segment.content();
|
||||
|
||||
c_binary->segments[i] = static_cast<Elf_Segment_t*>(malloc(sizeof(Elf_Segment_t)));
|
||||
c_binary->segments[i]->type = static_cast<enum LIEF_ELF_SEGMENT_TYPES>(segment.type());
|
||||
c_binary->segments[i]->type = static_cast<uint32_t>(segment.type());
|
||||
c_binary->segments[i]->flags = static_cast<uint32_t>(segment.flags());
|
||||
c_binary->segments[i]->virtual_address = segment.virtual_address();
|
||||
c_binary->segments[i]->virtual_size = segment.virtual_size();
|
||||
@@ -44,10 +44,7 @@ void init_c_segments(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void destroy_segments(Elf_Binary_t* c_binary) {
|
||||
|
||||
Elf_Segment_t **segments = c_binary->segments;
|
||||
for (size_t idx = 0; segments[idx] != nullptr; ++idx) {
|
||||
free(segments[idx]);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+24
-26
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,8 +28,8 @@ void init_c_dynamic_symbols(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Symbol& b_sym = dyn_symb[i];
|
||||
c_binary->dynamic_symbols[i] = static_cast<Elf_Symbol_t*>(malloc(sizeof(Elf_Symbol_t)));
|
||||
c_binary->dynamic_symbols[i]->name = b_sym.name().c_str();
|
||||
c_binary->dynamic_symbols[i]->type = static_cast<enum LIEF_ELF_ELF_SYMBOL_TYPES>(b_sym.type());
|
||||
c_binary->dynamic_symbols[i]->binding = static_cast<enum LIEF_ELF_SYMBOL_BINDINGS>(b_sym.binding());
|
||||
c_binary->dynamic_symbols[i]->type = static_cast<uint32_t>(b_sym.type());
|
||||
c_binary->dynamic_symbols[i]->binding = static_cast<uint32_t>(b_sym.binding());
|
||||
c_binary->dynamic_symbols[i]->other = b_sym.other();
|
||||
c_binary->dynamic_symbols[i]->shndx = b_sym.shndx();
|
||||
c_binary->dynamic_symbols[i]->value = b_sym.value();
|
||||
@@ -40,32 +40,30 @@ void init_c_dynamic_symbols(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
}
|
||||
c_binary->dynamic_symbols[dyn_symb.size()] = nullptr;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void init_c_static_symbols(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Binary::it_static_symbols static_symb = binary->static_symbols();
|
||||
void init_c_symtab_symbols(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Binary::it_symtab_symbols static_symb = binary->symtab_symbols();
|
||||
|
||||
c_binary->static_symbols = static_cast<Elf_Symbol_t**>(
|
||||
c_binary->symtab_symbols = static_cast<Elf_Symbol_t**>(
|
||||
malloc((static_symb.size() + 1) * sizeof(Elf_Symbol_t**)));
|
||||
|
||||
for (size_t i = 0; i < static_symb.size(); ++i) {
|
||||
Symbol& b_sym = static_symb[i];
|
||||
c_binary->static_symbols[i] = static_cast<Elf_Symbol_t*>(malloc(sizeof(Elf_Symbol_t)));
|
||||
c_binary->static_symbols[i]->name = b_sym.name().c_str();
|
||||
c_binary->static_symbols[i]->type = static_cast<enum LIEF_ELF_ELF_SYMBOL_TYPES>(b_sym.type());
|
||||
c_binary->static_symbols[i]->binding = static_cast<enum LIEF_ELF_SYMBOL_BINDINGS>(b_sym.binding());
|
||||
c_binary->static_symbols[i]->other = b_sym.other();
|
||||
c_binary->static_symbols[i]->shndx = b_sym.shndx();
|
||||
c_binary->static_symbols[i]->value = b_sym.value();
|
||||
c_binary->static_symbols[i]->size = b_sym.size();
|
||||
c_binary->static_symbols[i]->information = b_sym.information();
|
||||
c_binary->static_symbols[i]->is_exported = b_sym.is_exported();
|
||||
c_binary->static_symbols[i]->is_imported = b_sym.is_imported();
|
||||
c_binary->symtab_symbols[i] = static_cast<Elf_Symbol_t*>(malloc(sizeof(Elf_Symbol_t)));
|
||||
c_binary->symtab_symbols[i]->name = b_sym.name().c_str();
|
||||
c_binary->symtab_symbols[i]->type = static_cast<uint32_t>(b_sym.type());
|
||||
c_binary->symtab_symbols[i]->binding = static_cast<uint32_t>(b_sym.binding());
|
||||
c_binary->symtab_symbols[i]->other = b_sym.other();
|
||||
c_binary->symtab_symbols[i]->shndx = b_sym.shndx();
|
||||
c_binary->symtab_symbols[i]->value = b_sym.value();
|
||||
c_binary->symtab_symbols[i]->size = b_sym.size();
|
||||
c_binary->symtab_symbols[i]->information = b_sym.information();
|
||||
c_binary->symtab_symbols[i]->is_exported = b_sym.is_exported();
|
||||
c_binary->symtab_symbols[i]->is_imported = b_sym.is_imported();
|
||||
}
|
||||
c_binary->static_symbols[static_symb.size()] = nullptr;
|
||||
c_binary->symtab_symbols[static_symb.size()] = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -80,12 +78,12 @@ void destroy_dynamic_symbols(Elf_Binary_t* c_binary) {
|
||||
}
|
||||
|
||||
|
||||
void destroy_static_symbols(Elf_Binary_t* c_binary) {
|
||||
Elf_Symbol_t **static_symbols = c_binary->static_symbols;
|
||||
for (size_t idx = 0; static_symbols[idx] != nullptr; ++idx) {
|
||||
free(static_symbols[idx]);
|
||||
void destroy_symtab_symbols(Elf_Binary_t* c_binary) {
|
||||
Elf_Symbol_t **symtab_symbols = c_binary->symtab_symbols;
|
||||
for (size_t idx = 0; symtab_symbols[idx] != nullptr; ++idx) {
|
||||
free(symtab_symbols[idx]);
|
||||
}
|
||||
free(c_binary->static_symbols);
|
||||
free(c_binary->symtab_symbols);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,10 +26,10 @@ namespace LIEF {
|
||||
namespace ELF {
|
||||
|
||||
void init_c_dynamic_symbols(Elf_Binary_t* c_binary, Binary* binary);
|
||||
void init_c_static_symbols(Elf_Binary_t* c_binary, Binary* binary);
|
||||
void init_c_symtab_symbols(Elf_Binary_t* c_binary, Binary* binary);
|
||||
|
||||
void destroy_dynamic_symbols(Elf_Binary_t* c_binary);
|
||||
void destroy_static_symbols(Elf_Binary_t* c_binary);
|
||||
void destroy_symtab_symbols(Elf_Binary_t* c_binary);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,7 +16,7 @@
|
||||
#include "LIEF/ELF/utils.hpp"
|
||||
#include "LIEF/ELF/utils.h"
|
||||
|
||||
bool is_elf(const char* file) {
|
||||
uint8_t is_elf(const char* file) {
|
||||
return LIEF::ELF::is_elf(file);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,45 +1,9 @@
|
||||
include_directories(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
target_sources(LIB_LIEF PRIVATE
|
||||
Parser.cpp
|
||||
LoadCommand.cpp
|
||||
Segment.cpp
|
||||
Symbol.cpp
|
||||
Section.cpp
|
||||
Header.cpp
|
||||
Binary.cpp
|
||||
)
|
||||
|
||||
set(LIEF_API_C_MACHO_SRC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Parser.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/LoadCommand.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Segment.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Symbol.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_API_C_MACHO_INCLUDE_FILES_CPP
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/LoadCommand.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Segment.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Symbol.hpp"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_API_C_MACHO_INCLUDE_FILES_C
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/enums.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Binary.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/EnumToString.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Header.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/LoadCommand.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Section.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Segment.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/MachO/Symbol.h"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_C_MACHO_INC "${LIEF_API_C_MACHO_INCLUDE_FILES_C}" "${LIEF_API_C_MACHO_INCLUDE_FILES_CPP}")
|
||||
|
||||
source_group("Source Files\\C API\\MachO" FILES ${LIEF_API_C_MACHO_SRC})
|
||||
source_group("Header Files\\C API\\MachO" FILES ${LIEF_C_MACHO_INC})
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC})
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "LIEF/MachO/EnumToString.h"
|
||||
#include "LIEF/MachO/EnumToString.hpp"
|
||||
|
||||
#include "LIEF/MachO/enums.hpp"
|
||||
#include "LIEF/MachO/enums.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
const char* LOAD_COMMAND_TYPES_to_string(enum LIEF_MACHO_LOAD_COMMAND_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::LOAD_COMMAND_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* MACHO_TYPES_to_string(enum LIEF_MACHO_MACHO_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::MACHO_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* FILE_TYPES_to_string(enum LIEF_MACHO_FILE_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::FILE_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* CPU_TYPES_to_string(enum LIEF_MACHO_CPU_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::CPU_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* HEADER_FLAGS_to_string(enum LIEF_MACHO_HEADER_FLAGS e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::HEADER_FLAGS>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* MACHO_SECTION_TYPES_to_string(enum LIEF_MACHO_MACHO_SECTION_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::MACHO_SECTION_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* MACHO_SYMBOL_TYPES_to_string(enum LIEF_MACHO_MACHO_SYMBOL_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::MACHO_SYMBOL_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* N_LIST_TYPES_to_string(enum LIEF_MACHO_N_LIST_TYPES e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::N_LIST_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* SYMBOL_DESCRIPTIONS_to_string(enum LIEF_MACHO_SYMBOL_DESCRIPTIONS e) {
|
||||
return LIEF::MachO::to_string(static_cast<LIEF::MachO::SYMBOL_DESCRIPTIONS>(e));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ void init_c_commands(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
LoadCommand& cmd = commands[i];
|
||||
|
||||
c_binary->commands[i] = static_cast<Macho_Command_t*>(malloc(sizeof(Macho_Command_t)));
|
||||
const std::vector<uint8_t>& cmd_content = cmd.data();
|
||||
const span<const uint8_t> cmd_content = cmd.data();
|
||||
auto* content = static_cast<uint8_t*>(malloc(cmd_content.size() * sizeof(uint8_t)));
|
||||
std::copy(
|
||||
std::begin(cmd_content),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -36,7 +36,7 @@ void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->sections[i]->alignment = section.alignment();
|
||||
c_binary->sections[i]->relocation_offset = section.relocation_offset();
|
||||
c_binary->sections[i]->numberof_relocations = section.numberof_relocations();
|
||||
c_binary->sections[i]->flags = section.flags();
|
||||
c_binary->sections[i]->flags = section.raw_flags();
|
||||
c_binary->sections[i]->type = static_cast<enum LIEF_MACHO_MACHO_SECTION_TYPES>(section.type());
|
||||
c_binary->sections[i]->reserved1 = section.reserved1();
|
||||
c_binary->sections[i]->reserved2 = section.reserved2();
|
||||
@@ -53,7 +53,6 @@ void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
void destroy_sections(Macho_Binary_t* c_binary) {
|
||||
Macho_Section_t **sections = c_binary->sections;
|
||||
for (size_t idx = 0; sections[idx] != nullptr; ++idx) {
|
||||
@@ -67,4 +66,3 @@ void destroy_sections(Macho_Binary_t* c_binary) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,7 +29,7 @@ void init_c_symbols(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->symbols[i] = static_cast<Macho_Symbol_t*>(malloc(sizeof(Macho_Symbol_t)));
|
||||
|
||||
c_binary->symbols[i]->name = symbol.name().c_str();
|
||||
c_binary->symbols[i]->type = symbol.type();
|
||||
c_binary->symbols[i]->type = symbol.raw_type();
|
||||
c_binary->symbols[i]->numberof_sections = symbol.numberof_sections();
|
||||
c_binary->symbols[i]->description = symbol.description();
|
||||
c_binary->symbols[i]->value = symbol.value();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+9
-47
@@ -1,48 +1,10 @@
|
||||
include_directories(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/LIEF"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||
target_sources(LIB_LIEF PRIVATE
|
||||
Binary.cpp
|
||||
DosHeader.cpp
|
||||
Header.cpp
|
||||
OptionalHeader.cpp
|
||||
Section.cpp
|
||||
DataDirectory.cpp
|
||||
Import.cpp
|
||||
ImportEntry.cpp
|
||||
)
|
||||
set(LIEF_API_C_PE_SRC
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DosHeader.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/OptionalHeader.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataDirectory.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/EnumToString.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Import.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ImportEntry.cpp"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_API_C_PE_INCLUDE_FILES_CPP
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Binary.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DataDirectory.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/DosHeader.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Header.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/OptionalHeader.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Section.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Import.hpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ImportEntry.hpp"
|
||||
)
|
||||
|
||||
set(LIEF_API_C_PE_INCLUDE_FILES_C
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/enums.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Binary.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/DataDirectory.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/DosHeader.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/EnumToString.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Header.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/OptionalHeader.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Section.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/Import.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/api/c/include/LIEF/PE/ImportEntry.h"
|
||||
)
|
||||
|
||||
|
||||
set(LIEF_C_PE_INC "${LIEF_API_C_PE_INCLUDE_FILES_C}" "${LIEF_API_C_PE_INCLUDE_FILES_CPP}")
|
||||
|
||||
source_group("Source Files\\C API\\PE" FILES ${LIEF_API_C_PE_SRC})
|
||||
source_group("Header Files\\C API\\PE" FILES ${LIEF_C_PE_INC})
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,8 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef LIEF_PE_DATA_DIRECTORY_CPP_C_API_
|
||||
#define LIEF_PE_DATA_DIRECTORY_CPP_C_API_
|
||||
#ifndef LIEF_PE_DATA_DIRECTORY_CPP_C_API
|
||||
#define LIEF_PE_DATA_DIRECTORY_CPP_C_API
|
||||
|
||||
#include "LIEF/PE/Binary.h"
|
||||
#include "LIEF/PE/Binary.hpp"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,7 +20,7 @@ namespace PE {
|
||||
void init_c_dos_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
const DosHeader& dos_header = binary->dos_header();
|
||||
c_binary->dos_header.magic = dos_header.magic();
|
||||
c_binary->dos_header.used_bytes_in_the_last_page = dos_header.used_bytes_in_the_last_page();
|
||||
c_binary->dos_header.used_bytes_in_last_page = dos_header.used_bytes_in_last_page();
|
||||
c_binary->dos_header.file_size_in_pages = dos_header.file_size_in_pages();
|
||||
c_binary->dos_header.numberof_relocation = dos_header.numberof_relocation();
|
||||
c_binary->dos_header.header_size_in_paragraphs = dos_header.header_size_in_paragraphs();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,21 +20,10 @@
|
||||
#include "LIEF/PE/enums.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
|
||||
const char* PE_TYPES_to_string(enum LIEF_PE_PE_TYPES e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::PE_TYPE>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* MACHINE_TYPES_to_string(enum LIEF_PE_MACHINE_TYPES e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::MACHINE_TYPES>(e));
|
||||
}
|
||||
|
||||
|
||||
const char* SUBSYSTEM_to_string(enum LIEF_PE_SUBSYSTEM e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::SUBSYSTEM>(e));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+13
-6
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,11 +32,18 @@ void init_c_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->header.sizeof_optional_header = header.sizeof_optional_header();
|
||||
c_binary->header.characteristics = static_cast<uint16_t>(header.characteristics());
|
||||
|
||||
std::copy(
|
||||
std::begin(signature),
|
||||
std::end(signature),
|
||||
c_binary->header.signature);
|
||||
std::copy(std::begin(signature), std::end(signature),
|
||||
c_binary->header.signature);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const char* lief_pe_header_machine_str(enum LIEF_PE_MACHINE_TYPES e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::Header::MACHINE_TYPES>(e));
|
||||
}
|
||||
|
||||
const char* lief_pe_header_characteristics_str(enum LIEF_PE_HEADER_CHARACTERISTICS e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::Header::CHARACTERISTICS>(e));
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include "OptionalHeader.hpp"
|
||||
#include "LIEF/PE/OptionalHeader.h"
|
||||
|
||||
namespace LIEF {
|
||||
namespace PE {
|
||||
@@ -21,7 +22,7 @@ namespace PE {
|
||||
void init_c_optional_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
const OptionalHeader& optional_header = binary->optional_header();
|
||||
c_binary->optional_header.magic = static_cast<enum LIEF_PE_PE_TYPES>(optional_header.magic());
|
||||
c_binary->optional_header.magic = static_cast<uint16_t>(optional_header.magic());
|
||||
c_binary->optional_header.major_linker_version = optional_header.major_linker_version();
|
||||
c_binary->optional_header.minor_linker_version = optional_header.minor_linker_version();
|
||||
c_binary->optional_header.sizeof_code = optional_header.sizeof_code();
|
||||
@@ -59,3 +60,8 @@ void init_c_optional_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const char* lief_pe_subsytem_str(enum LIEF_PE_SUBSYSTEM e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::OptionalHeader::SUBSYSTEM>(e));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,13 +16,11 @@
|
||||
#ifndef C_LIEF_ELF_H_
|
||||
#define C_LIEF_ELF_H_
|
||||
|
||||
/** @defgroup elf_c_api ELF C API */
|
||||
|
||||
#include "LIEF/ELF/Binary.h"
|
||||
#include "LIEF/ELF/Symbol.h"
|
||||
#include "LIEF/ELF/Section.h"
|
||||
#include "LIEF/ELF/Header.h"
|
||||
#include "LIEF/ELF/DynamicEntry.h"
|
||||
#include "LIEF/ELF/EnumToString.h"
|
||||
#include "LIEF/ELF/utils.h"
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,16 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_BINARY_H_
|
||||
#define C_LIEF_ELF_BINARY_H_
|
||||
|
||||
/** @defgroup elf_binary_c_api Binary
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_binary_c_api
|
||||
* @brief Binary C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifndef LIEF_C_ELF_BINARY_H
|
||||
#define LIEF_C_ELF_BINARY_H
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -40,40 +32,31 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/** @brief LIEF::ELF::Binary C Handler */
|
||||
/** LIEF::ELF::Binary C Handler */
|
||||
struct Elf_Binary_t {
|
||||
void* handler;
|
||||
const char* name;
|
||||
const char* interpreter;
|
||||
enum LIEF_ELF_ELF_CLASS type;
|
||||
uint32_t type;
|
||||
Elf_Header_t header;
|
||||
Elf_Section_t **sections;
|
||||
Elf_Segment_t **segments;
|
||||
Elf_DynamicEntry_t **dynamic_entries;
|
||||
Elf_Symbol_t **dynamic_symbols;
|
||||
Elf_Symbol_t **static_symbols;
|
||||
Elf_Symbol_t **symtab_symbols;
|
||||
};
|
||||
|
||||
typedef struct Elf_Binary_t Elf_Binary_t;
|
||||
|
||||
/** @brief Wrapper for LIEF::ELF::Parser::parse */
|
||||
/** Wrapper for LIEF::ELF::Parser::parse */
|
||||
LIEF_API Elf_Binary_t* elf_parse(const char *file);
|
||||
|
||||
LIEF_API void elf_binary_destroy(Elf_Binary_t* binary);
|
||||
|
||||
/* ELF::Binary methods
|
||||
* ==================
|
||||
*/
|
||||
|
||||
/** @brief Update LIEF::ELF::Header object */
|
||||
/** Update LIEF::ELF::Header object */
|
||||
LIEF_API int elf_binary_save_header(Elf_Binary_t* binary);
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,22 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_DYNAMIC_ENTRY_H_
|
||||
#define C_LIEF_ELF_DYNAMIC_ENTRY_H_
|
||||
#ifndef LIEF_C_ELF_DYNAMIC_ENTRY_H
|
||||
#define LIEF_C_ELF_DYNAMIC_ENTRY_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
|
||||
/** @defgroup elf_dynamic_entry_c_api Dynamic Entry
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_dynamic_entry_c_api
|
||||
* @brief Dynamic Entry C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -68,12 +57,9 @@ struct Elf_DynamicEntry_RunPath_t {
|
||||
const char* runpath;
|
||||
};
|
||||
|
||||
|
||||
struct Elf_DynamicEntry_Flags_t {
|
||||
uint64_t tag;
|
||||
uint64_t value;
|
||||
enum LIEF_ELF_DYNAMIC_FLAGS *flags;
|
||||
enum LIEF_ELF_DYNAMIC_FLAGS_1 *flags_1;
|
||||
};
|
||||
|
||||
typedef struct Elf_DynamicEntry_t Elf_DynamicEntry_t;
|
||||
@@ -88,5 +74,4 @@ typedef struct Elf_DynamicEntry_Flags_t Elf_DynamicEntry_Flags_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_ENUM_TO_STRING_H_
|
||||
#define C_LIEF_ELF_ENUM_TO_STRING_H_
|
||||
|
||||
#include "LIEF/visibility.h"
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
LIEF_API const char* SYMBOL_BINDINGS_to_string(enum LIEF_ELF_SYMBOL_BINDINGS e);
|
||||
LIEF_API const char* E_TYPE_to_string(enum LIEF_ELF_E_TYPE e);
|
||||
LIEF_API const char* VERSION_to_string(enum LIEF_ELF_VERSION e);
|
||||
LIEF_API const char* ARCH_to_string(enum LIEF_ELF_ARCH e);
|
||||
LIEF_API const char* SEGMENT_TYPES_to_string(enum LIEF_ELF_SEGMENT_TYPES e);
|
||||
LIEF_API const char* DYNAMIC_TAGS_to_string(enum LIEF_ELF_DYNAMIC_TAGS e);
|
||||
LIEF_API const char* ELF_SECTION_TYPES_to_string(enum LIEF_ELF_ELF_SECTION_TYPES e);
|
||||
LIEF_API const char* ELF_SECTION_FLAGS_to_string(enum LIEF_ELF_ELF_SECTION_FLAGS e);
|
||||
LIEF_API const char* ELF_SYMBOL_TYPES_to_string(enum LIEF_ELF_ELF_SYMBOL_TYPES e);
|
||||
LIEF_API const char* ELF_CLASS_to_string(enum LIEF_ELF_ELF_CLASS e);
|
||||
LIEF_API const char* ELF_DATA_to_string(enum LIEF_ELF_ELF_DATA e);
|
||||
LIEF_API const char* OS_ABI_to_string(enum LIEF_ELF_OS_ABI e);
|
||||
LIEF_API const char* DYNAMIC_FLAGS_to_string(enum LIEF_ELF_DYNAMIC_FLAGS e);
|
||||
LIEF_API const char* DYNAMIC_FLAGS_1_to_string(enum LIEF_ELF_DYNAMIC_FLAGS_1 e);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,38 +13,31 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_HEADER_H_
|
||||
#define C_LIEF_ELF_HEADER_H_
|
||||
#ifndef LIEF_C_ELF_HEADER_H
|
||||
#define LIEF_C_ELF_HEADER_H
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
/** @defgroup elf_header_c_api Header
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_header_c_api
|
||||
* @brief Header C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Header_t {
|
||||
uint8_t identity[LIEF_ELF_EI_NIDENT];
|
||||
enum LIEF_ELF_E_TYPE file_type;
|
||||
enum LIEF_ELF_ARCH machine_type;
|
||||
enum LIEF_ELF_VERSION object_file_version;
|
||||
uint64_t entrypoint;
|
||||
uint64_t program_headers_offset;
|
||||
uint64_t section_headers_offset;
|
||||
uint32_t processor_flags;
|
||||
uint32_t header_size;
|
||||
uint32_t program_header_size;
|
||||
uint32_t numberof_segments;
|
||||
uint32_t section_header_size;
|
||||
uint32_t numberof_sections;
|
||||
uint32_t name_string_table_idx;
|
||||
uint8_t identity[LIEF_EI_NIDENT];
|
||||
uint32_t file_type;
|
||||
uint32_t machine_type;
|
||||
uint32_t object_file_version;
|
||||
uint64_t entrypoint;
|
||||
uint64_t program_headers_offset;
|
||||
uint64_t section_headers_offset;
|
||||
uint32_t processor_flags;
|
||||
uint32_t header_size;
|
||||
uint32_t program_header_size;
|
||||
uint32_t numberof_segments;
|
||||
uint32_t section_header_size;
|
||||
uint32_t numberof_sections;
|
||||
uint32_t name_string_table_idx;
|
||||
};
|
||||
|
||||
typedef struct Elf_Header_t Elf_Header_t;
|
||||
@@ -54,5 +47,4 @@ typedef struct Elf_Header_t Elf_Header_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,39 +13,29 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_SECTION_H_
|
||||
#define C_LIEF_ELF_SECTION_H_
|
||||
#ifndef LIEF_C_ELF_SECTION_H
|
||||
#define LIEF_C_ELF_SECTION_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
|
||||
/** @defgroup elf_section_c_api Section
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_section_c_api
|
||||
* @brief Section C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Section_t {
|
||||
const char* name;
|
||||
uint32_t flags;
|
||||
enum LIEF_ELF_ELF_SECTION_TYPES type;
|
||||
uint64_t virtual_address;
|
||||
uint64_t offset;
|
||||
uint64_t original_size;
|
||||
uint32_t link;
|
||||
uint32_t info;
|
||||
uint64_t alignment;
|
||||
uint64_t entry_size;
|
||||
uint64_t size;
|
||||
uint8_t* content;
|
||||
double entropy;
|
||||
const char* name;
|
||||
uint32_t flags;
|
||||
uint32_t type;
|
||||
uint64_t virtual_address;
|
||||
uint64_t offset;
|
||||
uint64_t original_size;
|
||||
uint32_t link;
|
||||
uint32_t info;
|
||||
uint64_t alignment;
|
||||
uint64_t entry_size;
|
||||
uint64_t size;
|
||||
uint8_t* content;
|
||||
double entropy;
|
||||
};
|
||||
|
||||
typedef struct Elf_Section_t Elf_Section_t;
|
||||
@@ -54,5 +44,4 @@ typedef struct Elf_Section_t Elf_Section_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,33 +13,25 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_SEGMENT_H_
|
||||
#define C_LIEF_ELF_SEGMENT_H_
|
||||
#ifndef LIEF_C_ELF_SEGMENT_H_
|
||||
#define LIEF_C_ELF_SEGMENT_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "LIEF/ELF/enums.h"
|
||||
|
||||
/** @defgroup elf_segment_c_api Segment
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_segment_c_api
|
||||
* @brief Segment C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Segment_t {
|
||||
enum LIEF_ELF_SEGMENT_TYPES type;
|
||||
uint32_t flags;
|
||||
uint64_t virtual_address;
|
||||
uint64_t virtual_size;
|
||||
uint64_t offset;
|
||||
uint64_t alignment;
|
||||
uint64_t size;
|
||||
uint8_t* content;
|
||||
uint32_t type;
|
||||
uint32_t flags;
|
||||
uint64_t virtual_address;
|
||||
uint64_t virtual_size;
|
||||
uint64_t offset;
|
||||
uint64_t alignment;
|
||||
uint64_t size;
|
||||
uint8_t* content;
|
||||
};
|
||||
|
||||
typedef struct Elf_Segment_t Elf_Segment_t;
|
||||
@@ -48,5 +40,4 @@ typedef struct Elf_Segment_t Elf_Segment_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,36 +13,27 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_SYMBOL_H_
|
||||
#define C_LIEF_ELF_SYMBOL_H_
|
||||
#ifndef LIEF_C_ELF_SYMBOL_H
|
||||
#define LIEF_C_ELF_SYMBOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
#include "LIEF/types.h"
|
||||
/** @defgroup elf_symbol_c_api Symbol
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_symbol_c_api
|
||||
* @brief Symbol C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Symbol_t {
|
||||
const char* name;
|
||||
enum LIEF_ELF_ELF_SYMBOL_TYPES type;
|
||||
enum LIEF_ELF_SYMBOL_BINDINGS binding;
|
||||
uint8_t information;
|
||||
uint8_t other;
|
||||
uint16_t shndx;
|
||||
uint64_t value;
|
||||
uint64_t size;
|
||||
bool is_exported; /**< Whether or not the symbol is exported */
|
||||
bool is_imported; /**< Whether or not the symbol is imported */
|
||||
const char* name;
|
||||
uint32_t type;
|
||||
uint32_t binding;
|
||||
uint8_t information;
|
||||
uint8_t other;
|
||||
uint16_t shndx;
|
||||
uint64_t value;
|
||||
uint64_t size;
|
||||
uint8_t is_exported; /**< Whether or not the symbol is exported */
|
||||
uint8_t is_imported; /**< Whether or not the symbol is imported */
|
||||
};
|
||||
|
||||
typedef struct Elf_Symbol_t Elf_Symbol_t;
|
||||
@@ -51,5 +42,4 @@ typedef struct Elf_Symbol_t Elf_Symbol_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
+1003
-8
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,18 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_ELF_UTILS_H_
|
||||
#define C_LIEF_ELF_UTILS_H_
|
||||
|
||||
/** @defgroup elf_utils_c_api Utils
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_utils_c_api
|
||||
* @brief Utils C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifndef LIEF_C_ELF_UTILS_H
|
||||
#define LIEF_C_ELF_UTILS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "LIEF/visibility.h"
|
||||
#include "LIEF/types.h"
|
||||
@@ -35,12 +28,11 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/** @brief Check if the given file is an ELF one. */
|
||||
LIEF_API bool is_elf(const char* file);
|
||||
LIEF_API uint8_t is_elf(const char* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,13 +16,10 @@
|
||||
#ifndef C_LIEF_MACHO_H_
|
||||
#define C_LIEF_MACHO_H_
|
||||
|
||||
/** @defgroup macho_c_api MachO C API */
|
||||
|
||||
#include "LIEF/MachO/Binary.h"
|
||||
#include "LIEF/MachO/Symbol.h"
|
||||
#include "LIEF/MachO/Segment.h"
|
||||
#include "LIEF/MachO/Section.h"
|
||||
#include "LIEF/MachO/LoadCommand.h"
|
||||
#include "LIEF/MachO/Header.h"
|
||||
#include "LIEF/MachO/EnumToString.h"
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,14 +16,6 @@
|
||||
#ifndef C_LIEF_MACHO_BINARY_H_
|
||||
#define C_LIEF_MACHO_BINARY_H_
|
||||
|
||||
/** @defgroup macho_binary_c_api Binary
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_binary_c_api
|
||||
* @brief Binary C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "LIEF/visibility.h"
|
||||
@@ -41,7 +33,6 @@ extern "C" {
|
||||
/** @brief LIEF::MachO::Binary C Handler */
|
||||
struct Macho_Binary_t {
|
||||
void* handler;
|
||||
const char* name;
|
||||
uint64_t imagebase;
|
||||
Macho_Header_t header;
|
||||
Macho_Command_t** commands;
|
||||
@@ -63,5 +54,4 @@ LIEF_API void macho_binaries_destroy(Macho_Binary_t** binaries);
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_MACHO_ENUM_TO_STRING_H_
|
||||
#define C_LIEF_MACHO_ENUM_TO_STRING_H_
|
||||
|
||||
#include "LIEF/visibility.h"
|
||||
#include "LIEF/MachO/enums.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
LIEF_API const char* LOAD_COMMAND_TYPES_to_string(enum LIEF_MACHO_LOAD_COMMAND_TYPES e);
|
||||
LIEF_API const char* MACHO_TYPES_to_string(enum LIEF_MACHO_MACHO_TYPES e);
|
||||
LIEF_API const char* FILE_TYPES_to_string(enum LIEF_MACHO_FILE_TYPES e);
|
||||
LIEF_API const char* CPU_TYPES_to_string(enum LIEF_MACHO_CPU_TYPES e);
|
||||
LIEF_API const char* HEADER_FLAGS_to_string(enum LIEF_MACHO_HEADER_FLAGS e);
|
||||
LIEF_API const char* MACHO_SECTION_TYPES_to_string(enum LIEF_MACHO_MACHO_SECTION_TYPES e);
|
||||
LIEF_API const char* MACHO_SYMBOL_TYPES_to_string(enum LIEF_MACHO_MACHO_SYMBOL_TYPES e);
|
||||
LIEF_API const char* N_LIST_TYPES_to_string(enum LIEF_MACHO_N_LIST_TYPES e);
|
||||
LIEF_API const char* SYMBOL_DESCRIPTIONS_to_string(enum LIEF_MACHO_SYMBOL_DESCRIPTIONS e);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,13 +18,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/MachO/enums.h"
|
||||
/** @defgroup macho_header_c_api Header
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_header_c_api
|
||||
* @brief Header C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -48,5 +41,4 @@ typedef struct Macho_Header_t Macho_Header_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,14 +18,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/MachO/enums.h"
|
||||
/** @defgroup macho_load_command_c_api Header
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_load_command_c_api
|
||||
* @brief Load Command C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -44,5 +36,4 @@ typedef struct Macho_Command_t Macho_Command_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,14 +18,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/MachO/enums.h"
|
||||
/** @defgroup macho_section_c_api Header
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_section_c_api
|
||||
* @brief Section C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -55,5 +47,4 @@ typedef struct Macho_Section_t Macho_Section_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,14 +18,7 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/MachO/enums.h"
|
||||
/** @defgroup macho_segment_c_api Header
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_segment_c_api
|
||||
* @brief Segment C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include "LIEF/MachO/Section.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -52,5 +45,4 @@ typedef struct Macho_Segment_t Macho_Segment_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,13 +18,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/MachO/enums.h"
|
||||
/** @defgroup macho_symbol_c_api Header
|
||||
* @ingroup macho_c_api
|
||||
* @addtogroup macho_symbol_c_api
|
||||
* @brief Symbol C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -45,5 +38,4 @@ typedef struct Macho_Symbol_t Macho_Symbol_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef LIEF_MACHO_C_ENUMS_H_
|
||||
#define LIEF_MACHO_C_ENUMS_H_
|
||||
#include "LIEF/MachO/undef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,8 +16,5 @@
|
||||
#ifndef C_LIEF_PE_H_
|
||||
#define C_LIEF_PE_H_
|
||||
|
||||
/** @defgroup pe_c_api PE C API */
|
||||
|
||||
#include "LIEF/PE/Binary.h"
|
||||
#include "LIEF/PE/EnumToString.h"
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,14 +16,6 @@
|
||||
#ifndef C_LIEF_PE_BINARY_H_
|
||||
#define C_LIEF_PE_BINARY_H_
|
||||
|
||||
/** @defgroup pe_binary_c_api Binary
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_binary_c_api
|
||||
* @brief Binary C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "LIEF/visibility.h"
|
||||
@@ -44,7 +36,6 @@ extern "C" {
|
||||
/** @brief LIEF::PE::Binary C Handler */
|
||||
struct Pe_Binary_t {
|
||||
void* handler;
|
||||
const char* name;
|
||||
Pe_DosHeader_t dos_header;
|
||||
Pe_Header_t header;
|
||||
Pe_OptionalHeader_t optional_header;
|
||||
@@ -64,6 +55,4 @@ LIEF_API void pe_binary_destroy(Pe_Binary_t* binary);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* Licensed under the Apache License, Version 2.0 (the "License",;
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
@@ -13,24 +13,39 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_PE_DATA_DIRECTORY_H_
|
||||
#define C_LIEF_PE_DATA_DIRECTORY_H_
|
||||
#ifndef C_LIEF_PE_DATA_DIRECTORY_H
|
||||
#define C_LIEF_PE_DATA_DIRECTORY_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/PE/enums.h"
|
||||
/** @defgroup pe_data_directory_c_api Section
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_data_directory_c_api
|
||||
* @brief Data directory C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
enum LIEF_PE_DATA_DIRECTORY {
|
||||
LIEF_PE_DATA_DIR_EXPORT_TABLE = 0,
|
||||
LIEF_PE_DATA_DIR_IMPORT_TABLE,
|
||||
LIEF_PE_DATA_DIR_RESOURCE_TABLE,
|
||||
LIEF_PE_DATA_DIR_EXCEPTION_TABLE,
|
||||
LIEF_PE_DATA_DIR_CERTIFICATE_TABLE,
|
||||
LIEF_PE_DATA_DIR_BASE_RELOCATION_TABLE,
|
||||
LIEF_PE_DATA_DIR_DEBUG,
|
||||
LIEF_PE_DATA_DIR_ARCHITECTURE,
|
||||
LIEF_PE_DATA_DIR_GLOBAL_PTR,
|
||||
LIEF_PE_DATA_DIR_TLS_TABLE,
|
||||
LIEF_PE_DATA_DIR_LOAD_CONFIG_TABLE,
|
||||
LIEF_PE_DATA_DIR_BOUND_IMPORT,
|
||||
LIEF_PE_DATA_DIR_IAT,
|
||||
LIEF_PE_DATA_DIR_DELAY_IMPORT_DESCRIPTOR,
|
||||
LIEF_PE_DATA_DIR_CLR_RUNTIME_HEADER,
|
||||
LIEF_PE_DATA_DIR_RESERVED,
|
||||
|
||||
LIEF_PE_DATA_DIR_NONE,
|
||||
};
|
||||
|
||||
struct Pe_DataDirectory_t {
|
||||
uint32_t rva;
|
||||
uint32_t size;
|
||||
@@ -43,5 +58,4 @@ typedef struct Pe_DataDirectory_t Pe_DataDirectory_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,13 +18,6 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
/** @defgroup pe_dos_header_c_api DosHeader
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_dos_header_c_api
|
||||
* @brief Dos Header C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -32,7 +25,7 @@ extern "C" {
|
||||
|
||||
struct Pe_DosHeader_t {
|
||||
uint16_t magic ;
|
||||
uint16_t used_bytes_in_the_last_page;
|
||||
uint16_t used_bytes_in_last_page;
|
||||
uint16_t file_size_in_pages;
|
||||
uint16_t numberof_relocation;
|
||||
uint16_t header_size_in_paragraphs;
|
||||
@@ -59,5 +52,4 @@ typedef struct Pe_DosHeader_t Pe_DosHeader_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,10 +24,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
LIEF_API const char* PE_TYPES_to_string(enum LIEF_PE_PE_TYPES e);
|
||||
LIEF_API const char* MACHINE_TYPES_to_string(enum LIEF_PE_MACHINE_TYPES e);
|
||||
LIEF_API const char* SUBSYSTEM_to_string(enum LIEF_PE_SUBSYSTEM e);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,24 +13,65 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_PE_HEADER_H_
|
||||
#define C_LIEF_PE_HEADER_H_
|
||||
#ifndef C_LIEF_PE_HEADER_H
|
||||
#define C_LIEF_PE_HEADER_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/PE/enums.h"
|
||||
/** @defgroup pe_header_c_api Header
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_header_c_api
|
||||
* @brief Header C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#include "LIEF/visibility.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum LIEF_PE_MACHINE_TYPES {
|
||||
LIEF_PE_MACHINE_UNKNOWN = 0x0,
|
||||
LIEF_PE_MACHINE_AM33 = 0x1D3, /**< Matsushita AM33 */
|
||||
LIEF_PE_MACHINE_AMD64 = 0x8664, /**< AMD x64 */
|
||||
LIEF_PE_MACHINE_ARM = 0x1C0, /**< ARM little endian */
|
||||
LIEF_PE_MACHINE_ARMNT = 0x1C4, /**< ARMv7 Thumb mode only */
|
||||
LIEF_PE_MACHINE_ARM64 = 0xAA64, /**< ARMv8 in 64-bits mode */
|
||||
LIEF_PE_MACHINE_EBC = 0xEBC, /**< EFI byte code */
|
||||
LIEF_PE_MACHINE_I386 = 0x14C, /**< Intel 386 or later */
|
||||
LIEF_PE_MACHINE_IA64 = 0x200, /**< Intel Itanium processor family */
|
||||
LIEF_PE_MACHINE_M32R = 0x9041, /**< Mitsubishi M32R little endian */
|
||||
LIEF_PE_MACHINE_MIPS16 = 0x266, /**< MIPS16 */
|
||||
LIEF_PE_MACHINE_MIPSFPU = 0x366, /**< MIPS with FPU */
|
||||
LIEF_PE_MACHINE_MIPSFPU16 = 0x466, /**< MIPS16 with FPU */
|
||||
LIEF_PE_MACHINE_POWERPC = 0x1F0, /**< Power PC little endian */
|
||||
LIEF_PE_MACHINE_POWERPCFP = 0x1F1, /**< Power PC with floating point */
|
||||
LIEF_PE_MACHINE_POWERPCBE = 0x1F2, /**< Power PC big endian */
|
||||
LIEF_PE_MACHINE_R4000 = 0x166, /**< MIPS with little endian */
|
||||
LIEF_PE_MACHINE_RISCV32 = 0x5032, /**< RISC-V 32-bit address space */
|
||||
LIEF_PE_MACHINE_RISCV64 = 0x5064, /**< RISC-V 64-bit address space */
|
||||
LIEF_PE_MACHINE_RISCV128 = 0x5128, /**< RISC-V 128-bit address space */
|
||||
LIEF_PE_MACHINE_SH3 = 0x1A2, /**< Hitachi SH3 */
|
||||
LIEF_PE_MACHINE_SH3DSP = 0x1A3, /**< Hitachi SH3 DSP */
|
||||
LIEF_PE_MACHINE_SH4 = 0x1A6, /**< Hitachi SH4 */
|
||||
LIEF_PE_MACHINE_SH5 = 0x1A8, /**< Hitachi SH5 */
|
||||
LIEF_PE_MACHINE_THUMB = 0x1C2, /**< ARM or Thumb */
|
||||
LIEF_PE_MACHINE_WCEMIPSV2 = 0x169 /**< MIPS little-endian WCE v2 */
|
||||
};
|
||||
|
||||
enum LIEF_PE_HEADER_CHARACTERISTICS {
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_INVALID = 0x0000,
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_RELOCS_STRIPPED = 0x0001, /**< The file does not contain base relocations and must be loaded at its preferred base. If this cannot be done, the loader will error.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_EXECUTABLE_IMAGE = 0x0002, /**< The file is valid and can be run.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_LINE_NUMS_STRIPPED = 0x0004, /**< COFF line numbers have been stripped. This is deprecated and should be 0*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_LOCAL_SYMS_STRIPPED = 0x0008, /**< COFF symbol table entries for local symbols have been removed. This is deprecated and should be 0.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_AGGRESSIVE_WS_TRIM = 0x0010, /**< Aggressively trim working set. This is deprecated and must be 0.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_LARGE_ADDRESS_AWARE = 0x0020, /**< Image can handle > 2GiB addresses. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_LO = 0x0080, /**< Little endian: the LSB precedes the MSB in memory. This is deprecated and should be 0.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_32BIT_MACHINE = 0x0100, /**< Machine is based on a 32bit word architecture. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_DEBUG_STRIPPED = 0x0200, /**< Debugging info has been removed. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_REMOVABLE_RUN_FROM_SWAP = 0x0400, /**< If the image is on removable media, fully load it and copy it to swap. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_NET_RUN_FROM_SWAP = 0x0800, /**< If the image is on network media, fully load it and copy it to swap. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_SYSTEM = 0x1000, /**< The image file is a system file, not a user program.*/
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_DLL = 0x2000, /**< The image file is a DLL. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_UP_SYSTEM_ONLY = 0x4000, /**< This file should only be run on a uniprocessor machine. */
|
||||
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_HI = 0x8000 /**< Big endian: the MSB precedes the LSB in memory. This is deprecated */
|
||||
};
|
||||
|
||||
struct Pe_Header_t {
|
||||
uint8_t signature[4];
|
||||
enum LIEF_PE_MACHINE_TYPES machine;
|
||||
@@ -44,10 +85,11 @@ struct Pe_Header_t {
|
||||
|
||||
typedef struct Pe_Header_t Pe_Header_t;
|
||||
|
||||
LIEF_API const char* lief_pe_header_machine_str(enum LIEF_PE_MACHINE_TYPES e);
|
||||
LIEF_API const char* lief_pe_header_characteristics_str(enum LIEF_PE_HEADER_CHARACTERISTICS e);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,14 +21,6 @@
|
||||
#include "LIEF/PE/enums.h"
|
||||
#include "LIEF/PE/ImportEntry.h"
|
||||
|
||||
/** @defgroup pe_import_c_api Import
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_import_c_api
|
||||
* @brief Import C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -49,5 +41,4 @@ typedef struct Pe_Import_t Pe_Import_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,20 +22,12 @@
|
||||
|
||||
#include "LIEF/PE/enums.h"
|
||||
|
||||
/** @defgroup pe_import_entry_c_api Import Entry
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_import_entry_c_api
|
||||
* @brief Import Entry C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Pe_ImportEntry_t {
|
||||
bool is_ordinal;
|
||||
uint8_t is_ordinal;
|
||||
const char* name;
|
||||
uint16_t ordinal;
|
||||
uint64_t hint_name_rva;
|
||||
@@ -52,5 +44,4 @@ typedef struct Pe_ImportEntry_t Pe_ImportEntry_t;
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,25 +13,50 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#ifndef C_LIEF_PE_OPTIONAL_HEADER_H_
|
||||
#define C_LIEF_PE_OPTIONAL_HEADER_H_
|
||||
#ifndef C_LIEF_PE_OPTIONAL_HEADER_H
|
||||
#define C_LIEF_PE_OPTIONAL_HEADER_H
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/PE/enums.h"
|
||||
/** @defgroup pe_optional_header_c_api OptionalHeader
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_optional_header_c_api
|
||||
* @brief OptionalHeader C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#include "LIEF/visibility.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum LIEF_PE_DLL_CHARACTERISTICS {
|
||||
LIEF_PE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA = 0x0020, /**< ASLR with 64 bit address space. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_DYNAMIC_BASE = 0x0040, /**< DLL can be relocated at load time. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_FORCE_INTEGRITY = 0x0080, /**< Code integrity checks are enforced. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_NX_COMPAT = 0x0100, /**< Image is NX compatible. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_NO_ISOLATION = 0x0200, /**< Isolation aware, but do not isolate the image. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_NO_SEH = 0x0400, /**< Does not use structured exception handling (SEH). No SEH handler may be called in this image. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_NO_BIND = 0x0800, /**< Do not bind the image. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_APPCONTAINER = 0x1000, /**< Image should execute in an AppContainer. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_WDM_DRIVER = 0x2000, /**< A WDM driver. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_GUARD_CF = 0x4000, /**< Image supports Control Flow Guard. */
|
||||
LIEF_PE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000 /**< Terminal Server aware. */
|
||||
};
|
||||
|
||||
enum LIEF_PE_SUBSYSTEM {
|
||||
LIEF_PE_SUBSYSTEM_UNKNOWN = 0, /**< An unknown subsystem. */
|
||||
LIEF_PE_SUBSYSTEM_NATIVE = 1, /**< Device drivers and native Windows processes */
|
||||
LIEF_PE_SUBSYSTEM_WINDOWS_GUI = 2, /**< The Windows GUI subsystem. */
|
||||
LIEF_PE_SUBSYSTEM_WINDOWS_CUI = 3, /**< The Windows character subsystem. */
|
||||
LIEF_PE_SUBSYSTEM_OS2_CUI = 5, /**< The OS/2 character subsytem. */
|
||||
LIEF_PE_SUBSYSTEM_POSIX_CUI = 7, /**< The POSIX character subsystem. */
|
||||
LIEF_PE_SUBSYSTEM_NATIVE_WINDOWS = 8, /**< Native Windows 9x driver. */
|
||||
LIEF_PE_SUBSYSTEM_WINDOWS_CE_GUI = 9, /**< Windows CE. */
|
||||
LIEF_PE_SUBSYSTEM_EFI_APPLICATION = 10, /**< An EFI application. */
|
||||
LIEF_PE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER = 11, /**< An EFI driver with boot services. */
|
||||
LIEF_PE_SUBSYSTEM_EFI_RUNTIME_DRIVER = 12, /**< An EFI driver with run-time services. */
|
||||
LIEF_PE_SUBSYSTEM_EFI_ROM = 13, /**< An EFI ROM image. */
|
||||
LIEF_PE_SUBSYSTEM_XBOX = 14, /**< XBOX. */
|
||||
LIEF_PE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16 /**< A BCD application. */
|
||||
};
|
||||
|
||||
struct Pe_OptionalHeader_t {
|
||||
enum LIEF_PE_PE_TYPES magic;
|
||||
uint16_t magic;
|
||||
uint8_t major_linker_version;
|
||||
uint8_t minor_linker_version;
|
||||
uint32_t sizeof_code;
|
||||
@@ -65,10 +90,10 @@ struct Pe_OptionalHeader_t {
|
||||
|
||||
typedef struct Pe_OptionalHeader_t Pe_OptionalHeader_t;
|
||||
|
||||
LIEF_API const char* lief_pe_subsytem_str(enum LIEF_PE_SUBSYSTEM e);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 - 2023 R. Thomas
|
||||
* Copyright 2017 - 2023 Quarkslab
|
||||
/* Copyright 2017 - 2025 R. Thomas
|
||||
* Copyright 2017 - 2025 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,18 +19,50 @@
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "LIEF/PE/enums.h"
|
||||
/** @defgroup pe_section_c_api Section
|
||||
* @ingroup pe_c_api
|
||||
* @addtogroup pe_section_c_api
|
||||
* @brief Section C API
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum LIEF_PE_SECTION_CHARACTERISTICS {
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_TYPE_NO_PAD = 0x00000008,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_CNT_CODE = 0x00000020,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_CNT_INITIALIZED_DATA = 0x00000040,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_CNT_UNINITIALIZED_DATA = 0x00000080,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_LNK_OTHER = 0x00000100,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_LNK_INFO = 0x00000200,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_LNK_REMOVE = 0x00000800,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_LNK_COMDAT = 0x00001000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_GPREL = 0x00008000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_PURGEABLE = 0x00010000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_16BIT = 0x00020000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_LOCKED = 0x00040000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_PRELOAD = 0x00080000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_1BYTES = 0x00100000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_2BYTES = 0x00200000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_4BYTES = 0x00300000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_8BYTES = 0x00400000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_16BYTES = 0x00500000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_32BYTES = 0x00600000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_64BYTES = 0x00700000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_128BYTES = 0x00800000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_256BYTES = 0x00900000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_512BYTES = 0x00A00000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_1024BYTES = 0x00B00000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_2048BYTES = 0x00C00000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_4096BYTES = 0x00D00000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_ALIGN_8192BYTES = 0x00E00000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_LNK_NRELOC_OVFL = 0x01000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_DISCARDABLE = 0x02000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_NOT_CACHED = 0x04000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_NOT_PAGED = 0x08000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_SHARED = 0x10000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_EXECUTE = 0x20000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_READ = 0x40000000,
|
||||
LIEF_PE_SECTION_CHARACTERISTICS_MEM_WRITE = 0x80000000
|
||||
};
|
||||
|
||||
|
||||
struct Pe_Section_t {
|
||||
const char* name;
|
||||
uint64_t virtual_address;
|
||||
@@ -50,10 +82,8 @@ struct Pe_Section_t {
|
||||
|
||||
typedef struct Pe_Section_t Pe_Section_t;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#ifndef LIEF_PE_C_ENUMS_H_
|
||||
#define LIEF_PE_C_ENUMS_H_
|
||||
#include "LIEF/PE/undef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -16,6 +15,7 @@ extern "C" {
|
||||
#undef _LIEF_EN_2
|
||||
#undef _LIEF_EI
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user