Compare commits
797
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1623cdd47e | ||
|
|
3d4799a0c0 | ||
|
|
3568445ab0 | ||
|
|
0bac240a30 | ||
|
|
7eed525d88 | ||
|
|
3eea5e7e4a | ||
|
|
61a8b046de | ||
|
|
036e7fdaf0 | ||
|
|
d8bca167f8 | ||
|
|
a83333e09f | ||
|
|
e3cafe67ea | ||
|
|
d2ad8f6108 | ||
|
|
ab93d302d2 | ||
|
|
8cff9dcad9 | ||
|
|
0d51ea4e50 | ||
|
|
26b3920527 | ||
|
|
c7bbd74094 | ||
|
|
158f291b1f | ||
|
|
ffef01221d | ||
|
|
ab3f073ac0 | ||
|
|
e4baf52b4f | ||
|
|
12c740905d | ||
|
|
94bbacd100 | ||
|
|
3b7b5a738d | ||
|
|
92dac82cc5 | ||
|
|
8d5e3a0e82 | ||
|
|
24f4a5d954 | ||
|
|
b8422047e9 | ||
|
|
b8e825b464 | ||
|
|
06aa75c085 | ||
|
|
e83f812e5d | ||
|
|
32abf75562 | ||
|
|
5eb19bafbf | ||
|
|
1a4a93c36f | ||
|
|
8a338e57b3 | ||
|
|
e8503e031f | ||
|
|
9cf2ec87fa | ||
|
|
611ce0c5e0 | ||
|
|
2aa87f656c | ||
|
|
923ecaa256 | ||
|
|
e875a8ffa2 | ||
|
|
9e084e64ff | ||
|
|
d25b4d20a8 | ||
|
|
3903034b78 | ||
|
|
8bb11a2efa | ||
|
|
dbbb952535 | ||
|
|
66c772209b | ||
|
|
2ec24125e6 | ||
|
|
e0b0814859 | ||
|
|
5db3eb15f7 | ||
|
|
42ca36844e | ||
|
|
23ec99d01c | ||
|
|
29e4a07016 | ||
|
|
df653a6331 | ||
|
|
70ac0a727f | ||
|
|
56f503ade0 | ||
|
|
530827a0f0 | ||
|
|
f39695b6b3 | ||
|
|
d0c30970eb | ||
|
|
31a3b3b34b | ||
|
|
d483b2b2f1 | ||
|
|
136dea5fde | ||
|
|
163fa1c42c | ||
|
|
c28c195d1b | ||
|
|
d8f452967e | ||
|
|
d79b9f4e1f | ||
|
|
10c5b0a190 | ||
|
|
05103f55a6 | ||
|
|
ff629b5642 | ||
|
|
8d874a023b | ||
|
|
f8c0d63ba3 | ||
|
|
3c65ffe2d6 | ||
|
|
2a197a23d7 | ||
|
|
ae7b3436b3 | ||
|
|
49ab06b107 | ||
|
|
b43d3fd6c8 | ||
|
|
3d7802aaac | ||
|
|
de7492ee49 | ||
|
|
dbee1f9efe | ||
|
|
97a6546af0 | ||
|
|
67afb7b93d | ||
|
|
fce157b45f | ||
|
|
5bbbdad5f8 | ||
|
|
fda42077c4 | ||
|
|
89bbe0deb2 | ||
|
|
11540055c7 | ||
|
|
a73ab46531 | ||
|
|
51d258f95b | ||
|
|
97ae54f6e1 | ||
|
|
2737c05837 | ||
|
|
4aac4dc067 | ||
|
|
7831e6113c | ||
|
|
bb7a898eee | ||
|
|
3d0da01f7f | ||
|
|
3d10658455 | ||
|
|
e453b535a3 | ||
|
|
e541b5f5b7 | ||
|
|
3e4c3ae3a0 | ||
|
|
0260b2f534 | ||
|
|
15fcfc37cc | ||
|
|
2317898f36 | ||
|
|
b1e1a44d49 | ||
|
|
f8543381b9 | ||
|
|
d15defefe7 | ||
|
|
fa423b7e0f | ||
|
|
fd8af3ac00 | ||
|
|
97bd4aba91 | ||
|
|
14c15dec87 | ||
|
|
2cf38a7a8e | ||
|
|
f58605f94c | ||
|
|
a348a12b36 | ||
|
|
a479b6ee6e | ||
|
|
9974da21ed | ||
|
|
5b7e6978b9 | ||
|
|
f8a3f4f8b5 | ||
|
|
1aff75d33f | ||
|
|
62a2e8e8c6 | ||
|
|
27547aec33 | ||
|
|
6e703014f6 | ||
|
|
45263af2ce | ||
|
|
6720ed2385 | ||
|
|
9851421392 | ||
|
|
bc92f0c3f9 | ||
|
|
75846c5ec6 | ||
|
|
1587cf5f2d | ||
|
|
4b9416731b | ||
|
|
8511b606d2 | ||
|
|
9b49d5d4ab | ||
|
|
e6c606e78a | ||
|
|
d29a74996b | ||
|
|
e4d2da1fd5 | ||
|
|
e56fae238d | ||
|
|
caac866496 | ||
|
|
536f24a91b | ||
|
|
153f46bb7a | ||
|
|
852b507491 | ||
|
|
bdf1264df9 | ||
|
|
53ce0cd7d4 | ||
|
|
ec9115a3d1 | ||
|
|
634c2fc98e | ||
|
|
5b587ea88f | ||
|
|
d1ad5ab1de | ||
|
|
820dd28905 | ||
|
|
846978474c | ||
|
|
40052253ef | ||
|
|
1e914cd86e | ||
|
|
cd286e1c08 | ||
|
|
fa9e340842 | ||
|
|
0a76b87d91 | ||
|
|
2b01a2d086 | ||
|
|
8f46263c17 | ||
|
|
90a781baac | ||
|
|
bbe04d0e28 | ||
|
|
8b1d101a8f | ||
|
|
541cd5b0d9 | ||
|
|
65e36a6650 | ||
|
|
c30a580d6b | ||
|
|
13222b6974 | ||
|
|
42745373ef | ||
|
|
a7967a6827 | ||
|
|
f4fc5784af | ||
|
|
64481662f5 | ||
|
|
eccc0bbc61 | ||
|
|
99f868b1b7 | ||
|
|
6fe83ec826 | ||
|
|
933b9492a0 | ||
|
|
d35ac6c48f | ||
|
|
022ec6e998 | ||
|
|
a4682e0329 | ||
|
|
a9fea192b1 | ||
|
|
197b699951 | ||
|
|
f8bd135057 | ||
|
|
ce58df93d8 | ||
|
|
51305e205e | ||
|
|
ca80be352e | ||
|
|
db9ffbb61c | ||
|
|
c365a533bc | ||
|
|
e509528896 | ||
|
|
576d791f80 | ||
|
|
01c33053ab | ||
|
|
9d1635ef72 | ||
|
|
e59c7a992d | ||
|
|
749241db92 | ||
|
|
1feefec9f8 | ||
|
|
f17cb09269 | ||
|
|
9dd641d380 | ||
|
|
623055b045 | ||
|
|
1fecc1b147 | ||
|
|
fe953c16ff | ||
|
|
ae8f262c7c | ||
|
|
fe6f2a08d6 | ||
|
|
d484fc89d0 | ||
|
|
3613f476fe | ||
|
|
413feff355 | ||
|
|
50a348e7f0 | ||
|
|
ae67fbef17 | ||
|
|
24a07e23cc | ||
|
|
2fe4002699 | ||
|
|
2c93d12cfc | ||
|
|
8751eda888 | ||
|
|
1c35015b42 | ||
|
|
fee1271157 | ||
|
|
03ba40b735 | ||
|
|
d1a7b81120 | ||
|
|
588a7a3a04 | ||
|
|
533b74d551 | ||
|
|
4de7fd2050 | ||
|
|
d11149b03d | ||
|
|
f0bddc0001 | ||
|
|
ad055a155f | ||
|
|
2145d79efb | ||
|
|
b49786fd03 | ||
|
|
294428973a | ||
|
|
3b7c8fb203 | ||
|
|
8872b85fc7 | ||
|
|
957929348b | ||
|
|
1538a55b97 | ||
|
|
f0ee03543b | ||
|
|
acb108602d | ||
|
|
8a72f4310e | ||
|
|
a49fb73f74 | ||
|
|
44e072da15 | ||
|
|
d2218e549d | ||
|
|
9c399e603c | ||
|
|
bee7a0bb86 | ||
|
|
b224217bfe | ||
|
|
92181c8d51 | ||
|
|
2bfd277360 | ||
|
|
43a223b70f | ||
|
|
24d89a1315 | ||
|
|
122e6ab443 | ||
|
|
ab4df2db1e | ||
|
|
ad6189e38c | ||
|
|
f2151dbe41 | ||
|
|
a35a97aa83 | ||
|
|
1364f22c78 | ||
|
|
044f3d992c | ||
|
|
1851382170 | ||
|
|
c02bfee0e6 | ||
|
|
a76eb4a4f9 | ||
|
|
7b5e8503d6 | ||
|
|
b8a6c68731 | ||
|
|
b90d3c433d | ||
|
|
1381f9a115 | ||
|
|
dc31e15fc9 | ||
|
|
d84f190790 | ||
|
|
437fbeb3ea | ||
|
|
3d9b84c6ec | ||
|
|
3bd530b880 | ||
|
|
1390f8b090 | ||
|
|
2d0005dc60 | ||
|
|
d6753b17c5 | ||
|
|
2e65a94b7c | ||
|
|
a7921647cf | ||
|
|
96632324c3 | ||
|
|
4d4ef09e8e | ||
|
|
f8f353b5ed | ||
|
|
de766d3165 | ||
|
|
1663ebd843 | ||
|
|
c6a2b93628 | ||
|
|
ab3557654e | ||
|
|
7884e57aa1 | ||
|
|
48f72bd036 | ||
|
|
1a416ea365 | ||
|
|
9e6902c19c | ||
|
|
013a3861c0 | ||
|
|
61e93d71f2 | ||
|
|
e0457bd779 | ||
|
|
081ec5c0e9 | ||
|
|
c31e7b4c3b | ||
|
|
32ad568691 | ||
|
|
f955a6bc0c | ||
|
|
390d140fed | ||
|
|
19e06755e8 | ||
|
|
5f26216f90 | ||
|
|
4881c6f5c4 | ||
|
|
5fed2461a9 | ||
|
|
4db8cf8b30 | ||
|
|
9f1bebb0ff | ||
|
|
2348eb4d82 | ||
|
|
6e5a4937d4 | ||
|
|
cbad2be774 | ||
|
|
5e9053988f | ||
|
|
a81ee63e11 | ||
|
|
672c539e73 | ||
|
|
346574132c | ||
|
|
1fd42b4ebf | ||
|
|
10f0a2857f | ||
|
|
6ae4915127 | ||
|
|
e287ad9447 | ||
|
|
653f8a1c35 | ||
|
|
eb87ca6ef6 | ||
|
|
4bbe410333 | ||
|
|
20f9d04ae8 | ||
|
|
04c18f851e | ||
|
|
96e6fc66ad | ||
|
|
ddc8b72e6b | ||
|
|
1a7f8c41eb | ||
|
|
a69f4b0867 | ||
|
|
38f48a6e12 | ||
|
|
2faa591440 | ||
|
|
caa767f26f | ||
|
|
e6c7e2af9e | ||
|
|
565593dade | ||
|
|
67f04bfd38 | ||
|
|
c38f3fc7dd | ||
|
|
2e2818c837 | ||
|
|
f1aa89f435 | ||
|
|
ee45d512d8 | ||
|
|
e0656480cf | ||
|
|
5684960317 | ||
|
|
da371b3780 | ||
|
|
26ae54a175 | ||
|
|
1e0c4e81d4 | ||
|
|
a2a1ce6fe3 | ||
|
|
4ccac0389d | ||
|
|
a1521128e1 | ||
|
|
3cee05646c | ||
|
|
2ed4dd0157 | ||
|
|
2166c91773 | ||
|
|
b99e791be6 | ||
|
|
6fd553114d | ||
|
|
8671cc0a97 | ||
|
|
cf2f92fc65 | ||
|
|
cd05f34bae | ||
|
|
e4a3659297 | ||
|
|
541c38c9e8 | ||
|
|
b023698df8 | ||
|
|
37f38b3a42 | ||
|
|
84ffe2d478 | ||
|
|
a04eb8888a | ||
|
|
c03125045e | ||
|
|
798950d874 | ||
|
|
c0d028b4eb | ||
|
|
9b2420d2e4 | ||
|
|
9a64ced220 | ||
|
|
6ee808a1e4 | ||
|
|
1400144455 | ||
|
|
59fb3b5da5 | ||
|
|
faf2067f08 | ||
|
|
f96d95d718 | ||
|
|
2c85678fb6 | ||
|
|
ec8ed4d842 | ||
|
|
1deb7f945d | ||
|
|
ee7ccb2863 | ||
|
|
7daff3bf9b | ||
|
|
8ac569cb52 | ||
|
|
43b65f616b | ||
|
|
5d45f8c6cb | ||
|
|
b57f32333a | ||
|
|
a7254d1ba9 | ||
|
|
fe7c725f3b | ||
|
|
594ea3b356 | ||
|
|
6c53646bb7 | ||
|
|
1014ba0ad1 | ||
|
|
e39f939899 | ||
|
|
f210e6ba9b | ||
|
|
a8293b4343 | ||
|
|
33d1b894c0 | ||
|
|
0b205665c3 | ||
|
|
fb789a8e9a | ||
|
|
89bd542833 | ||
|
|
a26ae60e83 | ||
|
|
f9e88a6665 | ||
|
|
68f6154722 | ||
|
|
eeddc38393 | ||
|
|
ab349aadc6 | ||
|
|
172c589d4c | ||
|
|
0ade59de75 | ||
|
|
86568dc77a | ||
|
|
74bc77465e | ||
|
|
1cd2db0dca | ||
|
|
da4507fcbb | ||
|
|
7b7216f14c | ||
|
|
bfe5414a1e | ||
|
|
86a35bd7bc | ||
|
|
b0e480c9f2 | ||
|
|
ca4e6148fe | ||
|
|
c93f428d04 | ||
|
|
7fc13786e8 | ||
|
|
91bc294b62 | ||
|
|
1090d09e1a | ||
|
|
833d8a626f | ||
|
|
845f675627 | ||
|
|
f5d152ee92 | ||
|
|
b9eb5c4043 | ||
|
|
db4e52dd90 | ||
|
|
fe9315f42d | ||
|
|
bf9e4a259b | ||
|
|
42ee4173cd | ||
|
|
5f865a8980 | ||
|
|
4744ab12a0 | ||
|
|
d838f523bb | ||
|
|
ed2e775e77 | ||
|
|
934d84ffea | ||
|
|
d400ca429d | ||
|
|
4105c31f61 | ||
|
|
657d589fae | ||
|
|
08d31be932 | ||
|
|
208264cb66 | ||
|
|
e563d682bf | ||
|
|
3550e45f18 | ||
|
|
e50436164e | ||
|
|
27666e4f02 | ||
|
|
f6cc8f8ff6 | ||
|
|
6cf1e2f9df | ||
|
|
4d4f96d268 | ||
|
|
273f001895 | ||
|
|
40570e6522 | ||
|
|
088951ddb7 | ||
|
|
2cc22a792f | ||
|
|
04037644af | ||
|
|
df2d56c532 | ||
|
|
2b1214b770 | ||
|
|
fcb9c76be6 | ||
|
|
1b1a616ac7 | ||
|
|
715448d3b8 | ||
|
|
20f46e74a3 | ||
|
|
d4ad532c58 | ||
|
|
3a11b24798 | ||
|
|
bab1c1d5b7 | ||
|
|
535623de3a | ||
|
|
91eb4783c3 | ||
|
|
8f2770506d | ||
|
|
826965be1b | ||
|
|
bd9be9a765 | ||
|
|
3be83b7b22 | ||
|
|
7ff0859879 | ||
|
|
778763de88 | ||
|
|
9dd9ded098 | ||
|
|
89c7afa680 | ||
|
|
d188fbdd23 | ||
|
|
c9c49bb4b8 | ||
|
|
fa3195b1bd | ||
|
|
8fb74bec60 | ||
|
|
22344e764e | ||
|
|
3730e447e1 | ||
|
|
1bd6cb8120 | ||
|
|
ca846b3ce7 | ||
|
|
352fa954a1 | ||
|
|
31db3adf34 | ||
|
|
084fc4544f | ||
|
|
6824548665 | ||
|
|
f4ba8b199e | ||
|
|
27a03a6fd3 | ||
|
|
35805fb598 | ||
|
|
36a7eeda2a | ||
|
|
9fc3a8a433 | ||
|
|
4608af8280 | ||
|
|
f20b1600c9 | ||
|
|
22cd81cfd8 | ||
|
|
449a56b3a9 | ||
|
|
0d03b4bdb8 | ||
|
|
57c30b8bd5 | ||
|
|
779529b1b8 | ||
|
|
2129f645e3 | ||
|
|
6c5889d9f2 | ||
|
|
64d2597284 | ||
|
|
a6adf242df | ||
|
|
b26abae9a9 | ||
|
|
e4c37e00ec | ||
|
|
09454f84a3 | ||
|
|
a2403d5eeb | ||
|
|
b1e9c1baed | ||
|
|
01b4d47048 | ||
|
|
d56e4fbb69 | ||
|
|
90867193b5 | ||
|
|
5fd3edc2a9 | ||
|
|
12073db330 | ||
|
|
342f450e3c | ||
|
|
87e200a07f | ||
|
|
24f7898748 | ||
|
|
44a10f2d35 | ||
|
|
6fc676387a | ||
|
|
7e88e2b2c0 | ||
|
|
826aae615b | ||
|
|
1fefa7eee9 | ||
|
|
616d739da5 | ||
|
|
38c7ef8416 | ||
|
|
8a30e1a3d7 | ||
|
|
1fdeafc6cc | ||
|
|
9f4962654c | ||
|
|
2778882bc2 | ||
|
|
146238029d | ||
|
|
3833e0be9c | ||
|
|
f3709db789 | ||
|
|
04fc91bfca | ||
|
|
2f8773e149 | ||
|
|
9e04d0b118 | ||
|
|
13ad81e743 | ||
|
|
3aaef13292 | ||
|
|
8d7ec26a93 | ||
|
|
f20fa5e4f4 | ||
|
|
cb55d7501b | ||
|
|
c1758ba1ed | ||
|
|
0054b9acef | ||
|
|
3e4ec39ab3 | ||
|
|
e64668c0c8 | ||
|
|
5ed5c5e4d9 | ||
|
|
882bf35197 | ||
|
|
3b892188a1 | ||
|
|
678039cf44 | ||
|
|
98395524b5 | ||
|
|
dc87423761 | ||
|
|
3537440b8d | ||
|
|
f2b93bf796 | ||
|
|
6f967238fc | ||
|
|
2c6f052a5f | ||
|
|
35b3d039f7 | ||
|
|
93b73d35ef | ||
|
|
7c22f643c2 | ||
|
|
840d70cb6d | ||
|
|
3271d1011b | ||
|
|
fcc75dd879 | ||
|
|
3ac2067267 | ||
|
|
cf8a0d9ce3 | ||
|
|
184074841b | ||
|
|
f3e52f5f3c | ||
|
|
c6ba2fd8e1 | ||
|
|
cc7a2657ef | ||
|
|
b3678bfdfc | ||
|
|
946527a732 | ||
|
|
e7f5829b19 | ||
|
|
8620b08f95 | ||
|
|
0927287703 | ||
|
|
53b1eb4165 | ||
|
|
12416db45a | ||
|
|
f3b14dac83 | ||
|
|
f9b8bcf503 | ||
|
|
de064eb591 | ||
|
|
273924ab85 | ||
|
|
decb8621f8 | ||
|
|
d7d1d18beb | ||
|
|
ad792af834 | ||
|
|
c4524ea6f1 | ||
|
|
cbacbc47f4 | ||
|
|
b5a08463ad | ||
|
|
5c757dff91 | ||
|
|
dfd8e55b83 | ||
|
|
196717c999 | ||
|
|
b716003f59 | ||
|
|
6c62bed5ab | ||
|
|
4b649ad231 | ||
|
|
9142c2bfb3 | ||
|
|
a7d4f682f5 | ||
|
|
2c01518cc0 | ||
|
|
89d4de54c8 | ||
|
|
4b03ac45e0 | ||
|
|
d394e0e58f | ||
|
|
507dfd2dcb | ||
|
|
2d603ede82 | ||
|
|
cb70c44391 | ||
|
|
9314b4ad11 | ||
|
|
38e84d6d2c | ||
|
|
bce9ebe170 | ||
|
|
04dddd3710 | ||
|
|
1f875dbea8 | ||
|
|
02f4851c9f | ||
|
|
6b2ac0cc2a | ||
|
|
4cb7ba46c7 | ||
|
|
b22ef1f211 | ||
|
|
e3b680f70b | ||
|
|
d1b98d69ad | ||
|
|
2dde1afc5c | ||
|
|
c6779702b1 | ||
|
|
0c9ecec7c5 | ||
|
|
0f6cfd0b84 | ||
|
|
ceee60e1b5 | ||
|
|
bc4c94ca6c | ||
|
|
26586459d9 | ||
|
|
16595316fd | ||
|
|
9268a35c68 | ||
|
|
ce4af44b26 | ||
|
|
28aeb36400 | ||
|
|
af4d48ed2e | ||
|
|
918438c6be | ||
|
|
613412955c | ||
|
|
1c854c2663 | ||
|
|
47d5fb7180 | ||
|
|
394d7ec44a | ||
|
|
83f659222f | ||
|
|
057d6e2d08 | ||
|
|
4edff179ca | ||
|
|
4fcbdb7f33 | ||
|
|
85067e9edd | ||
|
|
752bb934c9 | ||
|
|
f137d314e5 | ||
|
|
f665c78033 | ||
|
|
957384cd36 | ||
|
|
31a4b19c54 | ||
|
|
cc9dd14863 | ||
|
|
0d9479b850 | ||
|
|
c3f99aebda | ||
|
|
d7582fcab9 | ||
|
|
86941c28cd | ||
|
|
ed15e0968c | ||
|
|
4866ead1a7 | ||
|
|
406115c8d0 | ||
|
|
5ec8956ba9 | ||
|
|
fd9ecaf8c6 | ||
|
|
149d352a49 | ||
|
|
e1b19bd181 | ||
|
|
1524906483 | ||
|
|
3098193227 | ||
|
|
67d924a220 | ||
|
|
6e7e373660 | ||
|
|
fa5790ca80 | ||
|
|
a9f3cb8f9b | ||
|
|
cd9cb41687 | ||
|
|
69a8c4fcd0 | ||
|
|
d26f398296 | ||
|
|
4bc623f341 | ||
|
|
00aad800ae | ||
|
|
f2f09d9c6d | ||
|
|
03529285df | ||
|
|
310cf5a690 | ||
|
|
a448c5ef31 | ||
|
|
f4e2d81bfe | ||
|
|
311c7951e6 | ||
|
|
cc5617dd75 | ||
|
|
33a2af4b18 | ||
|
|
3cdfb29612 | ||
|
|
cd1cc457cf | ||
|
|
163cd3bcc9 | ||
|
|
c8404450b7 | ||
|
|
4fd3513151 | ||
|
|
c765d086cc | ||
|
|
809d002c7d | ||
|
|
f9276bb416 | ||
|
|
7abca35e49 | ||
|
|
dc909a174e | ||
|
|
4fcfba0cbf | ||
|
|
68b0958a2a | ||
|
|
e8389fc98a | ||
|
|
2de4bab4b2 | ||
|
|
e794ac1502 | ||
|
|
9e3b5b45f7 | ||
|
|
d1a7252d29 | ||
|
|
e7c45a1778 | ||
|
|
4511a37f9c | ||
|
|
63e17580a7 | ||
|
|
1d539bbe95 | ||
|
|
7e98df346d | ||
|
|
f97751f075 | ||
|
|
8dc9de59f7 | ||
|
|
833b0439b4 | ||
|
|
21ccc1d865 | ||
|
|
6a53074e01 | ||
|
|
f020fafb07 | ||
|
|
1d8ba8a42a | ||
|
|
e7e0b4678b | ||
|
|
5d9645847b | ||
|
|
bc26443b62 | ||
|
|
67eb7187ed | ||
|
|
97c6d6dc65 | ||
|
|
3a381ca5fc | ||
|
|
ab029fa75b | ||
|
|
8d3ff39239 | ||
|
|
10cad1973b | ||
|
|
1f32b25329 | ||
|
|
c8f49ac013 | ||
|
|
6fb715a919 | ||
|
|
b181034e25 | ||
|
|
8023aa2ce5 | ||
|
|
eb9f7e3a7e | ||
|
|
6fee8532fd | ||
|
|
60c042fa6e | ||
|
|
a47ff2ea66 | ||
|
|
4018724224 | ||
|
|
85023ba94b | ||
|
|
a4f220c171 | ||
|
|
d3fe00cc48 | ||
|
|
9d7604a1ae | ||
|
|
4ef1bb845f | ||
|
|
6b8f8c11d3 | ||
|
|
0bbeaa81e9 | ||
|
|
55e99450f4 | ||
|
|
d2e85e92d6 | ||
|
|
eeae4c9d1f | ||
|
|
08b514191f | ||
|
|
2031956cc2 | ||
|
|
0f2855d6c3 | ||
|
|
9a2ef208bb | ||
|
|
db26017872 | ||
|
|
30f34a6952 | ||
|
|
cda91aec7a | ||
|
|
29623d8725 | ||
|
|
569dc591aa | ||
|
|
4ef839c3d8 | ||
|
|
a16e1c4d13 | ||
|
|
9cadce30e7 | ||
|
|
70a18e8246 | ||
|
|
04be950eab | ||
|
|
237611f859 | ||
|
|
9c24533356 | ||
|
|
4ee01e5de5 | ||
|
|
262af07311 | ||
|
|
8660060064 | ||
|
|
6676d6c91d | ||
|
|
73acf00288 | ||
|
|
5a6448c00d | ||
|
|
508a1bd0c8 | ||
|
|
d42c675040 | ||
|
|
00d35616f4 | ||
|
|
30544b095b | ||
|
|
4969a4c55a | ||
|
|
e6e6801e95 | ||
|
|
21e6c72563 | ||
|
|
47a03223aa | ||
|
|
6273c6f065 | ||
|
|
3a4406fcfe | ||
|
|
c6ac39bc7c | ||
|
|
3029c9620f | ||
|
|
fda5f65d1c | ||
|
|
46fa0e9747 | ||
|
|
4e3e87eea4 | ||
|
|
17f391febc | ||
|
|
79a5d0e93b | ||
|
|
0ebd8a78b1 | ||
|
|
3b17aba10e | ||
|
|
a5c2922c83 | ||
|
|
eaf1713b81 | ||
|
|
d26fdb41ec | ||
|
|
251676a0a2 | ||
|
|
2a5f1519f8 | ||
|
|
df3d269e23 | ||
|
|
5d56141061 | ||
|
|
135aeab50f | ||
|
|
c6d79c0da5 | ||
|
|
a40da3e3b4 | ||
|
|
253c2b5e62 | ||
|
|
d13db18214 | ||
|
|
3cf0ec92c3 | ||
|
|
1418272c2c | ||
|
|
49a2e40bf3 | ||
|
|
eab4a7614f | ||
|
|
6cb9519728 | ||
|
|
b9237bf027 | ||
|
|
2042b750e0 | ||
|
|
dee5c07784 | ||
|
|
463e471b33 | ||
|
|
3e704e78c5 | ||
|
|
d93b235e03 | ||
|
|
fbdefff46e | ||
|
|
4382fea62e | ||
|
|
1e701344c2 | ||
|
|
d910cc4034 | ||
|
|
1891655459 | ||
|
|
75744cfd1c | ||
|
|
4d18af12e9 | ||
|
|
210b03b9d3 | ||
|
|
baaeab316b | ||
|
|
2fca982c8d | ||
|
|
c0c9fc3863 | ||
|
|
1d27cac3f9 | ||
|
|
531ec1c8b4 | ||
|
|
83e390f7ce | ||
|
|
f4d174c9f1 | ||
|
|
6443b43434 | ||
|
|
42102fe5b2 | ||
|
|
6b62777aa1 | ||
|
|
9d93cc5ec4 | ||
|
|
09f4a4019c | ||
|
|
27575527db | ||
|
|
196994dc08 | ||
|
|
23d4e82384 | ||
|
|
ae4c2a95ee | ||
|
|
92a601190c | ||
|
|
b045f7d4cd | ||
|
|
66b484938a | ||
|
|
d6327dd0fe | ||
|
|
24cc485038 | ||
|
|
b9c50dce34 | ||
|
|
9125b146cd | ||
|
|
201a6c144d | ||
|
|
1c722d9ff2 | ||
|
|
e3e3eb8bc6 | ||
|
|
fe7e426f7b | ||
|
|
93a4b2e2b2 | ||
|
|
4e38d9cf99 | ||
|
|
404e0ecca3 | ||
|
|
d96fd16ecd | ||
|
|
bf97d22b35 | ||
|
|
ba7dfeab39 | ||
|
|
aa70e07791 | ||
|
|
49fdb8dc8f | ||
|
|
5778bae34c | ||
|
|
a18e22f2cb | ||
|
|
4cee3fa240 | ||
|
|
49c2d089dd | ||
|
|
7dd2e82e42 | ||
|
|
d421f12e32 | ||
|
|
880b99aeef | ||
|
|
c61caaecce | ||
|
|
18d5b75d57 | ||
|
|
abbc264833 | ||
|
|
745e272577 |
+86
-98
@@ -1,59 +1,25 @@
|
||||
version: 0.7.{build}
|
||||
image: Visual Studio 2015
|
||||
image: Visual Studio 2019
|
||||
clone_folder: c:\projects\lief
|
||||
|
||||
configuration: Release
|
||||
|
||||
clone_depth: 3
|
||||
services:
|
||||
- docker
|
||||
|
||||
platform:
|
||||
- x86
|
||||
- x64
|
||||
|
||||
#cache:
|
||||
# - rang_cpp_color-prefix -> CMakeLists.txt
|
||||
# - mbed_tls -> CMakeLists.txt
|
||||
# - libjson-prefix -> CMakeLists.txt
|
||||
# - easyloggingpp-prefix -> CMakeLists.txt
|
||||
# - tests\YAMLCPP -> tests\CMakeLists.txt
|
||||
# - tests\lief-samples -> tests\CMakeLists.txt
|
||||
# - tests\catch -> tests\CMakeLists.txt
|
||||
# - api\python\pybind11-prefix -> api\python\CMakeLists.txt
|
||||
|
||||
environment:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY:
|
||||
secure: TT7SXISIifq2/tf02n2ATgPj+Ky4Cjl3Fg44BAfyI4yRa4i87UAQIx5EFeV63+Xv2rhcU7JcMgl+An7QBrV6ofuQ9jxbuw+Gd1GqcCrAIyY=
|
||||
LIEF_AUTOMATIC_BUILDS_IV:
|
||||
secure: /S6Vbt3vEisoC81siFbkqOXQeVnwxLZZPMYp1r79G7h+HFjLlWUZSidxxpsAgHNE
|
||||
SCCACHE_CACHE_SIZE: "750M"
|
||||
SCCACHE_DIR: C:\Users\appveyor\AppData\Local\Mozilla\sccache
|
||||
SCCACHE_ERROR_LOG: C:\projects\sccache.log
|
||||
matrix:
|
||||
# Python 2.7
|
||||
- PYTHON_VERSION: "2.7"
|
||||
PYTHON32_PATH: "C:\\Python27"
|
||||
PYTHON32_INCLUDE: "C:\\Python27\\include"
|
||||
PYTHON32_BINARY: "C:\\Python27\\python.exe"
|
||||
PYTHON32_LIBRARY: "C:\\Python27\\libs\\python27.lib"
|
||||
PYTHON64_PATH: "C:\\Python27-x64"
|
||||
PYTHON64_INCLUDE: "C:\\Python27-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python27-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python27-x64\\libs\\python27.lib"
|
||||
LIEF_TEST_SHARED: "OFF"
|
||||
LIEF_TEST_STATIC: "ON"
|
||||
|
||||
|
||||
# Python 3.5
|
||||
- PYTHON_VERSION: "3.5"
|
||||
PYTHON32_PATH: "C:\\Python35"
|
||||
PYTHON32_INCLUDE: "C:\\Python35\\include"
|
||||
PYTHON32_BINARY: "C:\\Python35\\python.exe"
|
||||
PYTHON32_LIBRARY: "C:\\Python35\\libs\\python35.lib"
|
||||
PYTHON64_PATH: "C:\\Python35-x64"
|
||||
PYTHON64_INCLUDE: "C:\\Python35-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python35-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python35-x64\\libs\\python35.lib"
|
||||
LIEF_TEST_SHARED: "ON"
|
||||
LIEF_TEST_STATIC: "OFF"
|
||||
|
||||
|
||||
# Python 3.6
|
||||
- PYTHON_VERSION: "3.6"
|
||||
PYTHON32_PATH: "C:\\Python36"
|
||||
@@ -64,88 +30,110 @@ environment:
|
||||
PYTHON64_INCLUDE: "C:\\Python36-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python36-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python36-x64\\libs\\python36.lib"
|
||||
LIEF_TEST_SHARED: "ON"
|
||||
LIEF_TEST_STATIC: "ON"
|
||||
|
||||
# Python 3.7
|
||||
- PYTHON_VERSION: "3.7"
|
||||
PYTHON32_PATH: "C:\\Python37"
|
||||
PYTHON32_INCLUDE: "C:\\Python37\\include"
|
||||
PYTHON32_BINARY: "C:\\Python37\\python.exe"
|
||||
PYTHON32_LIBRARY: "C:\\Python37\\libs\\python37.lib"
|
||||
PYTHON64_PATH: "C:\\Python37-x64"
|
||||
PYTHON64_INCLUDE: "C:\\Python37-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python37-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python37-x64\\libs\\python37.lib"
|
||||
|
||||
matrix:
|
||||
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
|
||||
allow_failures:
|
||||
- platform: x86
|
||||
configuration: Release
|
||||
- platform: x64
|
||||
configuration: Release
|
||||
# Python 3.8
|
||||
- PYTHON_VERSION: "3.8"
|
||||
PYTHON32_PATH: "C:\\Python38"
|
||||
PYTHON32_INCLUDE: "C:\\Python38\\include"
|
||||
PYTHON32_BINARY: "C:\\Python38\\python.exe"
|
||||
PYTHON32_LIBRARY: "C:\\Python38\\libs\\python38.lib"
|
||||
PYTHON64_PATH: "C:\\Python38-x64"
|
||||
PYTHON64_INCLUDE: "C:\\Python38-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python38-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python38-x64\\libs\\python38.lib"
|
||||
|
||||
# Python 3.9
|
||||
- PYTHON_VERSION: "3.9"
|
||||
PYTHON32_PATH: "C:\\Python39"
|
||||
PYTHON32_INCLUDE: "C:\\Python39\\include"
|
||||
PYTHON32_BINARY: "C:\\Python39\\python.exe"
|
||||
PYTHON32_LIBRARY: "C:\\Python39\\libs\\python39.lib"
|
||||
PYTHON64_PATH: "C:\\Python39-x64"
|
||||
PYTHON64_INCLUDE: "C:\\Python39-x64\\include"
|
||||
PYTHON64_BINARY: "C:\\Python39-x64\\python.exe"
|
||||
PYTHON64_LIBRARY: "C:\\Python39-x64\\libs\\python39.lib"
|
||||
|
||||
cache:
|
||||
- '%SCCACHE_DIR%'
|
||||
|
||||
install:
|
||||
- cmd: choco install sccache
|
||||
- cmd: sccache.exe --start-server
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:CMAKE_ARCH = "x64" }
|
||||
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_PATH = $env:PYTHON64_PATH }
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_PATH = $env:PYTHON64_PATH }
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_INCLUDE = $env:PYTHON64_INCLUDE }
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_BINARY = $env:PYTHON64_BINARY }
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_BINARY = $env:PYTHON64_BINARY }
|
||||
- ps: if ($env:PLATFORM -eq "x64") { $env:PYTHON_LIBRARY = $env:PYTHON64_LIBRARY }
|
||||
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_PATH = $env:PYTHON32_PATH }
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_PATH = $env:PYTHON32_PATH }
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_INCLUDE = $env:PYTHON32_INCLUDE }
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_BINARY = $env:PYTHON32_BINARY }
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_BINARY = $env:PYTHON32_BINARY }
|
||||
- ps: if ($env:PLATFORM -eq "x86") { $env:PYTHON_LIBRARY = $env:PYTHON32_LIBRARY }
|
||||
- set PATH=%PYTHON_PATH%;%PATH%
|
||||
|
||||
# Upgrade pip
|
||||
- python.exe -m pip install --disable-pip-version-check --user --upgrade pip
|
||||
- python.exe -m pip install --user wheel mako
|
||||
- python.exe -m pip install --upgrade setuptools
|
||||
|
||||
|
||||
build_script:
|
||||
- >
|
||||
cmake -A "%CMAKE_ARCH%"
|
||||
-DLIEF_TESTS=on
|
||||
-DLIEF_PYTHON_API=on
|
||||
-DPYTHON_VERSION=%PYTHON_VERSION%
|
||||
-DPYTHON_INCLUDE_DIR=%PYTHON_INCLUDE%
|
||||
-DPYTHON_EXECUTABLE=%PYTHON_BINARY%
|
||||
-DPYTHON_LIBRARY=%PYTHON_LIBRARY%
|
||||
-DLIEF_TEST_SHARED=%LIEF_TEST_SHARED%
|
||||
-DLIEF_TEST_STATIC=%LIEF_TEST_STATIC%
|
||||
- set MSBuildLogger="C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
|
||||
- cmake --build . --config Release --target lief_samples -- /v:m /logger:%MSBuildLogger%
|
||||
- cmake .
|
||||
- cmake --build . --config Release --target ALL_BUILD -- /v:m /logger:%MSBuildLogger%
|
||||
|
||||
test_script:
|
||||
- cmake --build . --config Release --target lief_samples -- /v:m /logger:%MSBuildLogger%
|
||||
- cmake .
|
||||
- cmake --build . --config Release --target check-lief -- /v:m /logger:%MSBuildLogger%
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- python.exe .\setup.py --ninja --lief-test build bdist_wheel --skip-build && exit 0 # Ignore warnings...
|
||||
- ps: if ($env:PYTHON_VERSION -eq "3.9") { python.exe .\scripts\windows\package_sdk.py }
|
||||
|
||||
after_build:
|
||||
- cmake --build . --config Release --target package -- /v:m /logger:%MSBuildLogger%
|
||||
- cd api\python
|
||||
- python.exe .\setup.py bdist_egg && exit 0 # Ignore warnings...
|
||||
- ps: if ($env:APPVEYOR_REPO_TAG -eq "true") { python.exe .\setup.py sdist --formats=zip } # Ignore warnings...
|
||||
- ps: if ($env:APPVEYOR_REPO_TAG -eq "false") { python.exe .\setup.py sdist --dev --formats=zip } # Ignore warnings...
|
||||
- cd ..\..
|
||||
- bash ./.github/deploy.sh
|
||||
- ps: Get-Service -Name 'ssh-agent' | Set-Service -StartupType Manual
|
||||
- ps: Start-Service -Name 'ssh-agent'
|
||||
- cd %APPVEYOR_BUILD_FOLDER%
|
||||
- ps: docker pull liefproject/deploy:latest
|
||||
- ps: |
|
||||
docker run `
|
||||
-v ${PWD}:/src `
|
||||
-e APPVEYOR="true" `
|
||||
-e APPVEYOR_PULL_REQUEST_NUMBER="$env:APPVEYOR_PULL_REQUEST_NUMBER" `
|
||||
-e APPVEYOR_REPO_NAME="$env:APPVEYOR_REPO_NAME" `
|
||||
-e APPVEYOR_REPO_TAG_NAME="$env:APPVEYOR_REPO_TAG_NAME" `
|
||||
-e APPVEYOR_REPO_BRANCH="$env:APPVEYOR_REPO_BRANCH" `
|
||||
-e APPVEYOR_BUILD_FOLDER="$env:APPVEYOR_BUILD_FOLDER" `
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY="$env:LIEF_AUTOMATIC_BUILDS_KEY" `
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV="$env:LIEF_AUTOMATIC_BUILDS_IV" `
|
||||
--rm `
|
||||
liefproject/deploy python3 /src/.github/deploy.py
|
||||
$host.SetShouldExit(0)
|
||||
|
||||
on_finish:
|
||||
- cmd: sccache.exe --stop-server
|
||||
|
||||
artifacts:
|
||||
- path: '*.zip'
|
||||
- path: 'dist\*.whl'
|
||||
name: python-wheel
|
||||
|
||||
- path: 'build\*.zip'
|
||||
name: sdk
|
||||
|
||||
- path: 'api\python\dist\*.zip'
|
||||
name: python-src
|
||||
|
||||
- path: 'api\python\dist\*.egg'
|
||||
name: python-egg
|
||||
|
||||
|
||||
deploy:
|
||||
description: "LIEF version $(APPVEYOR_REPO_TAG_NAME)"
|
||||
provider: GitHub
|
||||
auth_token:
|
||||
secure: FU9CGrZ1lm0VDHUZg6zvTL4tidluDvRegVUTehCRo2xgiOv6NZePi7TdSy5CsOdG
|
||||
artifact: sdk;python-src;python-egg
|
||||
draft: false
|
||||
prerelease: false
|
||||
force_update: true
|
||||
on:
|
||||
appveyor_repo_tag: true # deploy on tag push only
|
||||
#deploy:
|
||||
# description: "LIEF version $(APPVEYOR_REPO_TAG_NAME)"
|
||||
# provider: GitHub
|
||||
# auth_token:
|
||||
# secure: FU9CGrZ1lm0VDHUZg6zvTL4tidluDvRegVUTehCRo2xgiOv6NZePi7TdSy5CsOdG
|
||||
# artifact: sdk;python-wheel
|
||||
# draft: false
|
||||
# prerelease: false
|
||||
# force_update: true
|
||||
# on:
|
||||
# appveyor_repo_tag: true # deploy on tag push only
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
version: 2.1
|
||||
jobs:
|
||||
build:
|
||||
macos:
|
||||
xcode: 12.3.0
|
||||
steps:
|
||||
- checkout:
|
||||
path: ~/LIEF
|
||||
- restore_cache:
|
||||
keys:
|
||||
- ccache-{{ arch }}-{{ .Branch }}
|
||||
- ccache-{{ arch }}-master
|
||||
- ccache-{{ arch }}
|
||||
- pyenv
|
||||
- run:
|
||||
name: Install pyenv
|
||||
command: |
|
||||
brew install pyenv
|
||||
pyenv root
|
||||
pyenv install --list
|
||||
- run:
|
||||
name: Install ccache
|
||||
command: brew install ccache
|
||||
- run:
|
||||
name: Install ninja
|
||||
command: brew install ninja
|
||||
- run:
|
||||
name: CCache initialization
|
||||
command: |
|
||||
ccache --show-stats
|
||||
ccache --zero-stats
|
||||
ccache --max-size=10.0G
|
||||
ccache --set-config=compiler_check=content
|
||||
- run:
|
||||
name: LIEF build setup
|
||||
command: |
|
||||
export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs2"
|
||||
pyenv install --skip-existing 3.9.0
|
||||
export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9
|
||||
$PYTHON_BINARY -m pip install --upgrade pip setuptools wheel
|
||||
$PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
bash scripts/osx/package_sdk.sh
|
||||
- run:
|
||||
name: LIEF deploy
|
||||
command: |
|
||||
export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9
|
||||
$PYTHON_BINARY -m pip install --upgrade requests mako
|
||||
$PYTHON_BINARY .github/deploy.py
|
||||
- run:
|
||||
name: ccache stats
|
||||
when: always
|
||||
command: |
|
||||
ccache --show-stats
|
||||
- save_cache:
|
||||
key: 'ccache-{{ arch }}-{{ .Branch }}'
|
||||
paths: [ "/home/circleci/.ccache" ]
|
||||
- save_cache:
|
||||
key: 'pyenv'
|
||||
paths: [ "/home/circleci/.pyenv" ]
|
||||
|
||||
|
||||
|
||||
+1
-10
@@ -1,10 +1 @@
|
||||
*
|
||||
!src
|
||||
!doc
|
||||
!tests
|
||||
!include
|
||||
!examples
|
||||
!api
|
||||
!CMakeLists.txt
|
||||
!CMakeModules
|
||||
!package
|
||||
build
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: romainthomas
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Environment (please complete the following information):**
|
||||
- System and Version : [e.g. Ubuntu 16.04]
|
||||
- Target format (PE, ELF, Mach-O)
|
||||
- LIEF commit version: ``python -c "import lief;print(lief.__version__)"`` or the one from ``LIEF/config.h``
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,407 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
import os
|
||||
import re
|
||||
import logging
|
||||
import pathlib
|
||||
import subprocess
|
||||
import shutil
|
||||
import json
|
||||
from datetime import datetime
|
||||
from mako.template import Template
|
||||
from enum import Enum, auto
|
||||
|
||||
class CI(Enum):
|
||||
UNKNOWN = auto()
|
||||
TRAVIS = auto()
|
||||
APPVEYOR = auto()
|
||||
GITLAB_CI = auto()
|
||||
CIRCLE_CI = auto()
|
||||
GITHUB_ACTIONS = auto()
|
||||
AZURE = auto()
|
||||
LOCAL = auto()
|
||||
|
||||
def pretty_ci_name(ci):
|
||||
return str(ci).split(".")[-1].replace("_", "-").lower()
|
||||
|
||||
def is_pr(ci):
|
||||
if ci == CI.TRAVIS:
|
||||
cond1 = os.getenv("TRAVIS_EVENT_TYPE", "pull_request") == "pull_request"
|
||||
cond2 = not (os.getenv("TRAVIS_REPO_SLUG", "").startswith("lief-project/") or os.getenv("TRAVIS_REPO_SLUG", "").startswith("romainthomas/LIEF"))
|
||||
return cond1 or cond2
|
||||
elif ci == CI.APPVEYOR:
|
||||
logger.info("%s - %s", os.getenv("APPVEYOR_PULL_REQUEST_NUMBER", -1), os.getenv("APPVEYOR_REPO_NAME", ""))
|
||||
pr_number = os.getenv("APPVEYOR_PULL_REQUEST_NUMBER", "")
|
||||
cond1 = len(pr_number) != 0 and int(pr_number) >= 0
|
||||
cond2 = not (os.getenv("APPVEYOR_REPO_NAME", "").startswith("lief-project/") or os.getenv("APPVEYOR_REPO_NAME", "").startswith("romainthomas/"))
|
||||
return cond1 or cond2
|
||||
elif ci == CI.CIRCLE_CI:
|
||||
cond1 = int(os.getenv("CIRCLE_PR_NUMBER", -1)) >= 0
|
||||
cond2 = os.getenv("CIRCLE_PROJECT_USERNAME", "") != "lief-project" and os.getenv("CIRCLE_PROJECT_USERNAME", "") != "romainthomas"
|
||||
return cond1 or cond2
|
||||
elif ci == CI.GITHUB_ACTIONS:
|
||||
cond1 = os.getenv("GITHUB_HEAD_REF", "") != ""
|
||||
cond2 = not (os.getenv("GITHUB_REPOSITORY", "").startswith("lief-project/") or os.getenv("GITHUB_REPOSITORY", "").startswith("romainthomas/LIEF"))
|
||||
return cond1 or cond2
|
||||
elif ci == CI.LOCAL:
|
||||
return False
|
||||
return True
|
||||
|
||||
def get_branch(ci):
|
||||
if ci == CI.TRAVIS:
|
||||
return os.getenv("TRAVIS_BRANCH")
|
||||
elif ci == CI.APPVEYOR:
|
||||
return os.getenv("APPVEYOR_REPO_BRANCH")
|
||||
elif ci == CI.CIRCLE_CI:
|
||||
return os.getenv("CIRCLE_BRANCH")
|
||||
elif ci == CI.GITHUB_ACTIONS:
|
||||
return os.getenv("GITHUB_REF").replace("refs/heads/", "")
|
||||
elif ci == CI.LOCAL:
|
||||
return os.getenv("CI_BRANCH")
|
||||
return None
|
||||
|
||||
def get_ci_workdir(ci):
|
||||
if ci == CI.CIRCLE_CI:
|
||||
return os.getenv("CIRCLE_WORKING_DIRECTORY")
|
||||
elif ci == CI.TRAVIS:
|
||||
return os.getenv("TRAVIS_BUILD_DIR")
|
||||
elif ci == CI.APPVEYOR:
|
||||
return os.getenv("APPVEYOR_BUILD_FOLDER")
|
||||
elif ci == CI.GITHUB_ACTIONS:
|
||||
return os.getenv("GITHUB_WORKSPACE")
|
||||
elif ci == CI.LOCAL:
|
||||
return os.getenv("CI_WORKING_DIR")
|
||||
else:
|
||||
logger.critical("Unsupported CI to resolve working directory")
|
||||
sys.exit(1)
|
||||
|
||||
def get_tag(ci):
|
||||
if ci == CI.CIRCLE_CI:
|
||||
return os.getenv("CIRCLE_TAG", "")
|
||||
elif ci == CI.TRAVIS:
|
||||
return os.getenv("TRAVIS_TAG", "")
|
||||
elif ci == CI.APPVEYOR:
|
||||
if "APPVEYOR_REPO_TAG_NAME" in os.environ:
|
||||
return os.getenv("APPVEYOR_REPO_TAG_NAME", "")
|
||||
return ""
|
||||
elif ci == CI.GITHUB_ACTIONS:
|
||||
ref = os.getenv("GITHUB_REF", "")
|
||||
logger.info("Github Action tag: {}".format(ref))
|
||||
if ref.startswith("refs/tags/"):
|
||||
return ref.replace("refs/tags/", "")
|
||||
return ""
|
||||
elif ci == CI.LOCAL:
|
||||
return os.getenv("CI_TAG")
|
||||
else:
|
||||
logger.critical("Unsupported CI to resolve working directory")
|
||||
sys.exit(1)
|
||||
|
||||
LOG_LEVEL = logging.DEBUG
|
||||
|
||||
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
logging.getLogger().setLevel(LOG_LEVEL)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
CURRENT_CI = CI.UNKNOWN
|
||||
|
||||
# Detect CI
|
||||
# ===========================================
|
||||
if os.getenv("TRAVIS", None) is not None:
|
||||
CURRENT_CI = CI.TRAVIS
|
||||
elif os.getenv("APPVEYOR", None) is not None:
|
||||
CURRENT_CI = CI.APPVEYOR
|
||||
elif os.getenv("GITHUB_ACTIONS", None) is not None:
|
||||
CURRENT_CI = CI.GITHUB_ACTIONS
|
||||
elif os.getenv("GITLAB_CI", None) is not None:
|
||||
CURRENT_CI = CI.GITLAB_CI
|
||||
elif os.getenv("CI_LOCAL", "") == "true":
|
||||
CURRENT_CI = CI.LOCAL
|
||||
else:
|
||||
logger.error("Can't detect CI!")
|
||||
sys.exit(1)
|
||||
# TODO(romain): Azure
|
||||
|
||||
CI_PRETTY_NAME = pretty_ci_name(CURRENT_CI)
|
||||
logger.info("CI: %s", CI_PRETTY_NAME)
|
||||
|
||||
ALLOWED_BRANCHES = {"master", "deploy", "devel"}
|
||||
BRANCH_NAME = get_branch(CURRENT_CI)
|
||||
TAG_NAME = get_tag(CURRENT_CI)
|
||||
IS_TAGGED = TAG_NAME is not None and len(TAG_NAME) > 0
|
||||
logger.info("Branch: %s", BRANCH_NAME)
|
||||
logger.info("Tag: %s", TAG_NAME)
|
||||
if BRANCH_NAME not in ALLOWED_BRANCHES and not IS_TAGGED:
|
||||
logger.info("Skip deployment for branch '%s'", BRANCH_NAME)
|
||||
sys.exit(0)
|
||||
|
||||
if is_pr(CURRENT_CI):
|
||||
logger.info("Skip pull request")
|
||||
sys.exit(0)
|
||||
|
||||
CURRENTDIR = pathlib.Path(__file__).resolve().parent
|
||||
REPODIR = CURRENTDIR.parent
|
||||
|
||||
DEPLOY_KEY = os.getenv("LIEF_AUTOMATIC_BUILDS_KEY", None)
|
||||
DEPLOY_IV = os.getenv("LIEF_AUTOMATIC_BUILDS_IV", None)
|
||||
|
||||
if DEPLOY_KEY is None or len(DEPLOY_KEY) == 0:
|
||||
logger.error("Deploy key is not set!")
|
||||
sys.exit(1)
|
||||
|
||||
if DEPLOY_IV is None or len(DEPLOY_IV) == 0:
|
||||
logger.error("Deploy IV is not set!")
|
||||
sys.exit(1)
|
||||
|
||||
GIT_USER = "lief-{}-ci".format(CI_PRETTY_NAME)
|
||||
GIT_EMAIL = "lief@quarkslab.com"
|
||||
|
||||
CI_CWD = pathlib.Path(get_ci_workdir(CURRENT_CI))
|
||||
|
||||
if CI_CWD is None:
|
||||
logger.debug("Can't resolve CI working dir")
|
||||
sys.exit(1)
|
||||
|
||||
LIEF_PACKAGE_REPO = "https://github.com/lief-project/packages.git"
|
||||
LIEF_PACKAGE_DIR = REPODIR / "deploy-packages"
|
||||
LIEF_PACKAGE_SSH_REPO = "git@github.com:lief-project/packages.git"
|
||||
SDK_PACKAGE_DIR = LIEF_PACKAGE_DIR / "sdk"
|
||||
PYPI_PACKAGE_DIR = LIEF_PACKAGE_DIR / "lief"
|
||||
JSON_PACKAGE = LIEF_PACKAGE_DIR / "packages.json"
|
||||
DIST_DIR = REPODIR / "dist"
|
||||
BUILD_DIR = REPODIR / "build"
|
||||
|
||||
|
||||
logger.debug("Working directory: %s", CI_CWD)
|
||||
|
||||
SSH_DIR = pathlib.Path("~/.ssh").expanduser().resolve()
|
||||
PYTHON = shutil.which("python")
|
||||
GIT = shutil.which("git")
|
||||
TAR = shutil.which("tar")
|
||||
OPENSSL = shutil.which("openssl")
|
||||
MV = shutil.which("mv")
|
||||
RM = shutil.which("rm")
|
||||
SSH_AGENT = shutil.which("ssh-agent")
|
||||
SSH_ADD = shutil.which("ssh-add")
|
||||
SSH_KEYSCAN = shutil.which("ssh-keyscan")
|
||||
|
||||
if DEPLOY_KEY is None:
|
||||
logger.error("Deploy key is not set!")
|
||||
sys.exit(1)
|
||||
|
||||
if DEPLOY_IV is None:
|
||||
logger.error("Deploy IV is not set!")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
#####################
|
||||
# Clone package repo
|
||||
#####################
|
||||
target_branch = "gh-pages"
|
||||
|
||||
if BRANCH_NAME != "master":
|
||||
target_branch = "packages-{}".format(BRANCH_NAME.replace("/", "-").replace("_", "-"))
|
||||
|
||||
if IS_TAGGED:
|
||||
target_branch = str(TAG_NAME)
|
||||
|
||||
new_branch = False
|
||||
if not LIEF_PACKAGE_DIR.is_dir():
|
||||
cmd = "{} clone --branch={} -j8 --single-branch {} {}".format(GIT, target_branch, LIEF_PACKAGE_REPO, LIEF_PACKAGE_DIR)
|
||||
p = subprocess.Popen(cmd, shell=True, cwd=REPODIR, stderr=subprocess.STDOUT)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
cmd = "{} clone --branch=master -j8 --single-branch {} {}".format(GIT, LIEF_PACKAGE_REPO, LIEF_PACKAGE_DIR)
|
||||
pmaster = subprocess.Popen(cmd, shell=True, cwd=REPODIR, stderr=subprocess.STDOUT)
|
||||
pmaster.wait()
|
||||
if pmaster.returncode:
|
||||
sys.exit(1)
|
||||
new_branch = True
|
||||
|
||||
cmd = "{} checkout --orphan {}".format(GIT, target_branch)
|
||||
pmaster = subprocess.Popen(cmd, shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
pmaster.wait()
|
||||
if pmaster.returncode:
|
||||
sys.exit(1)
|
||||
|
||||
cmd = "{} reset --hard".format(GIT)
|
||||
pmaster = subprocess.Popen(cmd, shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
pmaster.wait()
|
||||
|
||||
SDK_PACKAGE_DIR.mkdir(exist_ok=True)
|
||||
PYPI_PACKAGE_DIR.mkdir(exist_ok=True)
|
||||
|
||||
packages_info = {}
|
||||
new_packages_info = {}
|
||||
if JSON_PACKAGE.is_file():
|
||||
try:
|
||||
packages_info = json.loads(JSON_PACKAGE.read_bytes())
|
||||
except json.decoder.JSONDecodeError as e:
|
||||
logger.error(e)
|
||||
else:
|
||||
JSON_PACKAGE.touch()
|
||||
|
||||
logger.info("CI: %s - %s", GIT_USER, GIT_EMAIL)
|
||||
cmds = [
|
||||
"{} config user.name '{}'".format(GIT, GIT_USER),
|
||||
"{} config user.email '{}'".format(GIT, GIT_EMAIL),
|
||||
"{} reset --soft root".format(GIT),
|
||||
"{} ls-files -v".format(GIT),
|
||||
]
|
||||
|
||||
for cmd in cmds:
|
||||
p = subprocess.Popen(cmd, shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
sys.exit(1)
|
||||
|
||||
for file in DIST_DIR.glob("*.whl"):
|
||||
logger.debug("Copying '%s' to '%s'", file.as_posix(), PYPI_PACKAGE_DIR.as_posix())
|
||||
new_packages_info[file.name] = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
|
||||
shutil.copy(file.as_posix(), PYPI_PACKAGE_DIR.as_posix())
|
||||
|
||||
for file in BUILD_DIR.glob("*.zip"):
|
||||
logger.debug("Copying '%s' to '%s'", file.as_posix(), SDK_PACKAGE_DIR.as_posix())
|
||||
new_packages_info[file.name] = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
|
||||
shutil.copy(file.as_posix(), SDK_PACKAGE_DIR.as_posix())
|
||||
|
||||
for file in BUILD_DIR.glob("*.tar.gz"):
|
||||
logger.debug("Copying '%s' to '%s'", file.as_posix(), SDK_PACKAGE_DIR.as_posix())
|
||||
new_packages_info[file.name] = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
|
||||
shutil.copy(file.as_posix(), SDK_PACKAGE_DIR.as_posix())
|
||||
|
||||
for k, v in new_packages_info.items():
|
||||
logger.info("{:<30}: {}".format(k, v))
|
||||
|
||||
try:
|
||||
packages_info.update(new_packages_info)
|
||||
JSON_PACKAGE.write_text(json.dumps(packages_info))
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
|
||||
INDEX_TEMPLATE = r"""
|
||||
<html>
|
||||
<title>Links for lief</title>
|
||||
<body>
|
||||
<h1>Links for lief</h1>
|
||||
% for name in names:
|
||||
<a href="${base_url}/${base}/${name}">${name}</a><br />
|
||||
% endfor
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
EXCLUDED = ['index.html', '.gitkeep']
|
||||
BASE_URL = "https://lief-project.github.io"
|
||||
|
||||
fnames = [fname for fname in sorted(f.name for f in PYPI_PACKAGE_DIR.iterdir() if f.is_file() and f.name not in EXCLUDED)]
|
||||
html = Template(INDEX_TEMPLATE).render(names=fnames, base_url=BASE_URL, base="packages/lief")
|
||||
with open((PYPI_PACKAGE_DIR / "index.html").as_posix(), "w") as f:
|
||||
f.write(html)
|
||||
|
||||
|
||||
fnames = [fname for fname in sorted(f.name for f in SDK_PACKAGE_DIR.iterdir() if f.is_file() and f.name not in EXCLUDED)]
|
||||
html = Template(INDEX_TEMPLATE).render(names=fnames, base_url=BASE_URL, base="packages/sdk")
|
||||
with open((SDK_PACKAGE_DIR / "index.html").as_posix(), "w") as f:
|
||||
f.write(html)
|
||||
|
||||
if not SSH_DIR.is_dir():
|
||||
SSH_DIR.mkdir(mode=0o700)
|
||||
|
||||
#fix_ssh_perms()
|
||||
deploy_key_path = (REPODIR / ".github" / "deploy-key.enc").as_posix()
|
||||
output_key_path = (REPODIR / ".git" / "deploy-key")
|
||||
cmd = "{} aes-256-cbc -K {} -iv {} -in {} -out {} -d".format(
|
||||
OPENSSL, DEPLOY_KEY, DEPLOY_IV, deploy_key_path, output_key_path.as_posix())
|
||||
|
||||
kwargs = {
|
||||
'shell': True,
|
||||
'cwd': REPODIR,
|
||||
'stdout': subprocess.DEVNULL,
|
||||
'stderr': subprocess.DEVNULL,
|
||||
}
|
||||
|
||||
p = subprocess.Popen(cmd, **kwargs)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
sys.exit(1)
|
||||
|
||||
output_key_path.chmod(0o600)
|
||||
logger.info(output_key_path)
|
||||
|
||||
process = subprocess.run(SSH_AGENT, stdout=subprocess.PIPE, universal_newlines=True, stderr=subprocess.STDOUT)
|
||||
OUTPUT_PATTERN = re.compile(r'SSH_AUTH_SOCK=(?P<socket>[^;]+).*SSH_AGENT_PID=(?P<pid>\d+)', re.MULTILINE | re.DOTALL)
|
||||
match = OUTPUT_PATTERN.search(process.stdout)
|
||||
if match is None:
|
||||
logger.error("Can't start ssh-agent")
|
||||
sys.exit(1)
|
||||
|
||||
agent_data = match.groupdict()
|
||||
logger.info(f'ssh agent data: {agent_data!s}')
|
||||
logger.info('Exporting ssh agent environment variables' )
|
||||
|
||||
os.environ['SSH_AUTH_SOCK'] = agent_data['socket']
|
||||
os.environ['SSH_AGENT_PID'] = agent_data['pid']
|
||||
|
||||
process = subprocess.run([SSH_ADD, output_key_path], stderr=subprocess.STDOUT)
|
||||
if process.returncode != 0:
|
||||
raise Exception(f'Failed to add the key: {output_key_path}')
|
||||
known_hosts = (SSH_DIR / "known_hosts").as_posix()
|
||||
cmd = "{} -H github.com >> {}".format(SSH_KEYSCAN, known_hosts)
|
||||
|
||||
kwargs = {
|
||||
'shell': True,
|
||||
'cwd': REPODIR,
|
||||
'stderr': subprocess.STDOUT,
|
||||
}
|
||||
|
||||
p = subprocess.Popen(cmd, **kwargs)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
sys.exit(1)
|
||||
|
||||
commit_msg = 'Automatic deployment by {}'.format(CI_PRETTY_NAME)
|
||||
cmds = [
|
||||
"{} add .".format(GIT),
|
||||
"{} commit -m '{}'".format(GIT, commit_msg),
|
||||
"{} ls-files -v".format(GIT),
|
||||
]
|
||||
|
||||
for cmd in cmds:
|
||||
logger.info("Running %s", cmd)
|
||||
p = subprocess.Popen(cmd, shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
logger.error("Error while running %s", cmd)
|
||||
sys.exit(1)
|
||||
|
||||
for i in range(10):
|
||||
p = subprocess.Popen("{} push --force {} {}".format(GIT, LIEF_PACKAGE_SSH_REPO, target_branch),
|
||||
shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
p.wait()
|
||||
|
||||
if p.returncode == 0:
|
||||
break
|
||||
|
||||
cmds = [
|
||||
"{} branch -a -v".format(GIT),
|
||||
"{} fetch -v origin {}".format(GIT, target_branch),
|
||||
"{} branch -a -v".format(GIT),
|
||||
"{} rebase -s recursive -X theirs FETCH_HEAD".format(GIT),
|
||||
"{} branch -a -v".format(GIT),
|
||||
]
|
||||
for c in cmds:
|
||||
p = subprocess.Popen(c, shell=True, cwd=LIEF_PACKAGE_DIR, stderr=subprocess.STDOUT)
|
||||
p.wait()
|
||||
else:
|
||||
logger.critical("Can't push file on %s -> %s", LIEF_PACKAGE_SSH_REPO, target_branch)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
output_key_path.unlink()
|
||||
logger.info("Done!")
|
||||
|
||||
@@ -1,181 +0,0 @@
|
||||
#! /bin/bash
|
||||
## vim:set ts=4 sw=4 et:
|
||||
|
||||
#
|
||||
# Automatic build of LIEF
|
||||
# Repo: https://github.com/lief-project/packages
|
||||
# Mostly inspired by https://github.com/upx/upx-automatic-builds
|
||||
|
||||
set -e; set -o pipefail
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||
argv0=$0; argv0abs=$(greadlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||
else
|
||||
argv0=$0; argv0abs=$(readlink -en -- "$0"); argv0dir=$(dirname "$argv0abs")
|
||||
fi
|
||||
set -x # debug
|
||||
|
||||
if [[ $TRAVIS_OS_NAME == osx ]]; then
|
||||
# use GNU coreutils ("brew install coreutils")
|
||||
date() {
|
||||
gdate "$@"
|
||||
}
|
||||
readlink() {
|
||||
greadlink "$@"
|
||||
}
|
||||
sha256sum() {
|
||||
gsha256sum "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||
openssl() {
|
||||
/usr/bin/openssl "$@"
|
||||
}
|
||||
sort() {
|
||||
/usr/bin/sort "$@"
|
||||
}
|
||||
fi
|
||||
|
||||
fix_home_ssh_perms() {
|
||||
if [[ -d ~/.ssh ]]; then
|
||||
if [[ -x /usr/sbin/restorecon ]]; then
|
||||
/usr/sbin/restorecon -v -R ~/.ssh || true
|
||||
fi
|
||||
chmod -c -R go-rwx ~/.ssh || true
|
||||
fi
|
||||
}
|
||||
|
||||
# =================
|
||||
# SETUP BRANCH NAME
|
||||
# =================
|
||||
branch=
|
||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||
branch=$APPVEYOR_REPO_BRANCH
|
||||
if [[ -n $APPVEYOR_PULL_REQUEST_NUMBER ]]; then exit 0; fi
|
||||
else
|
||||
branch=$TRAVIS_BRANCH
|
||||
if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit 0; fi
|
||||
fi
|
||||
|
||||
case $branch in
|
||||
devel*) ;;
|
||||
master*) ;;
|
||||
deploy*) ;;
|
||||
*) exit 0;;
|
||||
esac
|
||||
|
||||
# get $rev, $branch and $git_user
|
||||
LIEF_SRCDIR=
|
||||
[[ -z $LIEF_SRCDIR ]] && LIEF_SRCDIR=$(readlink -mn -- $argv0dir/..)
|
||||
cd / && cd $LIEF_SRCDIR || exit 1
|
||||
rev=$(git rev-parse --verify HEAD)
|
||||
timestamp=$(git log -n1 --format='%at' $rev)
|
||||
date=$(TZ=UTC0 date -d "@$timestamp" '+%Y%m%d-%H%M%S')
|
||||
#branch="$branch-$date-${rev:0:6}"
|
||||
branch="lief-$branch-latest"
|
||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||
branch="$branch"
|
||||
git_user="AppVeyor CI"
|
||||
else
|
||||
branch="$branch"
|
||||
git_user="Travis CI"
|
||||
fi
|
||||
unset timestamp date
|
||||
|
||||
# ========================
|
||||
# SETUP 'deploy' DIRECTORY
|
||||
# ========================
|
||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||
[[ -z $LIEF_BUILDDIR ]] && LIEF_BUILDDIR=$(readlink -mn -- .)
|
||||
else
|
||||
[[ -z $LIEF_BUILDDIR ]] && LIEF_BUILDDIR=$(readlink -mn -- ./build)
|
||||
fi
|
||||
echo $LIEF_BUILDDIR
|
||||
cd / && cd $LIEF_BUILDDIR || exit 1
|
||||
|
||||
mkdir deploy || exit 1
|
||||
chmod 700 deploy
|
||||
cd deploy || exit 1
|
||||
|
||||
# ==================
|
||||
# CLONE - ADD - PUSH
|
||||
# ==================
|
||||
new_branch=0
|
||||
if ! git clone -b "$branch" --single-branch https://github.com/lief-project/packages.git; then
|
||||
git clone -b master --single-branch https://github.com/lief-project/packages.git
|
||||
new_branch=1
|
||||
fi
|
||||
cd packages || exit 1
|
||||
chmod 700 .git
|
||||
|
||||
git config user.name "$git_user"
|
||||
git config user.email "lief@quarkslab.com"
|
||||
|
||||
if [[ $new_branch == 1 ]]; then
|
||||
git checkout --orphan "$branch"
|
||||
git reset --hard || true
|
||||
fi
|
||||
|
||||
git reset --soft `git rev-list --all | tail -1`
|
||||
git ls-files -v
|
||||
|
||||
|
||||
/bin/cp -rf $LIEF_BUILDDIR/api/python/dist/*.zip .
|
||||
/bin/cp -rf $LIEF_BUILDDIR/api/python/dist/*.egg .
|
||||
|
||||
if [[ -n $APPVEYOR_JOB_ID ]]; then
|
||||
/bin/cp -rf $LIEF_BUILDDIR/*.zip .
|
||||
else
|
||||
/bin/cp -rf $LIEF_BUILDDIR/*.tar.gz .
|
||||
fi
|
||||
|
||||
git add .
|
||||
|
||||
if git diff --cached --exit-code --quiet >/dev/null; then
|
||||
# nothing to do ???
|
||||
exit 0
|
||||
fi
|
||||
|
||||
now=$(date '+%s')
|
||||
|
||||
git commit --date="$now" -m "Automatic build - ${rev:0:7} - Python ${PYTHON_VERSION}"
|
||||
git ls-files -v
|
||||
git log --pretty=fuller
|
||||
|
||||
umask 077
|
||||
[[ -d ~/.ssh ]] || mkdir ~/.ssh
|
||||
fix_home_ssh_perms
|
||||
repo=$(git config remote.origin.url)
|
||||
ssh_repo=${repo/https:\/\/github.com\//git@github.com:}
|
||||
eval $(ssh-agent -s)
|
||||
set +x # IMPORTANT
|
||||
openssl aes-256-cbc -K $LIEF_AUTOMATIC_BUILDS_KEY -iv $LIEF_AUTOMATIC_BUILDS_IV -in "$LIEF_SRCDIR/.github/deploy-key.enc" -out .git/deploy-key -d
|
||||
set -x
|
||||
chmod 600 .git/deploy-key
|
||||
ssh-add .git/deploy-key
|
||||
fix_home_ssh_perms
|
||||
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
|
||||
fix_home_ssh_perms
|
||||
#
|
||||
let i=0 || true
|
||||
while true; do
|
||||
if [[ $i -ge 10 ]]; then
|
||||
echo "ERROR: git push failed"
|
||||
exit 1
|
||||
fi
|
||||
if [[ $new_branch == 1 ]]; then
|
||||
if git push --force -u $ssh_repo "$branch"; then break; fi
|
||||
else
|
||||
if git push --force $ssh_repo "$branch"; then break; fi
|
||||
fi
|
||||
git branch -a -v
|
||||
git fetch -v origin "$branch"
|
||||
git branch -a -v
|
||||
git rebase -s recursive -X theirs FETCH_HEAD
|
||||
git branch -a -v
|
||||
sleep $((RANDOM % 5 + 1))
|
||||
let i+=1
|
||||
done
|
||||
|
||||
exit 0
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 137 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 171 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
@@ -0,0 +1,42 @@
|
||||
""" Build index from directory listing
|
||||
From: https://stackoverflow.com/questions/39048654/how-to-enable-directory-indexing-on-github-pages
|
||||
|
||||
make_index.py </path/to/directory>
|
||||
"""
|
||||
|
||||
INDEX_TEMPLATE = r"""
|
||||
<html>
|
||||
<title>Links for lief</title>
|
||||
<body>
|
||||
<h1>Links for lief</h1>
|
||||
% for name in names:
|
||||
<a href="${base_url}/${base}/${name}">${name}</a><br />
|
||||
% endfor
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
EXCLUDED = ['index.html', '.gitkeep']
|
||||
BASE_URL = "https://lief-project.github.io"
|
||||
|
||||
import os
|
||||
import argparse
|
||||
|
||||
# May need to do "pip install mako"
|
||||
from mako.template import Template
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("directory")
|
||||
parser.add_argument("--base")
|
||||
parser.add_argument("--output")
|
||||
args = parser.parse_args()
|
||||
fnames = [fname for fname in sorted(os.listdir(args.directory))
|
||||
if fname not in EXCLUDED]
|
||||
html = Template(INDEX_TEMPLATE).render(names=fnames, base_url=BASE_URL, base=args.base)
|
||||
with open(args.output, "w") as f:
|
||||
f.write(html)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -0,0 +1,138 @@
|
||||
# Launch Docker CI when committing
|
||||
# Inspired from https://medium.com/@zypherman/my-experiences-with-travis-ci-7f5ea26a87c0
|
||||
|
||||
import requests
|
||||
import json
|
||||
import time
|
||||
import sys
|
||||
import logging
|
||||
import pprint
|
||||
import os
|
||||
|
||||
LOG_LEVEL = logging.INFO
|
||||
|
||||
logging.getLogger().addHandler(logging.StreamHandler())
|
||||
logging.getLogger().setLevel(LOG_LEVEL)
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
AUTH_TOKEN = os.getenv("TRAVIS_TOKEN", sys.argv[1] if len(sys.argv) > 1 else None)
|
||||
|
||||
if not AUTH_TOKEN:
|
||||
logger.error("No token found!")
|
||||
sys.exit(1)
|
||||
|
||||
LIEF_ID = 12579556
|
||||
DOCKER_ID = 15139981
|
||||
|
||||
ENDPOINT = 'https://api.travis-ci.org'
|
||||
|
||||
LIEF = f"{ENDPOINT}/repo/{LIEF_ID}"
|
||||
DOCKER = f"{ENDPOINT}/repo/{DOCKER_ID}"
|
||||
|
||||
DOCKER_ENV_VARS_ENDPOINT = f"{DOCKER}/env_vars"
|
||||
|
||||
headers = {
|
||||
'Content-Type': 'application/json',
|
||||
'Accept': 'application/json',
|
||||
'User-Agent': 'API Explorer',
|
||||
'Travis-API-Version': '3',
|
||||
'Authorization': f'token {AUTH_TOKEN}'
|
||||
}
|
||||
|
||||
def last_docker_build():
|
||||
response = requests.get(f"{DOCKER}/branch/master", headers=headers)
|
||||
|
||||
if not response.ok:
|
||||
logging.error("Error while getting last_docker_build")
|
||||
sys.exit(1)
|
||||
|
||||
href = response.json()["last_build"]["@href"]
|
||||
build_info = requests.get(f"{ENDPOINT}{href}", headers=headers)
|
||||
|
||||
if not build_info.ok:
|
||||
logging.error("Error while getting build_info")
|
||||
sys.exit(1)
|
||||
|
||||
return build_info.json()
|
||||
|
||||
|
||||
|
||||
def trigger_build():
|
||||
response = requests.get(f"{DOCKER}/branch/master", headers=headers)
|
||||
build_info = last_docker_build()
|
||||
|
||||
pprint.pprint(build_info)
|
||||
|
||||
# Get last build info
|
||||
last_build_id = build_info["id"]
|
||||
last_build_status = build_info["state"]
|
||||
|
||||
# Create env variables
|
||||
env_vars = [
|
||||
{
|
||||
"env_var.name": "TRIGGER_COMMIT",
|
||||
"env_var.value": os.getenv("TRAVIS_COMMIT"),
|
||||
"env_var.public": False,
|
||||
},
|
||||
{
|
||||
"env_var.name": "TRIGGER_REPO",
|
||||
"env_var.value": os.getenv("TRAVIS_REPO_SLUG"),
|
||||
"env_var.public": False,
|
||||
},
|
||||
{
|
||||
"env_var.name": "TRIGGER_ACTION",
|
||||
"env_var.value": "build-doc",
|
||||
"env_var.public": False,
|
||||
},
|
||||
{
|
||||
"env_var.name": "DEPENDENT_BUILD",
|
||||
"env_var.value": "true",
|
||||
"env_var.public": False,
|
||||
},
|
||||
]
|
||||
|
||||
env_vars_results = requests.get(DOCKER_ENV_VARS_ENDPOINT, headers=headers)
|
||||
if not env_vars_results.ok:
|
||||
logger.error("Error while getting Docker env variables")
|
||||
sys.exit(1)
|
||||
env_vars_remote = env_vars_results.json()["env_vars"]
|
||||
|
||||
# Set env variables
|
||||
for env_var in env_vars:
|
||||
remote_var = next(filter(lambda v : v["name"] == env_var["env_var.name"], env_vars_remote), None)
|
||||
if remote_var:
|
||||
r = requests.patch(f"{DOCKER}/env_var/{remote_var['id']}", data=json.dumps(env_var), headers=headers)
|
||||
if not r.ok:
|
||||
logger.error(f"Error while setting variable: '{remote_var['name']}'")
|
||||
sys.exit(1)
|
||||
else:
|
||||
result = requests.post(DOCKER_ENV_VARS_ENDPOINT, data=json.dumps(env_var), headers=headers)
|
||||
if not result.ok:
|
||||
logger.error(f"Error while setting variable: '{env_var['env_var.name']}'")
|
||||
sys.exit(1)
|
||||
|
||||
# (Re)Start build
|
||||
result = requests.post(f"{ENDPOINT}/build/{last_build_id}/restart", headers=headers)
|
||||
if not result.ok:
|
||||
logger.error("Error while restarting the build")
|
||||
sys.exit(1)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
is_pull_request = not (os.getenv("TRAVIS_PULL_REQUEST", "false") == "false")
|
||||
|
||||
if is_pull_request:
|
||||
logger.info("Skipping pull request build...")
|
||||
return 0
|
||||
|
||||
return trigger_build()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,63 @@
|
||||
name: 'Android'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: android-${{ runner.os }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
android-${{ runner.os }}-
|
||||
- name: Build ARM SDK
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
--rm liefproject/android-arm bash /work/scripts/docker/android-arm.sh
|
||||
- name: Build AArch64 SDK
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
--rm liefproject/android-arm64 bash /work/scripts/docker/android-aarch64.sh
|
||||
- name: Deploy
|
||||
env:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY: ${{ secrets.LIEF_AUTOMATIC_BUILDS_KEY }}
|
||||
LIEF_AUTOMATIC_BUILDS_IV: ${{ secrets.LIEF_AUTOMATIC_BUILDS_IV }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-e GITHUB_ACTIONS="true" \
|
||||
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
|
||||
-e GITHUB_REF=$GITHUB_REF \
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
name: 'iOS'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
osx-sdk:
|
||||
runs-on: macos-11.0
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- 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: |
|
||||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
|
||||
shell: bash
|
||||
- name: Setup cache dir
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: ios-${{ runner.os }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
ios-${{ runner.os }}-
|
||||
- name: Build iOS SDK
|
||||
shell: bash
|
||||
env:
|
||||
CCACHE_DIR: ~/.ccache
|
||||
CCACHE_MAXSIZE: 10.0G
|
||||
CCACHE_CPP2: 1
|
||||
CCACHE_COMPRESS: 1
|
||||
run: |
|
||||
bash scripts/osx/package_ios.sh
|
||||
- name: Deploy
|
||||
env:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY: ${{ secrets.LIEF_AUTOMATIC_BUILDS_KEY }}
|
||||
LIEF_AUTOMATIC_BUILDS_IV: ${{ secrets.LIEF_AUTOMATIC_BUILDS_IV }}
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade requests mako
|
||||
python .github/deploy.py
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
name: 'Linux AArch64'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
linux-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.7, 3.8, 3.9]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: linux-aarch64-${{ runner.os }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-aarch64-${{ runner.os }}-
|
||||
- name: Build SDK
|
||||
if: matrix.python-version == '3.9'
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
--rm liefproject/manylinux2014-aarch64 bash /work/scripts/docker/linux-aarch64.sh
|
||||
- name: Build Python ${{ matrix.python-version }} wheel
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: ${{ matrix.python-version }}
|
||||
run: |
|
||||
PYTHON_VERSION2=$(echo "${PYTHON_VERSION}" | sed 's/\.//') # Transform 3.8 -> 38
|
||||
docker run \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_CPP2=1 \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-e PYTHON_BINARY=/opt/python/cp${PYTHON_VERSION2}-cp${PYTHON_VERSION2}/bin/python${PYTHON_VERSION} \
|
||||
-v $GITHUB_WORKSPACE:/work \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
--rm liefproject/manylinux2014-aarch64 bash /work/scripts/docker/manylinux2014-aarch64.sh
|
||||
- name: Deploy
|
||||
env:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY: ${{ secrets.LIEF_AUTOMATIC_BUILDS_KEY }}
|
||||
LIEF_AUTOMATIC_BUILDS_IV: ${{ secrets.LIEF_AUTOMATIC_BUILDS_IV }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-e GITHUB_ACTIONS="true" \
|
||||
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
|
||||
-e GITHUB_REF=$GITHUB_REF \
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
name: 'Linux x86-64'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
linux-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Get Date
|
||||
id: get-date
|
||||
run: |
|
||||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
|
||||
shell: bash
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: linux-x86-64-${{ runner.os }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
linux-x86-64-${{ runner.os }}-
|
||||
- name: Build Python 3.7 wheel
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: 37
|
||||
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/cp37-cp37m/bin/python3.7 \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux1_x86_64 bash /src/scripts/docker/travis-linux.sh
|
||||
- name: Build Python 3.8 wheel
|
||||
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/manylinux1_x86_64 bash /src/scripts/docker/travis-linux.sh
|
||||
- name: Build Python 3.9 wheel
|
||||
shell: bash
|
||||
env:
|
||||
PYTHON_VERSION: 39
|
||||
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/cp39-cp39/bin/python3.9 \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux1_x86_64 bash /src/scripts/docker/travis-linux.sh
|
||||
- name: Build SDK
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --name lief_sdk --rm \
|
||||
-e PYTHON_BINARY=/opt/python/cp39-cp39/bin/python3.9 \
|
||||
-e CCACHE_COMPRESS=1 \
|
||||
-e CCACHE_MAXSIZE=10.0G \
|
||||
-e CCACHE_DIR=/ccache \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-v $HOME/.ccache:/ccache \
|
||||
liefproject/manylinux1_x86_64 bash /src/scripts/docker/travis-linux-sdk.sh
|
||||
- name: Deploy
|
||||
env:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY: ${{ secrets.LIEF_AUTOMATIC_BUILDS_KEY }}
|
||||
LIEF_AUTOMATIC_BUILDS_IV: ${{ secrets.LIEF_AUTOMATIC_BUILDS_IV }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker run \
|
||||
-v $GITHUB_WORKSPACE:/src \
|
||||
-e GITHUB_ACTIONS="true" \
|
||||
-e GITHUB_WORKSPACE=$GITHUB_WORKSPACE \
|
||||
-e GITHUB_REF=$GITHUB_REF \
|
||||
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py
|
||||
- name: Trigger documentation
|
||||
env:
|
||||
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
|
||||
shell: bash
|
||||
run: |
|
||||
docker run --rm \
|
||||
-e CIRCLE_CI_TOKEN=$CIRCLE_CI_TOKEN \
|
||||
liefproject/manylinux1_x86_64 \
|
||||
bash -c "curl --request POST --url https://circleci.com/api/v2/project/gh/lief-project/doc/pipeline --header 'Circle-Token: ${CIRCLE_CI_TOKEN}' --header 'content-type: application/json'";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
name: 'macOS'
|
||||
on: push
|
||||
|
||||
jobs:
|
||||
osx-sdk:
|
||||
runs-on: macos-11.0
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.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: |
|
||||
echo "::set-output name=date::$(/bin/date -u "+%Y-%m-%d-%H;%M;%S")"
|
||||
shell: bash
|
||||
- name: Setup cache dir
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/.ccache
|
||||
- name: ccache cache files
|
||||
uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ~/.ccache
|
||||
key: osx-${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.date }}
|
||||
restore-keys: |
|
||||
osx-${{ runner.os }}-${{ matrix.python-version }}-
|
||||
osx-${{ runner.os }}-
|
||||
- name: Build Python ${{ matrix.python-version }} wheel
|
||||
shell: bash
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.14"
|
||||
CCACHE_DIR: ~/.ccache
|
||||
CCACHE_MAXSIZE: 10.0G
|
||||
CCACHE_CPP2: 1
|
||||
CCACHE_COMPRESS: 1
|
||||
run: |
|
||||
python ./setup.py --ninja build bdist_wheel --skip-build --plat-name=macosx_${MACOSX_DEPLOYMENT_TARGET}_x86_64
|
||||
- name: Build SDK
|
||||
shell: bash
|
||||
if: matrix.python-version == '3.9' # Build the SDk only with Python 3.9
|
||||
env:
|
||||
MACOSX_DEPLOYMENT_TARGET: "10.14"
|
||||
CCACHE_DIR: ~/.ccache
|
||||
CCACHE_MAXSIZE: 10.0G
|
||||
CCACHE_CPP2: 1
|
||||
CCACHE_COMPRESS: 1
|
||||
run: |
|
||||
bash scripts/osx/package_sdk.sh
|
||||
- name: Deploy
|
||||
env:
|
||||
LIEF_AUTOMATIC_BUILDS_KEY: ${{ secrets.LIEF_AUTOMATIC_BUILDS_KEY }}
|
||||
LIEF_AUTOMATIC_BUILDS_IV: ${{ secrets.LIEF_AUTOMATIC_BUILDS_IV }}
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade requests mako
|
||||
python .github/deploy.py
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: LIEF Windows Tests
|
||||
|
||||
on: [pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.8]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
choco install ninja
|
||||
python -m pip install --upgrade pip setuptools
|
||||
python -m pip install wheel mako
|
||||
- uses: ilammy/msvc-dev-cmd@v1
|
||||
with:
|
||||
toolset: "14.16"
|
||||
- name: Build and Test
|
||||
run: |
|
||||
python ./setup.py --ninja --lief-test bdist_wheel
|
||||
shell: cmd
|
||||
|
||||
|
||||
+292
-201
@@ -1,231 +1,322 @@
|
||||
language: cpp
|
||||
|
||||
git:
|
||||
depth: false
|
||||
|
||||
matrix:
|
||||
jobs:
|
||||
include:
|
||||
# Linux gcc 5.0 - Python 2.7
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['g++-5', 'ccache', 'libpython2.7']
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=g++-5 ,
|
||||
C_COMPILER=gcc-5 ,
|
||||
PYTHON_VERSION=2.7 ,
|
||||
PYTHON_INCLUDE_DIR=/usr/include/python2.7 ,
|
||||
PYTHON_LIBRARY=/usr/lib/libpython2.7.so ,
|
||||
PYTHON_BINARY=/usr/bin/python2.7 ,
|
||||
LIEF_TEST_STATIC=ON ,
|
||||
LIEF_TEST_SHARED=OFF ,
|
||||
]
|
||||
- if: branch = master AND tag IS present
|
||||
services: docker
|
||||
name: "Linux Python 3.5"
|
||||
script:
|
||||
- >
|
||||
docker run --name lief_35
|
||||
-e PYTHON_BINARY=/opt/python/cp35-cp35m/bin/python3.5
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux.sh
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
docker run \
|
||||
-v $TRAVIS_BUILD_DIR:/src \
|
||||
-e TRAVIS="true" \
|
||||
-e TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE \
|
||||
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
||||
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py;
|
||||
fi
|
||||
|
||||
|
||||
# Linux gcc 5.0 - Python 3.5
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'deadsnakes']
|
||||
packages: ['g++-5', 'gcc-5', 'ccache', 'python3.5-dev']
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=g++-5 ,
|
||||
C_COMPILER=gcc-5 ,
|
||||
PYTHON_VERSION=3.5 ,
|
||||
PYTHON_INCLUDE_DIR=/usr/include/python3.5m ,
|
||||
PYTHON_LIBRARY=/usr/lib/libpython3.5m.so ,
|
||||
PYTHON_BINARY=/usr/bin/python3.5 ,
|
||||
LIEF_TEST_STATIC=OFF ,
|
||||
LIEF_TEST_SHARED=ON ,
|
||||
]
|
||||
- if: branch = master AND tag IS present
|
||||
services: docker
|
||||
name: "Linux Python 3.6"
|
||||
script:
|
||||
- >
|
||||
docker run --name lief_36
|
||||
-e PYTHON_BINARY=/opt/python/cp36-cp36m/bin/python3.6
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux.sh
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
docker run \
|
||||
-v $TRAVIS_BUILD_DIR:/src \
|
||||
-e TRAVIS="true" \
|
||||
-e TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE \
|
||||
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
||||
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py;
|
||||
fi
|
||||
|
||||
- services: docker
|
||||
name: "Linux Python 3.7 | SDK | Doc Trigger"
|
||||
script:
|
||||
- >
|
||||
docker run --name lief_37
|
||||
-e PYTHON_BINARY=/opt/python/cp37-cp37m/bin/python3.7
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux.sh
|
||||
- >
|
||||
docker run --name lief_sdk
|
||||
-e PYTHON_BINARY=$PYTHON_BINARY
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux-sdk.sh
|
||||
- >
|
||||
sudo chmod -R 777 $TRAVIS_BUILD_DIR/build &&
|
||||
sudo chown -R 1000:1000 $TRAVIS_BUILD_DIR/build
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
docker run \
|
||||
-v $TRAVIS_BUILD_DIR:/src \
|
||||
-e TRAVIS="true" \
|
||||
-e TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE \
|
||||
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
||||
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py;
|
||||
fi
|
||||
after_success:
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]];
|
||||
then
|
||||
docker run --rm
|
||||
-e CIRCLE_CI_TOKEN=$CIRCLE_CI_TOKEN
|
||||
liefproject/manylinux1_x86_64
|
||||
bash -c "curl --request POST --url https://circleci.com/api/v2/project/gh/lief-project/doc/pipeline --header 'Circle-Token: ${CIRCLE_CI_TOKEN}' --header 'content-type: application/json'";
|
||||
fi
|
||||
|
||||
- services: docker
|
||||
name: "Linux Python 3.8"
|
||||
script:
|
||||
- >
|
||||
docker run --name lief_38
|
||||
-e PYTHON_BINARY=/opt/python/cp38-cp38/bin/python3.8
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux.sh
|
||||
- >
|
||||
sudo chmod -R 777 $TRAVIS_BUILD_DIR/build &&
|
||||
sudo chown -R 1000:1000 $TRAVIS_BUILD_DIR/build
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
docker run \
|
||||
-v $TRAVIS_BUILD_DIR:/src \
|
||||
-e TRAVIS="true" \
|
||||
-e TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE \
|
||||
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
||||
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py;
|
||||
fi
|
||||
- services: docker
|
||||
name: "Linux Python 3.9"
|
||||
script:
|
||||
- >
|
||||
docker run --name lief_39
|
||||
-e PYTHON_BINARY=/opt/python/cp39-cp39/bin/python3.9
|
||||
-e CCACHE_DIR=/ccache
|
||||
-v $HOME/.ccache:/ccache
|
||||
-v $TRAVIS_BUILD_DIR:/src
|
||||
liefproject/manylinux1_x86_64
|
||||
bash /src/scripts/docker/travis-linux.sh
|
||||
- >
|
||||
sudo chmod -R 777 $TRAVIS_BUILD_DIR/build &&
|
||||
sudo chown -R 1000:1000 $TRAVIS_BUILD_DIR/build
|
||||
- >
|
||||
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
docker run \
|
||||
-v $TRAVIS_BUILD_DIR:/src \
|
||||
-e TRAVIS="true" \
|
||||
-e TRAVIS_EVENT_TYPE=$TRAVIS_EVENT_TYPE \
|
||||
-e TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
||||
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
|
||||
-e TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR \
|
||||
-e LIEF_AUTOMATIC_BUILDS_KEY=$LIEF_AUTOMATIC_BUILDS_KEY \
|
||||
-e LIEF_AUTOMATIC_BUILDS_IV=$LIEF_AUTOMATIC_BUILDS_IV \
|
||||
--rm \
|
||||
liefproject/deploy python3 /src/.github/deploy.py;
|
||||
fi
|
||||
|
||||
## macOS 10.14.6 - xcode 11 - Python 3.5
|
||||
#- if: branch = master AND tag IS present AND type = push
|
||||
# os: osx
|
||||
# osx_image: xcode11
|
||||
# compiler: clang
|
||||
# script:
|
||||
# - pyenv install --skip-existing 3.5.0
|
||||
# - >
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.5.0/bin/python3.5 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel &&
|
||||
# $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
# after_success:
|
||||
# - >
|
||||
# if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.5.0/bin/python3.5 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools requests mako wheel &&
|
||||
# cd $TRAVIS_BUILD_DIR &&
|
||||
# bash ./.github/deploy.sh;
|
||||
# fi
|
||||
|
||||
## macOS 10.14.6 - xcode 11 - Python 3.6
|
||||
#- if: branch = master AND tag IS present AND type = push
|
||||
# os: osx
|
||||
# osx_image: xcode11
|
||||
# compiler: clang
|
||||
# script:
|
||||
# - pyenv install --skip-existing 3.6.0
|
||||
# - >
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.6.0/bin/python3.6 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel &&
|
||||
# $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
# after_success:
|
||||
# - >
|
||||
# if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.6.0/bin/python3.6 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools requests mako wheel &&
|
||||
# cd $TRAVIS_BUILD_DIR &&
|
||||
# bash ./.github/deploy.sh;
|
||||
# fi
|
||||
|
||||
|
||||
# Linux gcc 6 - Python 3.6
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: gcc
|
||||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'deadsnakes']
|
||||
packages: ['g++-6', 'gcc-6', 'ccache', 'python3.6-dev']
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=g++-6 ,
|
||||
C_COMPILER=gcc-6 ,
|
||||
PYTHON_VERSION=3.6 ,
|
||||
PYTHON_INCLUDE_DIR=/usr/include/python3.6m ,
|
||||
PYTHON_LIBRARY=/usr/lib/libpython3.6m.so ,
|
||||
PYTHON_BINARY=/usr/bin/python3.6 ,
|
||||
LIEF_TEST_STATIC=ON ,
|
||||
LIEF_TEST_SHARED=ON ,
|
||||
]
|
||||
## macOS 10.14.6 - xcode 11 - Python 3.7
|
||||
#- os: osx
|
||||
# osx_image: xcode11
|
||||
# compiler: clang
|
||||
# script:
|
||||
# - pyenv install --skip-existing 3.7.0
|
||||
# - >
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.7.0/bin/python3.7 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel &&
|
||||
# $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
# after_success:
|
||||
# - >
|
||||
# if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.7.0/bin/python3.7 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools requests mako wheel &&
|
||||
# cd $TRAVIS_BUILD_DIR &&
|
||||
# bash ./.github/deploy.sh;
|
||||
# fi
|
||||
|
||||
# OSX 10.11 - xcode 7.3 - Python 2.7
|
||||
- os: osx
|
||||
osx_image: xcode7.3
|
||||
compiler: clang
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=clang++ ,
|
||||
C_COMPILER=clang ,
|
||||
PYTHON_VERSION=2.7 ,
|
||||
LIEF_TEST_STATIC=ON ,
|
||||
LIEF_TEST_SHARED=OFF ,
|
||||
]
|
||||
# macOS 10.14.6 - xcode 11 - Python 3.8
|
||||
#- os: osx
|
||||
# osx_image: xcode11
|
||||
# compiler: clang
|
||||
# name: "OSX Python 3.8"
|
||||
# script:
|
||||
# - pyenv install --skip-existing 3.8.0
|
||||
# - >
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.8.0/bin/python3.8 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel &&
|
||||
# $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
# after_success:
|
||||
# - >
|
||||
# if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.8.0/bin/python3.8 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools requests mako wheel &&
|
||||
# cd $TRAVIS_BUILD_DIR &&
|
||||
# bash ./.github/deploy.sh;
|
||||
# fi
|
||||
|
||||
# OSX 10.12 - xcode 8.2 - Python 3.5
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: clang
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=clang++ ,
|
||||
C_COMPILER=clang ,
|
||||
PYTHON_VERSION=3.5 ,
|
||||
LIEF_TEST_STATIC=OFF ,
|
||||
LIEF_TEST_SHARED=ON ,
|
||||
]
|
||||
## macOS 10.14.6 - xcode 11 - Python 3.9
|
||||
#- os: osx
|
||||
# osx_image: xcode11
|
||||
# compiler: clang
|
||||
# name: "OSX Python 3.9 | SDK"
|
||||
# script:
|
||||
# - pyenv install --skip-existing 3.9.0
|
||||
# - >
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools wheel &&
|
||||
# $PYTHON_BINARY ./setup.py --ninja --lief-test build bdist_wheel
|
||||
# - bash scripts/osx/package_sdk.sh
|
||||
# after_success:
|
||||
# - >
|
||||
# if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" ]]; then
|
||||
# export PYTHON_BINARY=$(pyenv root)/versions/3.9.0/bin/python3.9 &&
|
||||
# sudo $PYTHON_BINARY -m pip install --upgrade pip setuptools requests mako wheel &&
|
||||
# cd $TRAVIS_BUILD_DIR &&
|
||||
# bash ./.github/deploy.sh;
|
||||
# fi
|
||||
|
||||
|
||||
## OSX 10.12 - xcode 8.2 - Python 3.6
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
compiler: clang
|
||||
env: >
|
||||
[
|
||||
CXX_COMPILER=clang++ ,
|
||||
C_COMPILER=clang ,
|
||||
PYTHON_VERSION=3.6 ,
|
||||
LIEF_TEST_STATIC=ON ,
|
||||
LIEF_TEST_SHARED=ON ,
|
||||
]
|
||||
|
||||
#branches:
|
||||
# only:
|
||||
# - master
|
||||
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: always
|
||||
|
||||
sudo: required
|
||||
|
||||
cache:
|
||||
- apt
|
||||
- ccache
|
||||
- $HOME/.pyenv
|
||||
- build/rang_cpp_color-prefix
|
||||
- build/mbed_tls
|
||||
- build/libjson-prefix
|
||||
- build/easyloggingpp-prefix
|
||||
- build/tests/YAMLCPP
|
||||
- build/tests/lief-samples
|
||||
- build/tests/catch
|
||||
- build/api/python/pybind11-prefix
|
||||
- ccache: true
|
||||
- directories:
|
||||
- $HOME/.pyenv
|
||||
- $HOME/.ccache
|
||||
|
||||
env:
|
||||
global:
|
||||
- USE_CCACHE=1
|
||||
- CCACHE_COMPRESS=1
|
||||
- CCACHE_MAXSIZE=10.0G
|
||||
- CCACHE_CPP2=1
|
||||
|
||||
addons:
|
||||
homebrew:
|
||||
packages:
|
||||
- pyenv
|
||||
- ccache
|
||||
- ninja
|
||||
update: true
|
||||
|
||||
before_install:
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -q; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install python-setuptools; fi
|
||||
- export CC="$C_COMPILER"
|
||||
- export CXX="$CXX_COMPILER"
|
||||
- ccache --set-config=max_size=10.0G
|
||||
- ccache --zero-stats --version
|
||||
- ccache --set-config=compiler_check=content
|
||||
- ccache -p
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then docker pull liefproject/manylinux1_x86_64:latest; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PREFIX="/usr/local"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install ccache; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
|
||||
|
||||
#- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then export PYTHON_CONFIGURE_OPTS="--enable-shared --enable-unicode=ucs2"; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv root; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv install --list ;fi
|
||||
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then pyenv install 2.7.12; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then pyenv install 3.5.0; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then pyenv install 3.6.0b4; fi
|
||||
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/2.7.12/include/python2.7 ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/2.7.12/lib/libpython2.7.dylib ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/2.7.12/bin/python2.7 ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then $PYTHON_BINARY -m pip install --upgrade pip ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "2.7" ]]; then $PYTHON_BINARY -m pip install --upgrade setuptools ;fi
|
||||
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.5.0/include/python3.5m ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.5.0/lib/libpython3.dylib ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.5" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.5.0/bin/python3.5 ;fi
|
||||
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_INCLUDE_DIR=$(pyenv root)/versions/3.6.0b4/include/python3.6m ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_LIBRARY=$(pyenv root)/versions/3.6.0b4/lib/libpython3.dylib ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$PYTHON_VERSION" == "3.6" ]]; then export PYTHON_BINARY=$(pyenv root)/versions/3.6.0b4/bin/python3.6 ;fi
|
||||
|
||||
install:
|
||||
- if [ "$GCOV" == "ON" ]; then sudo ln -sf /usr/bin/gcov-5 /usr/bin/gcov; fi
|
||||
- if [ "$GCOV" == "ON" ]; then wget http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.13.orig.tar.gz; fi
|
||||
- if [ "$GCOV" == "ON" ]; then tar xf lcov_1.13.orig.tar.gz; fi
|
||||
- if [ "$GCOV" == "ON" ]; then sudo make -C lcov-1.13/ install; fi
|
||||
|
||||
# Setup CMake 3.1 for Linux
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate http://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then tar -xzf cmake-3.7.2-Linux-x86_64.tar.gz ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export PATH=$PWD/cmake-3.7.2-Linux-x86_64/bin:$PATH ;fi
|
||||
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py ;fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo $PYTHON_BINARY ./get-pip.py ;fi
|
||||
|
||||
# Prepare build
|
||||
- mkdir build
|
||||
- cd build
|
||||
|
||||
|
||||
script:
|
||||
- >
|
||||
cmake
|
||||
-DCMAKE_C_COMPILER=$C_COMPILER
|
||||
-DCMAKE_CXX_COMPILER=$CXX_COMPILER
|
||||
-DPYTHON_VERSION=$PYTHON_VERSION
|
||||
-DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE_DIR
|
||||
-DPYTHON_LIBRARY=$PYTHON_LIBRARY
|
||||
-DPYTHON_EXECUTABLE=$PYTHON_BINARY
|
||||
-DLIEF_TESTS=on
|
||||
-DLIEF_PYTHON_API=on
|
||||
-DLIEF_EXAMPLES=on
|
||||
-DLIEF_TEST_SHARED=$LIEF_TEST_SHARED
|
||||
-DLIEF_TEST_STATIC=$LIEF_TEST_STATIC
|
||||
..
|
||||
- make -j3 lief_samples
|
||||
- cmake ..
|
||||
- make -j3 all
|
||||
- make -j3 check-lief
|
||||
|
||||
#- sudo make check-lief
|
||||
|
||||
after_success:
|
||||
- make package
|
||||
- sudo $PYTHON_BINARY -m pip install setuptools
|
||||
- sudo $PYTHON_BINARY -m pip install --upgrade setuptools
|
||||
- cd api/python
|
||||
- $PYTHON_BINARY setup.py bdist_egg
|
||||
- if [[ -z "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --dev --formats=zip ;fi
|
||||
- if [[ -n "$TRAVIS_TAG" ]]; then $PYTHON_BINARY setup.py sdist --formats=zip ;fi
|
||||
- cd $TRAVIS_BUILD_DIR
|
||||
- bash ./.github/deploy.sh
|
||||
|
||||
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
- secure: "RlyaagAWt1BrcOBDSpmOnP+/FYUJqQiURlWw7JWvuBBWBDPBta+WI1zZvH6x5H+1bm8F77LrGdU1mRES/MAlhzb8o/VHgOAFhu2si/A+A7Xa9fAIOQw12jcGbtZQUQ7HCkRfa5VGrW4IlMI5+FJ7uFUU2lLoWOsA3u8pLEwApbdiB/LmtEY+kKhXzX0bT3h9cZATDWTeEoopXOseaBmTFC9IUATE3Ht1wVP49wXRUZHNJA10PJILbKtR1OITCAKm0iu1rVdLhoMzqH3T2dXDZ5ykF9TuYQaXJzKMFHaAeSe135JYOiIEWUUiif80q/mTWXiJAQ6gQXXOyDVu6R0Hi03TKsWXPlEKDBpDCRDu58I2hJyxsc5MPbFg8IAjraXkOLIQkIpgBOfV0JYVihikOLTfbCBKO+w9RFwrEVy91YsKCDosEAUa9p5nyRoV+k9Epmr/2atlHY8z7RyycB2fNQv3/NkHX8jZesiUFUwu5SHaZD76mKGELEZlf7LW8XwL4Cwfa2OB2vsKFcN1qyGUmXS57MODVBAUubQY4oTFwFJJUv28s06KA6BfZE4QqAeWoRSslDr9ORLUlsHHoCpZrAAY0uyl8kff/jL8IJMd8qng9bBTLu8hiK0yyQWKkebMvMWXhvAjssXeqWt3OeL2mssbUG5N1pXt6eHFmQvxqzs="
|
||||
file_glob: true
|
||||
file:
|
||||
- ${TRAVIS_BUILD_DIR}/build/api/python/dist/*.egg
|
||||
- ${TRAVIS_BUILD_DIR}/build/api/python/dist/*.zip
|
||||
- ${TRAVIS_BUILD_DIR}/build/*.tar.gz
|
||||
skip_cleanup: true
|
||||
on:
|
||||
#branch: master
|
||||
tags: true
|
||||
after_script:
|
||||
- ccache --show-stats
|
||||
|
||||
#deploy:
|
||||
# provider: releases
|
||||
# token:
|
||||
# - secure: LTJMZp9kJ9/tmv73YGktP3Bdhh3moettDNooiRlQfUEgUemRlp9K+ybbufN0ya0Md0bouOJ/7nWqFToWl1G5/kcRr4MjV/P2c+iH8W7mvWcFupLGdwm1+aqpin3hiGsdYz0a1TK37y6DANspFwHILjq1SPf5L8kGEHnYSIfyUFHaETbv7GHL+4gf1XG/55KVuyFa3vZ2BPa3sIXr4bRypdNsqssFOZ7qeoJawtcI3TbjmLqx+sOGR2aiG+9lX+/vcYVGECHOE4KdV5BbTFitDLkJ0toAQrgN4XuB6XMXEnijU0RGtpkvsUAYJUuYaNcV2ea4bwLPCKz0IJvzTw3gtyB/pioP4OUx0xY2csuNuGfppZ0Fb+BWhPx9wOg209lrPjtoWszK8vo4PywKlEUviNG+3hEYx9x382IbtbXvIxp+c2iYdRicudFIdjjSZt7fy1MwBvHhWoBRl1hVw5fpFvRIC6Q1/B6MV55Jc3LVYCs+QHPAXq2KJ1KWK/Q7mmlriG3O+dvswcE1l0/AmeqKuXLsgUMuzScYa4fMFvXL3l/B8bKw205ynMzKvbb61P3sGrJJ+AFDEoHDk8yNtSaTowoUveu75DbL1s1p02QjYeVt7AJS8AsqUm7QPcUU5iXW1gSgt50jD/46/uvK7NZCFj2LzkiVzM5JIbiUANx8pKA=
|
||||
# file_glob: true
|
||||
# file:
|
||||
# - ${TRAVIS_BUILD_DIR}/dist/*.whl
|
||||
# - ${TRAVIS_BUILD_DIR}/build/*.tar.gz
|
||||
# on:
|
||||
# tags: true
|
||||
|
||||
+444
-589
File diff suppressed because it is too large
Load Diff
+21
@@ -0,0 +1,21 @@
|
||||
# Docker file used to compile LIEF on Linux x86-64 compliant with Python tag: manylinux1
|
||||
# docker build -t liefproject/manylinux1_x86_64:latest -f ./Dockerfile .
|
||||
FROM quay.io/pypa/manylinux1_x86_64:2020-12-30-e2b3664
|
||||
|
||||
RUN yum update -y \
|
||||
&& yum install -y ccache \
|
||||
&& yum clean all
|
||||
|
||||
RUN /opt/python/cp37-cp37m/bin/pip install cmake==3.13.3 ninja==1.10.0.post2
|
||||
ENV PATH=$PATH:/opt/python/cp37-cp37m/bin/
|
||||
|
||||
RUN curl --output /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 -L https://github.com/squeaky-pl/centos-devtools/releases/download/6.3/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 && \
|
||||
echo "ca3e9f92411507018c839c8cc2b496f14956a49fcf6df0cdcb356de7161bcbc5 /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2" | sha256sum --check --status && \
|
||||
tar -C / -xj -f /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2 && \
|
||||
rm -rf /tmp/gcc-6.3.0-binutils-2.27-x86_64.tar.bz2
|
||||
|
||||
ENV CC=/opt/devtools-6.3/bin/gcc
|
||||
ENV CXX=/opt/devtools-6.3/bin/g++
|
||||
ENV CXXFLAGS="-static-libstdc++ -static-libgcc"
|
||||
|
||||
WORKDIR /src
|
||||
@@ -186,8 +186,8 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright 2017 R. Thomas
|
||||
Copyright 2017 Quarkslab
|
||||
Copyright 2017 - 2021 R. Thomas
|
||||
Copyright 2017 - 2021 Quarkslab
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
prefix="@CMAKE_INSTALL_PREFIX@"
|
||||
exec_prefix="${prefix}"
|
||||
libdir="${prefix}/lib"
|
||||
includedir="${prefix}/include"
|
||||
|
||||
Name: LIEF
|
||||
Description: Library to Instrument Executable Formats
|
||||
URL: https://github.com/lief-project/LIEF
|
||||
Version: @LIEF_VERSION_MAJOR@.@LIEF_VERSION_MINOR@.@LIEF_VERSION_PATCH@
|
||||
Requires: @PKGCONF_REQ_PUB@
|
||||
Requires.private: @PKGCONF_REQ_PRIV@
|
||||
Cflags: -I"${includedir}"
|
||||
Libs: -L"${libdir}" -lLIEF
|
||||
Libs.private: -L"${libdir}" -lLIEF @PKGCONF_LIBS_PRIV@
|
||||
@@ -0,0 +1,4 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
set(LIEF_DIR "${PACKAGE_PREFIX_DIR}")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/FindLIEF.cmake")
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
include README.md LICENSE setup.cfg CMakeLists.txt LIEF.pc.in LIEFConfig.cmake.in
|
||||
|
||||
# Examples
|
||||
recursive-include examples *
|
||||
|
||||
# LIEF Sources
|
||||
recursive-include src *
|
||||
recursive-include include *
|
||||
|
||||
recursive-include third-party *
|
||||
recursive-include cmake *
|
||||
recursive-include scripts *
|
||||
|
||||
# Bindings
|
||||
recursive-include api *
|
||||
prune api/python/build
|
||||
|
||||
# Global exclude
|
||||
recursive-exclude *.egg-info *.so
|
||||
|
||||
# Install script
|
||||
recursive-include package *
|
||||
|
||||
# Documentation
|
||||
recursive-include doc *
|
||||
|
||||
@@ -1,130 +1,116 @@
|
||||
<p align="center" >
|
||||
<img width="40%" src="http://romainthomas.fr/logo_blue_with_name_500.png"/><br />
|
||||
<img width="90%" src="https://github.com/lief-project/LIEF/blob/master/.github/images/architecture.png"/><br />
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://gitter.im/lief-project">
|
||||
<img src="https://img.shields.io/gitter/room/gitterHQ/gitter.svg">
|
||||
<img src="https://img.shields.io/gitter/room/gitterHQ/gitter.svg?style=flat-square">
|
||||
</a>
|
||||
|
||||
<a href="https://travis-ci.org/lief-project/LIEF">
|
||||
<img src="https://travis-ci.org/lief-project/LIEF.svg?branch=master">
|
||||
<a href="https://travis-ci.com/lief-project/LIEF">
|
||||
<img alt="Linux CI status" src="https://img.shields.io/travis/com/lief-project/LIEF/master?label=Linux%20x86-64&logo=travis">
|
||||
</a>
|
||||
|
||||
<a href="https://circleci.com/gh/lief-project/LIEF/tree/master">
|
||||
<img src="https://circleci.com/gh/lief-project/LIEF/tree/master.svg?style=svg">
|
||||
<a href="https://github.com/lief-project/LIEF/actions?query=workflow%3A%22Linux+AArch64%22">
|
||||
<img alt="Linux AArch64 CI status" src="https://img.shields.io/github/workflow/status/lief-project/LIEF/Linux%20AArch64/master?label=Linux%20AArch64&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions?query=workflow%3AAndroid">
|
||||
<img alt="Android CI status" src="https://img.shields.io/github/workflow/status/lief-project/LIEF/Android/master?label=Android&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions?query=workflow%3AmacOS">
|
||||
<img alt="macOS CI status" src="https://img.shields.io/github/workflow/status/lief-project/LIEF/macOS/master?label=macOS&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/actions?query=workflow%3AiOS">
|
||||
<img alt="iOS CI status" src="https://img.shields.io/github/workflow/status/lief-project/LIEF/iOS/master?label=iOS&logo=github">
|
||||
</a>
|
||||
|
||||
<a href="https://ci.appveyor.com/project/Romain/lief/branch/master">
|
||||
<img src="https://ci.appveyor.com/api/projects/status/0ijlcujac5vh8cas/branch/master?svg=true">
|
||||
<img alt="Windows CI status" src="https://img.shields.io/appveyor/build/Romain/LIEF/master?label=Windows&logo=appveyor">
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/lief-project/LIEF/releases">
|
||||
<img src="https://img.shields.io/badge/release-0.8.1-brightgreen.svg?style=default">
|
||||
<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?color=1da1f2&label=Follow&logo=twitter&logoColor=white&style=flat-square">
|
||||
</a>
|
||||
|
||||
</p>
|
||||
|
||||
# About
|
||||
|
||||
The purpose of this project is to provide a cross platform library which can parse, modify and abstract ELF, PE and MachO formats.
|
||||
|
||||
Main features:
|
||||
|
||||
* **Parsing**: LIEF can parse ELF, PE, MachO and provides an user-friendly API to access to format internals.
|
||||
* **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
|
||||
* **Abstract**: Three formats have common features like sections, symbols, entry point... LIEF factors them.
|
||||
* **API**: LIEF can be used in C, C++ and Python
|
||||
|
||||
# Content
|
||||
|
||||
- [About](#about)
|
||||
- [Download / Install](#downloads--install)
|
||||
- [Getting started](#getting-started)
|
||||
- [Documentation](#documentation)
|
||||
- [Sphinx](https://lief.quarkslab.com/doc/stable/index.html)
|
||||
- [Doxygen](https://lief.quarkslab.com/doc/latest/doxygen/index.html)
|
||||
- Tutorials:
|
||||
- [Parse and manipulate formats](https://lief.quarkslab.com/doc/latest/tutorials/01_play_with_formats.html)
|
||||
- [Create a PE from scratch](https://lief.quarkslab.com/doc/latest/tutorials/02_pe_from_scratch.html)
|
||||
- [Play with ELF symbols](https://lief.quarkslab.com/doc/latest/tutorials/03_elf_change_symbols.html)
|
||||
- [ELF Hooking](https://lief.quarkslab.com/doc/latest/tutorials/04_elf_hooking.html)
|
||||
- [Infecting the plt/got](https://lief.quarkslab.com/doc/latest/tutorials/05_elf_infect_plt_got.html)
|
||||
- [PE Hooking](https://lief.quarkslab.com/doc/latest/tutorials/06_pe_hooking.html)
|
||||
- [PE Resources](https://lief.quarkslab.com/doc/latest/tutorials/07_pe_resource.html)
|
||||
- [Transforming an ELF executable into a library](https://lief.quarkslab.com/doc/latest/tutorials/08_elf_bin2lib.html)
|
||||
- [How to use frida on a non-rooted device](https://lief.quarkslab.com/doc/latest/tutorials/09_frida_lief.html)
|
||||
- [Android formats](https://lief.quarkslab.com/doc/latest/tutorials/10_android_formats.html)
|
||||
- [Mach-O modification](https://lief.quarkslab.com/doc/latest/tutorials/11_macho_modification.html)
|
||||
- [ELF Coredump](https://lief.quarkslab.com/doc/latest/tutorials/12_elf_coredump.html)
|
||||
- [PE Authenticode](https://lief.quarkslab.com/doc/latest/tutorials/13_pe_authenticode.html)
|
||||
- [Contact](#contact)
|
||||
- [About](#about)
|
||||
- [Authors](#authors)
|
||||
- [License](#license)
|
||||
- [Bibtex](#bibtex)
|
||||
|
||||
## Downloads / Install
|
||||
|
||||
First:
|
||||
First, make sure to have an updated version of setuptools:
|
||||
|
||||
```bash
|
||||
```console
|
||||
pip install setuptools --upgrade
|
||||
```
|
||||
|
||||
To install the latest **version**:
|
||||
To install the latest **version** (release):
|
||||
|
||||
```python
|
||||
```console
|
||||
pip install lief
|
||||
```
|
||||
|
||||
To install the latest **commit**:
|
||||
To install nightlty build:
|
||||
|
||||
```python
|
||||
pip install https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.8.1.dev.zip
|
||||
```console
|
||||
pip install [--user] --index-url https://lief.quarkslab.com/packages lief==0.12.0.dev0
|
||||
```
|
||||
|
||||
### Packages
|
||||
|
||||
<table>
|
||||
<tr><td colspan="4"><img src="https://img.shields.io/badge/release-master-brightgreen.svg?style=default"></td></tr>
|
||||
<tr>
|
||||
<th>Linux</th>
|
||||
<th>Windows - x86</th>
|
||||
<th>Windows - x86-64</th>
|
||||
<th>OSX</th>
|
||||
</tr>
|
||||
* **Nightly**: https://github.com/lief-project/packages/tree/gh-pages
|
||||
* **v0.11.4**: https://github.com/lief-project/LIEF/releases/tag/0.11.4
|
||||
|
||||
<tr>
|
||||
<td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.1-Linux.tar.gz">SDK</a></td>
|
||||
<td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.1-win32.zip">SDK</a></td>
|
||||
<td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.1-win64.zip">SDK</a></td>
|
||||
<td><a href="https://github.com/lief-project/packages/raw/lief-master-latest/LIEF-0.8.1-Darwin.tar.gz">SDK</a></td>
|
||||
</tr>
|
||||
Here are guides to install or integrate LIEF:
|
||||
|
||||
<tr>
|
||||
<td colspan="4"><p align="center"><a href="https://github.com/lief-project/packages/raw/lief-master-latest/pylief-0.8.1.dev.zip">Python</a></p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<tr><td colspan="6"><b><img src="https://img.shields.io/badge/release-0.8.1-brightgreen.svg?style=default"></b></td></tr>
|
||||
<tr>
|
||||
<th>Linux</th>
|
||||
<th>Windows</th>
|
||||
<th>OSX</th>
|
||||
<th>CentOS</th>
|
||||
<th>Android</th>
|
||||
<th>Documentation</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Linux.tar.gz">SDK</a></td>
|
||||
<td>
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-win32.zip">SDK - x86</a>
|
||||
<br />
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-win64.zip">SDK - x86-64</a>
|
||||
</td>
|
||||
<td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Darwin.tar.gz">SDK</a></td>
|
||||
<td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-CentOS.tar.gz">SDK</a></td>
|
||||
|
||||
<td>
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Android_x86_64.tar.gz">SDK - x86-64</a>
|
||||
<br />
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Android_x86.tar.gz">SDK - x86</a>
|
||||
<br />
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Android_armeabi-v7a.tar.gz">SDK - ARM</a>
|
||||
<br />
|
||||
<a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/LIEF-0.8.1-Android_aarch64.tar.gz">SDK - AARCH64</a>
|
||||
</td>
|
||||
|
||||
<td><a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/documentation-0.8.1.tar.gz">Sphinx + Doxygen</a></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="3"><p align="center"><a href="https://github.com/lief-project/LIEF/releases/download/0.8.1/pylief-0.8.1.zip">Python</a></p></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
Here one can find guides to install or integrate LIEF:
|
||||
|
||||
* [Python](https://lief.quarkslab.com/doc/installation.html#python)
|
||||
* [VisualStudio](https://lief.quarkslab.com/doc/installation.html#visual-studio-integration)
|
||||
* [XCode](https://lief.quarkslab.com/doc/installation.html#xcode-integration)
|
||||
* [CMake](https://lief.quarkslab.com/doc/installation.html#cmake-integration)
|
||||
* [Python](https://lief.quarkslab.com/doc/latest/installation.html#python)
|
||||
* [VisualStudio](https://lief.quarkslab.com/doc/latest/installation.html#visual-studio-integration)
|
||||
* [XCode](https://lief.quarkslab.com/doc/latest/installation.html#xcode-integration)
|
||||
* [CMake](https://lief.quarkslab.com/doc/latest/installation.html#cmake-integration)
|
||||
|
||||
## Getting started
|
||||
|
||||
@@ -132,90 +118,107 @@ Here one can find guides to install or integrate LIEF:
|
||||
|
||||
```python
|
||||
import lief
|
||||
|
||||
# ELF
|
||||
binary = lief.parse("/usr/bin/ls")
|
||||
print(binary)
|
||||
|
||||
# PE
|
||||
# PE
|
||||
binary = lief.parse("C:\\Windows\\explorer.exe")
|
||||
print(binary)
|
||||
|
||||
# Mach-O
|
||||
binary = lief.parse("/usr/bin/ls")
|
||||
print(binary)
|
||||
|
||||
```
|
||||
|
||||
### C++
|
||||
|
||||
```cpp
|
||||
#include <LIEF/LIEF.hpp>
|
||||
int main(int argc, const char** argv) {
|
||||
LIEF::ELF::Binary* elf = LIEF::ELF::Parser::parse("/usr/bin/ls");
|
||||
LIEF::PE::Binary* pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe");
|
||||
LIEF::MachO::Binary* macho = LIEF::MachO::Parser::parse("/usr/bin/ls");
|
||||
|
||||
std::cout << *elf << std::endl;
|
||||
std::cout << *pe << std::endl;
|
||||
std::cout << *macho << std::endl;
|
||||
int main(int argc, char** argv) {
|
||||
// ELF
|
||||
try {
|
||||
std::unique_ptr<LIEF::ELF::Binary> elf = LIEF::ELF::Parser::parse("/bin/ls");
|
||||
std::cout << *elf << std::endl;
|
||||
} catch (const LIEF::exception& err) {
|
||||
std::cerr << err.what() << std::endl;
|
||||
}
|
||||
|
||||
delete elf;
|
||||
delete pe;
|
||||
delete macho;
|
||||
// PE
|
||||
try {
|
||||
std::unique_ptr<LIEF::PE::Binary> pe = LIEF::PE::Parser::parse("C:\\Windows\\explorer.exe");
|
||||
std::cout << *pe << std::endl;
|
||||
} catch (const LIEF::exception& err) {
|
||||
std::cerr << err.what() << std::endl;
|
||||
}
|
||||
|
||||
// Mach-O
|
||||
try {
|
||||
std::unique_ptr<LIEF::MachO::FatBinary> macho = LIEF::MachO::Parser::parse("/bin/ls");
|
||||
std::cout << *macho << std::endl;
|
||||
} catch (const LIEF::exception& err) {
|
||||
std::cerr << err.what() << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### C
|
||||
### C (Limited API)
|
||||
|
||||
```cpp
|
||||
#include <LIEF/LIEF.h>
|
||||
int main(int argc, const char** argv) {
|
||||
|
||||
Elf_Binary_t* elf_binary = elf_parse("/usr/bin/ls");
|
||||
Pe_Binary_t* pe_binary = pe_parse("C:\\Windows\\explorer.exe");
|
||||
Macho_Binary_t** macho_binaries = macho_parse("/usr/bin/ls");
|
||||
int main(int argc, char** argv) {
|
||||
Elf_Binary_t* elf = elf_parse("/usr/bin/ls");
|
||||
|
||||
Pe_Section_t** pe_sections = pe_binary->sections;
|
||||
Elf_Section_t** elf_sections = elf_binary->sections;
|
||||
Macho_Section_t** macho_sections = macho_binaries[0]->sections;
|
||||
Elf_Section_t** sections = elf->sections;
|
||||
|
||||
for (size_t i = 0; pe_sections[i] != NULL; ++i) {
|
||||
printf("%s\n", pe_sections[i]->name)
|
||||
for (size_t i = 0; sections[i] != NULL; ++i) {
|
||||
printf("%s\n", sections[i]->name);
|
||||
}
|
||||
|
||||
for (size_t i = 0; elf_sections[i] != NULL; ++i) {
|
||||
printf("%s\n", elf_sections[i]->name)
|
||||
}
|
||||
|
||||
for (size_t i = 0; macho_sections[i] != NULL; ++i) {
|
||||
printf("%s\n", macho_sections[i]->name)
|
||||
}
|
||||
|
||||
elf_binary_destroy(elf_binary);
|
||||
pe_binary_destroy(pe_binary);
|
||||
macho_binaries_destroy(macho_binaries);
|
||||
elf_binary_destroy(elf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
* [Main documentation](http://lief.quarkslab.com/doc/index.html)
|
||||
* [Tutorial](http://lief.quarkslab.com/doc/tutorials/index.html)
|
||||
* [API](http://lief.quarkslab.com/doc/api/index.html)
|
||||
* [Doxygen](http://lief.quarkslab.com/doxygen/index.html)
|
||||
* [Main documentation](https://lief.quarkslab.com/doc/latest/index.html)
|
||||
* [Tutorial](https://lief.quarkslab.com/doc/latest/tutorials/index.html)
|
||||
* [API](https://lief.quarkslab.com/doc/latest/api/index.html)
|
||||
* [Doxygen](https://lief.quarkslab.com/doc/latest/doxygen/index.html)
|
||||
|
||||
## Contact
|
||||
|
||||
* **Mail**: lief at quarkslab com
|
||||
* **Gitter**: [lief-project](https://gitter.im/lief-project)
|
||||
|
||||
## Authors
|
||||
## About
|
||||
|
||||
### Authors
|
||||
|
||||
Romain Thomas ([@rh0main](https://twitter.com/rh0main)) - [Quarkslab](https://www.quarkslab.com)
|
||||
|
||||
---------------
|
||||
### License
|
||||
|
||||
LIEF is provided under the [Apache 2.0 license](https://github.com/lief-project/LIEF/blob/0.11.2/LICENSE).
|
||||
|
||||
### Bibtex
|
||||
|
||||
```latex
|
||||
@MISC {LIEF,
|
||||
author = "Romain Thomas",
|
||||
title = "LIEF - Library to Instrument Executable Formats",
|
||||
howpublished = "https://lief.quarkslab.com/",
|
||||
month = "April",
|
||||
year = "2017",
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
<p align="center" >
|
||||
<img width="40%" src="http://lief.quarkslab.com/resources/QB-big.png"/>
|
||||
</p>
|
||||
|
||||
|
||||
@@ -8,10 +8,11 @@ set(LIEF_C_INCLUDE_FILES
|
||||
"${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 ${LIEF_C_INCLUDE_FILES})
|
||||
set(LIEF_C_SRC "${CMAKE_CURRENT_LIST_DIR}/logging.cpp")
|
||||
|
||||
if (LIEF_ELF)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/ELF/CMakeLists.txt")
|
||||
@@ -27,6 +28,5 @@ endif()
|
||||
|
||||
source_group("Header Files\\C API" FILES ${LIEF_C_INCLUDE_FILES})
|
||||
|
||||
target_sources(LIB_LIEF_STATIC PRIVATE "${LIEF_C_SRC}")
|
||||
target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_C_SRC}")
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_C_SRC}" ${LIEF_C_INCLUDE_FILES})
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,6 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
#include <cstring>
|
||||
#include "LIEF/ELF/Binary.h"
|
||||
#include "LIEF/ELF/Section.h"
|
||||
#include "LIEF/ELF/Segment.h"
|
||||
@@ -36,7 +37,7 @@ namespace ELF {
|
||||
void init_c_binary(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->handler = reinterpret_cast<void*>(binary);
|
||||
c_binary->name = binary->name().c_str();
|
||||
c_binary->type = static_cast<enum ::ELF_CLASS>(binary->type());
|
||||
c_binary->type = static_cast<enum LIEF_ELF_ELF_CLASS>(binary->type());
|
||||
c_binary->interpreter = nullptr;
|
||||
if (binary->has_interpreter()) {
|
||||
std::string interp = binary->interpreter();
|
||||
@@ -63,7 +64,7 @@ void init_c_binary(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
}
|
||||
|
||||
Elf_Binary_t* elf_parse(const char *file) {
|
||||
Binary* binary = Parser::parse(file);
|
||||
Binary* binary = Parser::parse(file).release();
|
||||
Elf_Binary_t* c_binary = static_cast<Elf_Binary_t*>(malloc(sizeof(Elf_Binary_t)));
|
||||
memset(c_binary, 0, sizeof(Elf_Binary_t));
|
||||
init_c_binary(c_binary, binary);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -42,9 +42,4 @@ set(LIEF_C_ELF_INC "${LIEF_API_C_ELF_INCLUDE_FILES_C}" "${LIEF_API_C_ELF_INCLUDE
|
||||
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_STATIC PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}")
|
||||
target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}")
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_C_ELF_SRC}" "${LIEF_C_ELF_INC}")
|
||||
|
||||
+26
-20
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,13 @@
|
||||
*/
|
||||
#include "DynamicEntry.hpp"
|
||||
|
||||
#include "LIEF/ELF/DynamicEntryFlags.hpp"
|
||||
#include "LIEF/ELF/DynamicSharedObject.hpp"
|
||||
#include "LIEF/ELF/DynamicEntryLibrary.hpp"
|
||||
#include "LIEF/ELF/DynamicEntryRpath.hpp"
|
||||
#include "LIEF/ELF/DynamicEntryRunPath.hpp"
|
||||
#include "LIEF/ELF/DynamicEntryArray.hpp"
|
||||
|
||||
namespace LIEF {
|
||||
namespace ELF {
|
||||
|
||||
@@ -33,13 +40,12 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_Library_t* e = static_cast<Elf_DynamicEntry_Library_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Library_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->name = dynamic_cast<DynamicEntryLibrary*>(&entry)->name().c_str();
|
||||
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
break;
|
||||
// cppcheck-suppress memleak
|
||||
}
|
||||
|
||||
case DYNAMIC_TAGS::DT_SONAME:
|
||||
@@ -47,7 +53,7 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_SharedObject_t* e = static_cast<Elf_DynamicEntry_SharedObject_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_SharedObject_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->name = dynamic_cast<DynamicSharedObject*>(&entry)->name().c_str();
|
||||
|
||||
@@ -60,7 +66,7 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_Rpath_t* e = static_cast<Elf_DynamicEntry_Rpath_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Rpath_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->rpath = dynamic_cast<DynamicEntryRpath*>(&entry)->name().c_str();
|
||||
|
||||
@@ -74,7 +80,7 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_RunPath_t* e = static_cast<Elf_DynamicEntry_RunPath_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_RunPath_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
e->runpath = dynamic_cast<DynamicEntryRunPath*>(&entry)->name().c_str();
|
||||
|
||||
@@ -90,7 +96,7 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_Array_t* e = static_cast<Elf_DynamicEntry_Array_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Array_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const std::vector<uint64_t>& array = dynamic_cast<DynamicEntryArray*>(&entry)->array();
|
||||
e->array = static_cast<uint64_t*>(malloc((array.size() + 1) * sizeof(uint64_t)));
|
||||
@@ -108,19 +114,19 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_Flags_t* e = static_cast<Elf_DynamicEntry_Flags_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Flags_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const dynamic_flags_list_t& flags = dynamic_cast<DynamicEntryFlags*>(&entry)->flags();
|
||||
e->flags = static_cast<enum ::DYNAMIC_FLAGS*>(malloc((flags.size() + 1) * sizeof(DYNAMIC_FLAGS)));
|
||||
const DynamicEntryFlags::flags_list_t& flags = dynamic_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 ::DYNAMIC_FLAGS>(*it);
|
||||
e->flags[i] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS>(*it);
|
||||
}
|
||||
|
||||
e->flags[flags.size()] = static_cast<enum ::DYNAMIC_FLAGS>(0);
|
||||
e->flags[flags.size()] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS>(0);
|
||||
c_binary->dynamic_entries[i] = reinterpret_cast<Elf_DynamicEntry_t*>(e);
|
||||
|
||||
break;
|
||||
@@ -131,19 +137,19 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
Elf_DynamicEntry_Flags_t* e = static_cast<Elf_DynamicEntry_Flags_t*>(
|
||||
malloc(sizeof(Elf_DynamicEntry_Flags_t)));
|
||||
|
||||
e->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
e->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
e->value = entry.value();
|
||||
const dynamic_flags_list_t& flags = dynamic_cast<DynamicEntryFlags*>(&entry)->flags();
|
||||
e->flags_1 = static_cast<enum ::DYNAMIC_FLAGS_1*>(malloc((flags.size() + 1) * sizeof(DYNAMIC_FLAGS_1)));
|
||||
const DynamicEntryFlags::flags_list_t& flags = dynamic_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 ::DYNAMIC_FLAGS_1>(*it);
|
||||
e->flags_1[i] = static_cast<enum LIEF_ELF_DYNAMIC_FLAGS_1>(*it);
|
||||
}
|
||||
|
||||
e->flags_1[flags.size()] = static_cast<enum ::DYNAMIC_FLAGS_1>(0);
|
||||
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;
|
||||
@@ -156,7 +162,7 @@ void init_c_dynamic_entries(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
{
|
||||
c_binary->dynamic_entries[i] =
|
||||
static_cast<Elf_DynamicEntry_t*>(malloc(sizeof(Elf_DynamicEntry_t)));
|
||||
c_binary->dynamic_entries[i]->tag = static_cast<enum ::DYNAMIC_TAGS>(entry.tag());
|
||||
c_binary->dynamic_entries[i]->tag = static_cast<enum LIEF_ELF_DYNAMIC_TAGS>(entry.tag());
|
||||
c_binary->dynamic_entries[i]->value = entry.value();
|
||||
|
||||
}
|
||||
@@ -173,7 +179,7 @@ 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] != NULL; ++idx) {
|
||||
switch(dynamic_entries[idx]->tag) {
|
||||
switch(static_cast<DYNAMIC_TAGS>(dynamic_entries[idx]->tag)) {
|
||||
case DYNAMIC_TAGS::DT_NEEDED:
|
||||
{
|
||||
free(reinterpret_cast<Elf_DynamicEntry_Library_t*>(dynamic_entries[idx]));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+16
-16
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,59 +22,59 @@
|
||||
|
||||
extern "C"
|
||||
{
|
||||
const char* E_TYPE_to_string(enum E_TYPE e) {
|
||||
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 SYMBOL_BINDINGS 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 VERSION 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 ARCH 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 SEGMENT_TYPES 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 DYNAMIC_TAGS 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 ELF_SECTION_TYPES 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 ELF_SECTION_FLAGS 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 ELF_SYMBOL_TYPES 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 ELF_CLASS 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 ELF_DATA 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 OS_ABI 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 DYNAMIC_FLAGS 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 DYNAMIC_FLAGS_1 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 ::E_TYPE>(hdr.file_type());
|
||||
c_binary->header.machine_type = static_cast<enum ::ARCH>(hdr.machine_type());
|
||||
c_binary->header.object_file_version = static_cast<enum ::VERSION>(hdr.object_file_version());
|
||||
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.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();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
c_binary->sections[i]->name = b_section.name().c_str();
|
||||
c_binary->sections[i]->flags = b_section.flags();
|
||||
c_binary->sections[i]->type = static_cast<enum ::ELF_SECTION_TYPES>(b_section.type());
|
||||
c_binary->sections[i]->type = static_cast<enum LIEF_ELF_ELF_SECTION_TYPES>(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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,8 +34,8 @@ void init_c_segments(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
content);
|
||||
|
||||
c_binary->segments[i] = static_cast<Elf_Segment_t*>(malloc(sizeof(Elf_Segment_t)));
|
||||
c_binary->segments[i]->type = static_cast<enum ::SEGMENT_TYPES>(segment.type());
|
||||
c_binary->segments[i]->flags = segment.flags();
|
||||
c_binary->segments[i]->type = static_cast<enum LIEF_ELF_SEGMENT_TYPES>(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();
|
||||
c_binary->segments[i]->offset = segment.file_offset();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 ::ELF_SYMBOL_TYPES>(b_sym.type());
|
||||
c_binary->dynamic_symbols[i]->binding = static_cast<enum ::SYMBOL_BINDINGS>(b_sym.binding());
|
||||
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]->other = b_sym.other();
|
||||
c_binary->dynamic_symbols[i]->shndx = b_sym.shndx();
|
||||
c_binary->dynamic_symbols[i]->value = b_sym.value();
|
||||
@@ -55,8 +55,8 @@ void init_c_static_symbols(Elf_Binary_t* c_binary, Binary* binary) {
|
||||
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 ::ELF_SYMBOL_TYPES>(b_sym.type());
|
||||
c_binary->static_symbols[i]->binding = static_cast<enum ::SYMBOL_BINDINGS>(b_sym.binding());
|
||||
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();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -43,7 +43,4 @@ set(LIEF_C_MACHO_INC "${LIEF_API_C_MACHO_INCLUDE_FILES_C}" "${LIEF_API_C_MACHO_I
|
||||
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_STATIC PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC})
|
||||
target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC})
|
||||
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_MACHO_SRC}" ${LIEF_C_MACHO_INC})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,47 +23,47 @@
|
||||
extern "C"
|
||||
{
|
||||
|
||||
const char* LOAD_COMMAND_TYPES_to_string(enum LOAD_COMMAND_TYPES e) {
|
||||
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 MACHO_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 FILE_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 CPU_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 HEADER_FLAGS 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 MACHO_SECTION_TYPES 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 MACHO_SYMBOL_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 N_LIST_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 SYMBOL_DESCRIPTIONS 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,10 +19,10 @@ namespace LIEF {
|
||||
namespace MachO {
|
||||
void init_c_header(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
Header& header = binary->header();
|
||||
c_binary->header.magic = header.magic();
|
||||
c_binary->header.cpu_type = static_cast<enum ::CPU_TYPES>(header.cpu_type());
|
||||
c_binary->header.magic = static_cast<uint32_t>(header.magic());
|
||||
c_binary->header.cpu_type = static_cast<enum LIEF_MACHO_CPU_TYPES>(header.cpu_type());
|
||||
c_binary->header.cpu_subtype = header.cpu_subtype();
|
||||
c_binary->header.file_type = static_cast<enum ::FILE_TYPES>(header.file_type());
|
||||
c_binary->header.file_type = static_cast<enum LIEF_MACHO_FILE_TYPES>(header.file_type());
|
||||
c_binary->header.nb_cmds = header.nb_cmds();
|
||||
c_binary->header.sizeof_cmds = header.sizeof_cmds();
|
||||
c_binary->header.flags = header.flags();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,7 +34,7 @@ void init_c_commands(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
std::end(cmd_content),
|
||||
content);
|
||||
|
||||
c_binary->commands[i]->command = static_cast<enum ::LOAD_COMMAND_TYPES>(cmd.command());
|
||||
c_binary->commands[i]->command = static_cast<enum LIEF_MACHO_LOAD_COMMAND_TYPES>(cmd.command());
|
||||
c_binary->commands[i]->size = cmd.size();
|
||||
c_binary->commands[i]->data = content;
|
||||
c_binary->commands[i]->offset = cmd.command_offset();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,13 +17,14 @@
|
||||
|
||||
#include "LIEF/MachO/Binary.h"
|
||||
#include "LIEF/MachO/Parser.hpp"
|
||||
#include "LIEF/MachO/FatBinary.hpp"
|
||||
|
||||
#include "Binary.hpp"
|
||||
|
||||
using namespace LIEF::MachO;
|
||||
|
||||
Macho_Binary_t** macho_parse(const char *file) {
|
||||
FatBinary* macho_binaries = Parser::parse(file);
|
||||
FatBinary* macho_binaries = Parser::parse(file).release();
|
||||
|
||||
Macho_Binary_t** c_macho_binaries = static_cast<Macho_Binary_t**>(
|
||||
malloc((macho_binaries->size() + 1) * sizeof(Macho_Binary_t**)));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -39,7 +39,7 @@ void init_c_sections(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
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]->type = static_cast<enum ::MACHO_SECTION_TYPES>(section.type());
|
||||
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();
|
||||
c_binary->sections[i]->reserved3 = section.reserved3();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -44,6 +44,7 @@ void init_c_segments(Macho_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->segments[i]->numberof_sections = segment.numberof_sections();
|
||||
c_binary->segments[i]->flags = segment.flags();
|
||||
c_binary->segments[i]->content = content;
|
||||
c_binary->segments[i]->size = segment_content.size();
|
||||
c_binary->segments[i]->sections = nullptr; //TODO
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -50,7 +50,7 @@ void init_c_binary(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
}
|
||||
|
||||
Pe_Binary_t* pe_parse(const char *file) {
|
||||
Binary* binary = Parser::parse(file);
|
||||
Binary* binary = Parser::parse(file).release();
|
||||
Pe_Binary_t* c_binary = static_cast<Pe_Binary_t*>(malloc(sizeof(Pe_Binary_t)));
|
||||
std::memset(c_binary, 0, sizeof(Pe_Binary_t));
|
||||
init_c_binary(c_binary, binary);
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -46,6 +46,4 @@ set(LIEF_C_PE_INC "${LIEF_API_C_PE_INCLUDE_FILES_C}" "${LIEF_API_C_PE_INCLUDE_FI
|
||||
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_STATIC PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}")
|
||||
target_sources(LIB_LIEF_SHARED PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}")
|
||||
|
||||
target_sources(LIB_LIEF PRIVATE "${LIEF_API_C_PE_SRC}" "${LIEF_C_PE_INC}")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,17 +23,17 @@
|
||||
extern "C"
|
||||
{
|
||||
|
||||
const char* PE_TYPES_to_string(enum PE_TYPES e) {
|
||||
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 MACHINE_TYPES 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 SUBSYSTEM e) {
|
||||
const char* SUBSYSTEM_to_string(enum LIEF_PE_SUBSYSTEM e) {
|
||||
return LIEF::PE::to_string(static_cast<LIEF::PE::SUBSYSTEM>(e));
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,13 +24,13 @@ void init_c_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
|
||||
const Header::signature_t& signature = header.signature();
|
||||
|
||||
c_binary->header.machine = static_cast<enum ::MACHINE_TYPES>(header.machine());
|
||||
c_binary->header.machine = static_cast<enum LIEF_PE_MACHINE_TYPES>(header.machine());
|
||||
c_binary->header.numberof_sections = header.numberof_sections();
|
||||
c_binary->header.time_date_stamp = header.time_date_stamp();
|
||||
c_binary->header.pointerto_symbol_table = header.pointerto_symbol_table();
|
||||
c_binary->header.numberof_symbols = header.numberof_symbols();
|
||||
c_binary->header.sizeof_optional_header = header.sizeof_optional_header();
|
||||
c_binary->header.characteristics = header.characteristics();
|
||||
c_binary->header.characteristics = static_cast<uint16_t>(header.characteristics());
|
||||
|
||||
std::copy(
|
||||
std::begin(signature),
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -21,7 +21,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 PE_TYPES>(optional_header.magic());
|
||||
c_binary->optional_header.magic = static_cast<enum LIEF_PE_PE_TYPES>(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();
|
||||
@@ -47,7 +47,7 @@ void init_c_optional_header(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->optional_header.sizeof_image = optional_header.sizeof_image();
|
||||
c_binary->optional_header.sizeof_headers = optional_header.sizeof_headers();
|
||||
c_binary->optional_header.checksum = optional_header.checksum();
|
||||
c_binary->optional_header.subsystem = static_cast<enum ::SUBSYSTEM>(optional_header.subsystem());
|
||||
c_binary->optional_header.subsystem = static_cast<enum LIEF_PE_SUBSYSTEM>(optional_header.subsystem());
|
||||
c_binary->optional_header.dll_characteristics = optional_header.dll_characteristics();
|
||||
c_binary->optional_header.sizeof_stack_reserve = optional_header.sizeof_stack_reserve();
|
||||
c_binary->optional_header.sizeof_stack_commit = optional_header.sizeof_stack_commit();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,12 +27,16 @@ void init_c_sections(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
for (size_t i = 0; i < sections.size(); ++i) {
|
||||
Section& b_section = sections[i];
|
||||
c_binary->sections[i] = static_cast<Pe_Section_t*>(malloc(sizeof(Pe_Section_t)));
|
||||
const std::vector<uint8_t>& section_content = b_section.content();
|
||||
uint8_t* content = static_cast<uint8_t*>(malloc(section_content.size() * sizeof(uint8_t)));
|
||||
std::copy(
|
||||
std::begin(section_content),
|
||||
std::end(section_content),
|
||||
content);
|
||||
std::vector<uint8_t> section_content = b_section.content();
|
||||
uint8_t* content = nullptr;
|
||||
|
||||
if (section_content.size() > 0) {
|
||||
content = static_cast<uint8_t*>(malloc(section_content.size() * sizeof(uint8_t)));
|
||||
std::move(
|
||||
std::begin(section_content),
|
||||
std::end(section_content),
|
||||
content);
|
||||
}
|
||||
|
||||
c_binary->sections[i]->name = b_section.name().c_str();
|
||||
c_binary->sections[i]->virtual_address = b_section.virtual_address();
|
||||
@@ -43,6 +47,7 @@ void init_c_sections(Pe_Binary_t* c_binary, Binary* binary) {
|
||||
c_binary->sections[i]->pointerto_line_numbers = b_section.pointerto_line_numbers();
|
||||
c_binary->sections[i]->characteristics = b_section.characteristics();
|
||||
c_binary->sections[i]->content = content;
|
||||
c_binary->sections[i]->content_size = section_content.size();
|
||||
c_binary->sections[i]->entropy = b_section.entropy();
|
||||
}
|
||||
c_binary->sections[sections.size()] = nullptr;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -45,7 +45,7 @@ struct Elf_Binary_t {
|
||||
void* handler;
|
||||
const char* name;
|
||||
const char* interpreter;
|
||||
enum ELF_CLASS type;
|
||||
enum LIEF_ELF_ELF_CLASS type;
|
||||
Elf_Header_t header;
|
||||
Elf_Section_t **sections;
|
||||
Elf_Segment_t **segments;
|
||||
@@ -57,16 +57,16 @@ struct Elf_Binary_t {
|
||||
typedef struct Elf_Binary_t Elf_Binary_t;
|
||||
|
||||
/** @brief Wrapper for LIEF::ELF::Parser::parse */
|
||||
DLL_PUBLIC Elf_Binary_t* elf_parse(const char *file);
|
||||
LIEF_API Elf_Binary_t* elf_parse(const char *file);
|
||||
|
||||
DLL_PUBLIC void elf_binary_destroy(Elf_Binary_t* binary);
|
||||
LIEF_API void elf_binary_destroy(Elf_Binary_t* binary);
|
||||
|
||||
/* ELF::Binary methods
|
||||
* ==================
|
||||
*/
|
||||
|
||||
/** @brief Update LIEF::ELF::Header object */
|
||||
DLL_PUBLIC int elf_binary_save_header(Elf_Binary_t* binary);
|
||||
LIEF_API int elf_binary_save_header(Elf_Binary_t* binary);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -34,46 +34,46 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_DynamicEntry_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
};
|
||||
|
||||
struct Elf_DynamicEntry_Library_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
const char* name;
|
||||
};
|
||||
|
||||
struct Elf_DynamicEntry_SharedObject_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
const char* name;
|
||||
};
|
||||
|
||||
struct Elf_DynamicEntry_Array_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
uint64_t* array;
|
||||
};
|
||||
|
||||
struct Elf_DynamicEntry_Rpath_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
const char* rpath;
|
||||
};
|
||||
|
||||
struct Elf_DynamicEntry_RunPath_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
const char* runpath;
|
||||
};
|
||||
|
||||
|
||||
struct Elf_DynamicEntry_Flags_t {
|
||||
enum DYNAMIC_TAGS tag;
|
||||
enum LIEF_ELF_DYNAMIC_TAGS tag;
|
||||
uint64_t value;
|
||||
enum DYNAMIC_FLAGS *flags;
|
||||
enum DYNAMIC_FLAGS_1 *flags_1;
|
||||
enum LIEF_ELF_DYNAMIC_FLAGS *flags;
|
||||
enum LIEF_ELF_DYNAMIC_FLAGS_1 *flags_1;
|
||||
};
|
||||
|
||||
typedef struct Elf_DynamicEntry_t Elf_DynamicEntry_t;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -24,20 +24,20 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DLL_PUBLIC const char* SYMBOL_BINDINGS_to_string(enum SYMBOL_BINDINGS e);
|
||||
DLL_PUBLIC const char* E_TYPE_to_string(enum E_TYPE e);
|
||||
DLL_PUBLIC const char* VERSION_to_string(enum VERSION e);
|
||||
DLL_PUBLIC const char* ARCH_to_string(enum ARCH e);
|
||||
DLL_PUBLIC const char* SEGMENT_TYPES_to_string(enum SEGMENT_TYPES e);
|
||||
DLL_PUBLIC const char* DYNAMIC_TAGS_to_string(enum DYNAMIC_TAGS e);
|
||||
DLL_PUBLIC const char* ELF_SECTION_TYPES_to_string(enum ELF_SECTION_TYPES e);
|
||||
DLL_PUBLIC const char* ELF_SECTION_FLAGS_to_string(enum ELF_SECTION_FLAGS e);
|
||||
DLL_PUBLIC const char* ELF_SYMBOL_TYPES_to_string(enum ELF_SYMBOL_TYPES e);
|
||||
DLL_PUBLIC const char* ELF_CLASS_to_string(enum ELF_CLASS e);
|
||||
DLL_PUBLIC const char* ELF_DATA_to_string(enum ELF_DATA e);
|
||||
DLL_PUBLIC const char* OS_ABI_to_string(enum OS_ABI e);
|
||||
DLL_PUBLIC const char* DYNAMIC_FLAGS_to_string(enum DYNAMIC_FLAGS e);
|
||||
DLL_PUBLIC const char* DYNAMIC_FLAGS_1_to_string(enum DYNAMIC_FLAGS_1 e);
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,10 +31,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Header_t {
|
||||
uint8_t identity[EI_NIDENT];
|
||||
enum E_TYPE file_type;
|
||||
enum ARCH machine_type;
|
||||
enum VERSION object_file_version;
|
||||
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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
struct Elf_Section_t {
|
||||
const char* name;
|
||||
uint32_t flags;
|
||||
enum ELF_SECTION_TYPES type;
|
||||
enum LIEF_ELF_ELF_SECTION_TYPES type;
|
||||
uint64_t virtual_address;
|
||||
uint64_t offset;
|
||||
uint64_t original_size;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,7 +32,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct Elf_Segment_t {
|
||||
enum SEGMENT_TYPES type;
|
||||
enum LIEF_ELF_SEGMENT_TYPES type;
|
||||
uint32_t flags;
|
||||
uint64_t virtual_address;
|
||||
uint64_t virtual_size;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 @@
|
||||
|
||||
#include "LIEF/ELF/enums.h"
|
||||
#include "LIEF/types.h"
|
||||
/* @defgroup elf_symbol_c_api Symbol
|
||||
/** @defgroup elf_symbol_c_api Symbol
|
||||
* @ingroup elf_c_api
|
||||
* @addtogroup elf_symbol_c_api
|
||||
* @brief Symbol C API
|
||||
@@ -34,8 +34,8 @@ extern "C" {
|
||||
|
||||
struct Elf_Symbol_t {
|
||||
const char* name;
|
||||
enum ELF_SYMBOL_TYPES type;
|
||||
enum SYMBOL_BINDINGS binding;
|
||||
enum LIEF_ELF_ELF_SYMBOL_TYPES type;
|
||||
enum LIEF_ELF_SYMBOL_BINDINGS binding;
|
||||
uint8_t information;
|
||||
uint8_t other;
|
||||
uint16_t shndx;
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
#ifndef LIEF_ELF_C_ENUMS_H_
|
||||
#define LIEF_ELF_C_ENUMS_H_
|
||||
#include "LIEF/ELF/undef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _LIEF_EN(N) LIEF_ELF_##N // enum LIEF_N {
|
||||
#define _LIEF_EN_2(N, TYPE) LIEF_ELF_##N // enum LIEF_N {
|
||||
#define _LIEF_EI(X) LIEF_ELF_##X // LIEF_X
|
||||
|
||||
@LIEF_ELF_ENUMS@
|
||||
|
||||
#undef _LIEF_EN
|
||||
#undef _LIEF_EN_2
|
||||
#undef _LIEF_EI
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/** @brief Check if the given file is an ELF one. */
|
||||
DLL_PUBLIC bool is_elf(const char* file);
|
||||
LIEF_API bool is_elf(const char* file);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,5 +19,6 @@
|
||||
#include <LIEF/MachO.h>
|
||||
#include <LIEF/PE.h>
|
||||
#include <LIEF/ELF.h>
|
||||
#include <LIEF/logging.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,9 +55,9 @@ struct Macho_Binary_t {
|
||||
typedef struct Macho_Binary_t Macho_Binary_t;
|
||||
|
||||
/** @brief Wrapper on LIEF::MachO::Parser::parse */
|
||||
DLL_PUBLIC Macho_Binary_t** macho_parse(const char *file);
|
||||
LIEF_API Macho_Binary_t** macho_parse(const char *file);
|
||||
|
||||
DLL_PUBLIC void macho_binaries_destroy(Macho_Binary_t** binaries);
|
||||
LIEF_API void macho_binaries_destroy(Macho_Binary_t** binaries);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,15 +23,15 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DLL_PUBLIC const char* LOAD_COMMAND_TYPES_to_string(enum LOAD_COMMAND_TYPES e);
|
||||
DLL_PUBLIC const char* MACHO_TYPES_to_string(enum MACHO_TYPES e);
|
||||
DLL_PUBLIC const char* FILE_TYPES_to_string(enum FILE_TYPES e);
|
||||
DLL_PUBLIC const char* CPU_TYPES_to_string(enum CPU_TYPES e);
|
||||
DLL_PUBLIC const char* HEADER_FLAGS_to_string(enum HEADER_FLAGS e);
|
||||
DLL_PUBLIC const char* MACHO_SECTION_TYPES_to_string(enum MACHO_SECTION_TYPES e);
|
||||
DLL_PUBLIC const char* MACHO_SYMBOL_TYPES_to_string(enum MACHO_SYMBOL_TYPES e);
|
||||
DLL_PUBLIC const char* N_LIST_TYPES_to_string(enum N_LIST_TYPES e);
|
||||
DLL_PUBLIC const char* SYMBOL_DESCRIPTIONS_to_string(enum SYMBOL_DESCRIPTIONS e);
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -32,9 +32,9 @@ extern "C" {
|
||||
|
||||
struct Macho_Header_t {
|
||||
uint32_t magic;
|
||||
enum CPU_TYPES cpu_type;
|
||||
enum LIEF_MACHO_CPU_TYPES cpu_type;
|
||||
uint32_t cpu_subtype;
|
||||
enum FILE_TYPES file_type;
|
||||
enum LIEF_MACHO_FILE_TYPES file_type;
|
||||
uint32_t nb_cmds;
|
||||
uint32_t sizeof_cmds;
|
||||
uint32_t flags;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct Macho_Command_t {
|
||||
enum LOAD_COMMAND_TYPES command;
|
||||
enum LIEF_MACHO_LOAD_COMMAND_TYPES command;
|
||||
uint32_t size;
|
||||
uint8_t* data;
|
||||
uint32_t offset;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -37,7 +37,7 @@ struct Macho_Section_t {
|
||||
uint32_t relocation_offset;
|
||||
uint32_t numberof_relocations;
|
||||
uint32_t flags;
|
||||
enum MACHO_SECTION_TYPES type;
|
||||
enum LIEF_MACHO_MACHO_SECTION_TYPES type;
|
||||
uint32_t reserved1;
|
||||
uint32_t reserved2;
|
||||
uint32_t reserved3;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -41,6 +41,7 @@ struct Macho_Segment_t {
|
||||
uint32_t numberof_sections;
|
||||
uint32_t flags;
|
||||
uint8_t* content;
|
||||
uint64_t size;
|
||||
Macho_Section_t** sections;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,11 +1,33 @@
|
||||
#ifndef LIEF_MACHO_C_ENUMS_H_
|
||||
#define LIEF_MACHO_C_ENUMS_H_
|
||||
#include "LIEF/MachO/undef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef _LIEF_EN
|
||||
#undef _LIEF_EN
|
||||
#endif
|
||||
|
||||
#ifdef _LIEF_EN_2
|
||||
#undef _LIEF_EN_2
|
||||
#endif
|
||||
|
||||
#ifdef _LIEF_EI
|
||||
#undef _LIEF_EI
|
||||
#endif
|
||||
|
||||
#define _LIEF_EN(N) LIEF_MACHO_##N // enum LIEF_N {
|
||||
#define _LIEF_EN_2(N, TYPE) LIEF_MACHO_##N // enum LIEF_N {
|
||||
#define _LIEF_EI(X) LIEF_MACHO_##X // LIEF_X
|
||||
|
||||
@LIEF_MACHO_ENUMS@
|
||||
|
||||
#undef _LIEF_EN
|
||||
#undef _LIEF_EN_2
|
||||
#undef _LIEF_EI
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -55,10 +55,10 @@ struct Pe_Binary_t {
|
||||
|
||||
typedef struct Pe_Binary_t Pe_Binary_t;
|
||||
|
||||
/** @brief Wrapper on LIEF::PE::Parser::parse */
|
||||
DLL_PUBLIC Pe_Binary_t* pe_parse(const char *file);
|
||||
/** Wrapper on LIEF::PE::Parser::parse */
|
||||
LIEF_API Pe_Binary_t* pe_parse(const char *file);
|
||||
|
||||
DLL_PUBLIC void pe_binary_destroy(Pe_Binary_t* binary);
|
||||
LIEF_API void pe_binary_destroy(Pe_Binary_t* binary);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Copyright 2017 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 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 R. Thomas
|
||||
* Copyright 2017 Quarkslab
|
||||
/* Copyright 2017 - 2021 R. Thomas
|
||||
* Copyright 2017 - 2021 Quarkslab
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user