mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-08-29 04:07:37 +00:00
Compare commits
655
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53902284b1 | ||
|
|
7f63d57f67 | ||
|
|
2ddc374164 | ||
|
|
78d9e5fc3b | ||
|
|
ac8d212ce7 | ||
|
|
3685ceceae | ||
|
|
45d642d4e1 | ||
|
|
2cfb896827 | ||
|
|
ea2d8ded53 | ||
|
|
620133002c | ||
|
|
15b6c7d3b7 | ||
|
|
2edd12fe22 | ||
|
|
a2b008c747 | ||
|
|
0f7ef7dcd7 | ||
|
|
f96eb0c5ec | ||
|
|
ea5902514a | ||
|
|
d5e3488894 | ||
|
|
233d18d351 | ||
|
|
7f53fd41f8 | ||
|
|
5547a605bd | ||
|
|
0ac4009720 | ||
|
|
2a10640f42 | ||
|
|
6e94286b39 | ||
|
|
041bc9dc0b | ||
|
|
e5a9e9239b | ||
|
|
7ff3c5d108 | ||
|
|
e8626ca74a | ||
|
|
34f3c055ed | ||
|
|
8e2c5ca45e | ||
|
|
7d6347f468 | ||
|
|
e362d804b0 | ||
|
|
3bad079d75 | ||
|
|
57ce7aab7b | ||
|
|
3e029b0dde | ||
|
|
5dfdc1b4a5 | ||
|
|
eb3e923091 | ||
|
|
4a435870f6 | ||
|
|
f40755fd7c | ||
|
|
3c09765208 | ||
|
|
b65eabe23d | ||
|
|
d18ecc1a37 | ||
|
|
69c8c9d6c6 | ||
|
|
77d070fe73 | ||
|
|
183cbc087a | ||
|
|
194b641ebd | ||
|
|
7c154a3f26 | ||
|
|
b81ec7d7e0 | ||
|
|
479925f403 | ||
|
|
17eeaa43cf | ||
|
|
9b1c447df1 | ||
|
|
4dacedd9cc | ||
|
|
66891638d5 | ||
|
|
c4a68500cc | ||
|
|
335f17b72f | ||
|
|
735657a254 | ||
|
|
83d3948bc8 | ||
|
|
7fac2e89b3 | ||
|
|
e5bb77e378 | ||
|
|
8209a30a6b | ||
|
|
22e4a8a252 | ||
|
|
c70f370bac | ||
|
|
49a8ff59dc | ||
|
|
d076bb5133 | ||
|
|
a63ae58596 | ||
|
|
7ad75a81ca | ||
|
|
f84dc7b78f | ||
|
|
882525b879 | ||
|
|
24e233ea2e | ||
|
|
c6d5b30704 | ||
|
|
0dc3cb7cd1 | ||
|
|
d4192bf863 | ||
|
|
8c963356cb | ||
|
|
20c723e242 | ||
|
|
3ddb499280 | ||
|
|
b56e8c5c4b | ||
|
|
d8a7de8ffb | ||
|
|
7695b8ada0 | ||
|
|
a72c7bcd6a | ||
|
|
2780ac962e | ||
|
|
e47f94cb43 | ||
|
|
625259d226 | ||
|
|
2fef14ff76 | ||
|
|
ce76957a10 | ||
|
|
1bf219b0dc | ||
|
|
a7056a6ac3 | ||
|
|
bba8a5be32 | ||
|
|
1e429d1fbf | ||
|
|
5d5a645083 | ||
|
|
1506916487 | ||
|
|
2db742f465 | ||
|
|
8bc8f7c66e | ||
|
|
99d5145c24 | ||
|
|
24560eae1d | ||
|
|
67031da928 | ||
|
|
87ee61bcb1 | ||
|
|
83885c1ebb | ||
|
|
2d72e42c6c | ||
|
|
71a38563ae | ||
|
|
4cf9db9f95 | ||
|
|
c4d4ade9d0 | ||
|
|
d127393897 | ||
|
|
b51d8f5386 | ||
|
|
b146e235f8 | ||
|
|
07ee8c1069 | ||
|
|
246233c402 | ||
|
|
58cff70724 | ||
|
|
e90e24b30b | ||
|
|
0b2c8b09c6 | ||
|
|
460f552a41 | ||
|
|
9bfe4780d4 | ||
|
|
f26ce59fb5 | ||
|
|
f32f65d4f7 | ||
|
|
5b381ce7d7 | ||
|
|
3fb2eedab8 | ||
|
|
fe31cf5b83 | ||
|
|
2389561406 | ||
|
|
a7f1ba05b4 | ||
|
|
3aaf5c7045 | ||
|
|
73703095b2 | ||
|
|
0fca588275 | ||
|
|
2dbf366184 | ||
|
|
ed81267291 | ||
|
|
1a8ce8a611 | ||
|
|
c5b766969a | ||
|
|
00eb49443a | ||
|
|
45617a3285 | ||
|
|
85cab3b85f | ||
|
|
e4efd6820a | ||
|
|
2faa1290c0 | ||
|
|
bdc5782f16 | ||
|
|
42373efcfd | ||
|
|
6ae982cccf | ||
|
|
842dce0e1b | ||
|
|
27b53c6ff4 | ||
|
|
aeb4e8a13a | ||
|
|
c7756befee | ||
|
|
21d567f731 | ||
|
|
d4e95293d9 | ||
|
|
76d3bc631e | ||
|
|
99c4031d89 | ||
|
|
a0d8b8a3b7 | ||
|
|
3f806010d2 | ||
|
|
94fdcdf18b | ||
|
|
2bb419f92c | ||
|
|
635c3b7af7 | ||
|
|
6954b7c3ef | ||
|
|
2bb0cbe16e | ||
|
|
cdaeef20ce | ||
|
|
ec4a0af41c | ||
|
|
37d7c75db8 | ||
|
|
1ad1c293a3 | ||
|
|
085ab96abd | ||
|
|
438753522e | ||
|
|
fc69e2541e | ||
|
|
942cf1635a | ||
|
|
bf47711ee7 | ||
|
|
723768137b | ||
|
|
268ef2d8e9 | ||
|
|
5f47d8b6f1 | ||
|
|
11716ed2da | ||
|
|
1910751558 | ||
|
|
fc37cc4a02 | ||
|
|
98b04198c6 | ||
|
|
6d61f06a53 | ||
|
|
53aabf3f14 | ||
|
|
fb9a49cb1a | ||
|
|
fede2cfa18 | ||
|
|
fc89bf6e2c | ||
|
|
b261177b8f | ||
|
|
0b914c8f5d | ||
|
|
650d913f51 | ||
|
|
faea63cb3c | ||
|
|
0c51cfa5f6 | ||
|
|
570645a845 | ||
|
|
275ac8622a | ||
|
|
99de8a6dcd | ||
|
|
91e3843732 | ||
|
|
32b42cff14 | ||
|
|
0163dfdcab | ||
|
|
1396269d57 | ||
|
|
bd9105794b | ||
|
|
e51aafb499 | ||
|
|
133afdc9e6 | ||
|
|
f5606a44a6 | ||
|
|
60575d9a49 | ||
|
|
409c0f79be | ||
|
|
09b22c175b | ||
|
|
af327b49aa | ||
|
|
7d7c09e718 | ||
|
|
39eae0e4c3 | ||
|
|
dc1593d60f | ||
|
|
1e204da223 | ||
|
|
ece26c7481 | ||
|
|
6738cba617 | ||
|
|
1290e7836f | ||
|
|
646679da4d | ||
|
|
fd26f49958 | ||
|
|
8bfc7f1caa | ||
|
|
8580464e51 | ||
|
|
fffb3bde7a | ||
|
|
facfda73eb | ||
|
|
50f85b4512 | ||
|
|
e175adcd46 | ||
|
|
0c0ea60b77 | ||
|
|
87df2fd2fc | ||
|
|
faf00ca1e0 | ||
|
|
b331668c06 | ||
|
|
8e8e273e11 | ||
|
|
6452fb3693 | ||
|
|
348a45132b | ||
|
|
3c87c095c3 | ||
|
|
2724d7880d | ||
|
|
26e2d22d62 | ||
|
|
a144e2167d | ||
|
|
2b4003cc81 | ||
|
|
1f87e64127 | ||
|
|
d7d4c98775 | ||
|
|
89d238bb32 | ||
|
|
7fee9a04c4 | ||
|
|
39fb2edc25 | ||
|
|
0863924483 | ||
|
|
8e2793085e | ||
|
|
8518d55834 | ||
|
|
ae7ec4802a | ||
|
|
229bd668f4 | ||
|
|
13a0473cf9 | ||
|
|
49d61632f9 | ||
|
|
4a7a9f4dd2 | ||
|
|
ce8a9becdf | ||
|
|
5aec655b8b | ||
|
|
2c0776e987 | ||
|
|
203c7aa015 | ||
|
|
fe234e08ee | ||
|
|
77885de85e | ||
|
|
b407512248 | ||
|
|
dde3dcf14d | ||
|
|
926721d54e | ||
|
|
24b2dfc0d5 | ||
|
|
ef0906bc83 | ||
|
|
90def2ee5a | ||
|
|
1ca60754b2 | ||
|
|
f63e34e0f9 | ||
|
|
dcb8390bb2 | ||
|
|
9f5b5445d7 | ||
|
|
d53b48bdf0 | ||
|
|
84ee7076d9 | ||
|
|
5a555deb74 | ||
|
|
b8a2e808c6 | ||
|
|
e9d3ba0b11 | ||
|
|
c86697f51b | ||
|
|
5a09d17c45 | ||
|
|
c95940cfc6 | ||
|
|
b12e8b6943 | ||
|
|
cd65f78a62 | ||
|
|
bda7a1d0bd | ||
|
|
43f5fae2ee | ||
|
|
f9fa0191ec | ||
|
|
8a2d9c4120 | ||
|
|
90957cd9d9 | ||
|
|
3cda204626 | ||
|
|
59afc2c4d9 | ||
|
|
dd1e62ebcd | ||
|
|
a6c6c3dc4a | ||
|
|
66a5671e3b | ||
|
|
e858d93a8e | ||
|
|
e40774f546 | ||
|
|
fe38d6f52c | ||
|
|
8586c51016 | ||
|
|
fb430c403b | ||
|
|
5597a1e390 | ||
|
|
3b1eebbfad | ||
|
|
80ba722497 | ||
|
|
52d9838978 | ||
|
|
7a15ff2083 | ||
|
|
0600ae7d1c | ||
|
|
29d46b749d | ||
|
|
ea8e8e517e | ||
|
|
723fcfa64d | ||
|
|
6e1f5cfe4b | ||
|
|
5872be28a2 | ||
|
|
6cb1eefc49 | ||
|
|
4181283f29 | ||
|
|
bb66dac8e6 | ||
|
|
0c2c0a846d | ||
|
|
d462806ea9 | ||
|
|
859c111d01 | ||
|
|
82f372ef4f | ||
|
|
5a2c8af7ec | ||
|
|
2e9c630ab1 | ||
|
|
2fd699cc66 | ||
|
|
fcfcd1a2c4 | ||
|
|
8f6c08330a | ||
|
|
7832d712fd | ||
|
|
3610d2c2ec | ||
|
|
9a39164ed5 | ||
|
|
4f17e0cfe9 | ||
|
|
c1f1c643ff | ||
|
|
8e56e138cc | ||
|
|
1cf826dbad | ||
|
|
13c6f2948e | ||
|
|
533b7e1eb8 | ||
|
|
3a9db8d98c | ||
|
|
613ea66c95 | ||
|
|
efa436974d | ||
|
|
cfadb231d2 | ||
|
|
2d4781be24 | ||
|
|
e0408eee74 | ||
|
|
96d8c65ab4 | ||
|
|
9666dda282 | ||
|
|
2408edb239 | ||
|
|
10d77be0d2 | ||
|
|
59611b8b37 | ||
|
|
90bd57fe40 | ||
|
|
ec7d96fcb7 | ||
|
|
c53fd7ef0c | ||
|
|
d40eedeaaf | ||
|
|
1c55894e1d | ||
|
|
7322ebbc83 | ||
|
|
c69bd27f78 | ||
|
|
6691cc0c06 | ||
|
|
3eb383d4a5 | ||
|
|
14eaa9006c | ||
|
|
4a09511372 | ||
|
|
ebbbde8964 | ||
|
|
62de77e2c8 | ||
|
|
c863f3769e | ||
|
|
1d844c4557 | ||
|
|
908fa17e0f | ||
|
|
01fda292e6 | ||
|
|
4ff727d702 | ||
|
|
97701eb2e9 | ||
|
|
0a69062c6b | ||
|
|
d5e7426181 | ||
|
|
41819270bb | ||
|
|
8342d0d616 | ||
|
|
19483d2097 | ||
|
|
225acf4a22 | ||
|
|
fb67b54787 | ||
|
|
23b69537a5 | ||
|
|
ee3fa19ed9 | ||
|
|
f274f5bdc5 | ||
|
|
5a8eee91c3 | ||
|
|
647a7e047a | ||
|
|
dadfebc6c3 | ||
|
|
8748013f7d | ||
|
|
63091cd29c | ||
|
|
9a6fc789eb | ||
|
|
f3c91cb05c | ||
|
|
13058fd638 | ||
|
|
c94f8c9b63 | ||
|
|
ea451c7241 | ||
|
|
4682f9b235 | ||
|
|
185e421114 | ||
|
|
a3437067ac | ||
|
|
f07121f830 | ||
|
|
f41be7399b | ||
|
|
307568f631 | ||
|
|
9b24da3398 | ||
|
|
b7f9df6e4f | ||
|
|
fda4d3f820 | ||
|
|
0eec3bc349 | ||
|
|
d98367f53b | ||
|
|
03de885b13 | ||
|
|
6b3a26bc40 | ||
|
|
e8ea23e719 | ||
|
|
c447b45d45 | ||
|
|
d904c2758f | ||
|
|
9e1e128b14 | ||
|
|
52c7445a79 | ||
|
|
db80c02342 | ||
|
|
4d7dc3ba25 | ||
|
|
85c1bc34e3 | ||
|
|
24f3b5230c | ||
|
|
7e73208e62 | ||
|
|
22152878f8 | ||
|
|
89a7fad16d | ||
|
|
fe6ea62363 | ||
|
|
957ff20f37 | ||
|
|
ec7b5cd7e6 | ||
|
|
c55e08b31e | ||
|
|
09db742c3e | ||
|
|
a36cf1f01e | ||
|
|
a9882a6689 | ||
|
|
0bd265cbde | ||
|
|
9fc98b5ea3 | ||
|
|
13bfb2db59 | ||
|
|
e445863ae4 | ||
|
|
42a7a17cb9 | ||
|
|
adc3274395 | ||
|
|
249d747a53 | ||
|
|
f2b40ba5b5 | ||
|
|
4470d11c39 | ||
|
|
9582d8fbcb | ||
|
|
90f9194558 | ||
|
|
dc6c279339 | ||
|
|
2f2cb6b7ae | ||
|
|
8dc1dd2fb4 | ||
|
|
86dc27dcb8 | ||
|
|
cfb591a9e9 | ||
|
|
8c0fadc068 | ||
|
|
ad3b8eca69 | ||
|
|
20cb199e55 | ||
|
|
ef94506c34 | ||
|
|
55a267a171 | ||
|
|
ba9af46662 | ||
|
|
fa66a059d9 | ||
|
|
1d36a1cd05 | ||
|
|
5db8cdb98f | ||
|
|
0cf2885e84 | ||
|
|
f9c3bcd384 | ||
|
|
96520e22bd | ||
|
|
ff0ab2da93 | ||
|
|
174f7f498a | ||
|
|
041024fbb9 | ||
|
|
a23943694b | ||
|
|
e760d69bfd | ||
|
|
c2d0d5e344 | ||
|
|
a06c41c5c9 | ||
|
|
ee511e95b2 | ||
|
|
8454c23fcc | ||
|
|
2aa558d6f4 | ||
|
|
0eeff69332 | ||
|
|
1a897f8714 | ||
|
|
d94304f419 | ||
|
|
4535aee30f | ||
|
|
6ca598f841 | ||
|
|
69a8ad5bba | ||
|
|
78aa7de9bc | ||
|
|
94ccaf1ab4 | ||
|
|
4fcf5c921c | ||
|
|
5158953428 | ||
|
|
63818bcaa4 | ||
|
|
88ef238593 | ||
|
|
046513b7c9 | ||
|
|
7d6cd0c92d | ||
|
|
103018b367 | ||
|
|
52146825de | ||
|
|
a43a5ebb21 | ||
|
|
8fc08b1e46 | ||
|
|
b23cbf384f | ||
|
|
2d0d4b06b1 | ||
|
|
944b6aa53f | ||
|
|
6ef41abdd2 | ||
|
|
7a01453f00 | ||
|
|
b809cf62ae | ||
|
|
0ddd19d4ab | ||
|
|
6a78f7eae2 | ||
|
|
724043be0b | ||
|
|
c3b77fba25 | ||
|
|
218f63b4b6 | ||
|
|
b4b51bd909 | ||
|
|
bef713de1a | ||
|
|
8f4b970dc1 | ||
|
|
439e0a9588 | ||
|
|
da8aec4292 | ||
|
|
d73df9bbd4 | ||
|
|
d734ce4635 | ||
|
|
2cd39b37c2 | ||
|
|
ea27cace41 | ||
|
|
9913af3a8e | ||
|
|
f927ce9b58 | ||
|
|
5d9d49e989 | ||
|
|
d31466ae7a | ||
|
|
7d55b028f2 | ||
|
|
44234a0ccc | ||
|
|
6be12f4889 | ||
|
|
b7eadfd310 | ||
|
|
a7a8d57bca | ||
|
|
00cd134720 | ||
|
|
c3c1bdd29d | ||
|
|
550e2bcf3b | ||
|
|
57343ce04c | ||
|
|
fdc2143bfa | ||
|
|
5867250820 | ||
|
|
70215e3682 | ||
|
|
8ebf5ac605 | ||
|
|
85e5e383f9 | ||
|
|
a8651ac014 | ||
|
|
1c08ea01f1 | ||
|
|
0d23312886 | ||
|
|
c44c1ac9ce | ||
|
|
32ba1ebcff | ||
|
|
138d22a254 | ||
|
|
330bed0c42 | ||
|
|
f72125ea71 | ||
|
|
4695920b41 | ||
|
|
e95c075f0c | ||
|
|
4a5154e750 | ||
|
|
b3646b3237 | ||
|
|
061292130d | ||
|
|
d1c1aa369c | ||
|
|
7d52dda67c | ||
|
|
0f2d32f011 | ||
|
|
a1f1e34789 | ||
|
|
eac440ae9e | ||
|
|
dc3bc64b86 | ||
|
|
9ccb8a97af | ||
|
|
bf8e07966b | ||
|
|
093fada00b | ||
|
|
4890a65106 | ||
|
|
2ec75c5f8e | ||
|
|
29501638d1 | ||
|
|
856395962b | ||
|
|
bb2149aac8 | ||
|
|
8e4a68af3b | ||
|
|
4a8040735b | ||
|
|
ae28d51016 | ||
|
|
32f11001c0 | ||
|
|
a0ebc22d1f | ||
|
|
9159a0777d | ||
|
|
0718a4ec20 | ||
|
|
f2cda804dc | ||
|
|
b68fec97ea | ||
|
|
eefaefccc0 | ||
|
|
2784652ab8 | ||
|
|
a284922ce4 | ||
|
|
c4d30b34ba | ||
|
|
a5203dd006 | ||
|
|
474505d704 | ||
|
|
d3db2548b5 | ||
|
|
f397f70fbe | ||
|
|
ae5867f8b1 | ||
|
|
ec4be21492 | ||
|
|
ed604cf0f3 | ||
|
|
ef196b5ca5 | ||
|
|
279c99fdf8 | ||
|
|
f80f7d47d5 | ||
|
|
8e6707cc22 | ||
|
|
f09f8e3a31 | ||
|
|
21be04cb6e | ||
|
|
ba1e9c8f4d | ||
|
|
6e73a8a393 | ||
|
|
176bec1bb2 | ||
|
|
31b238872e | ||
|
|
b730e965c5 | ||
|
|
a916135f3c | ||
|
|
b2020c9fb7 | ||
|
|
188b459d28 | ||
|
|
39bf211ebe | ||
|
|
06af5ce7fd | ||
|
|
7fb5af6ada | ||
|
|
cb9859fa0e | ||
|
|
717ffadf93 | ||
|
|
419586d4a2 | ||
|
|
450cde5fac | ||
|
|
b2d119f781 | ||
|
|
7818c0e0e3 | ||
|
|
86529dadde | ||
|
|
544c55debc | ||
|
|
2b826843de | ||
|
|
b920bb2a6a | ||
|
|
5012e0941a | ||
|
|
1eb8aec9fa | ||
|
|
2b8aa2df16 | ||
|
|
5f252f2c50 | ||
|
|
d5f34ad49d | ||
|
|
608e86c7bc | ||
|
|
516da2229d | ||
|
|
28a9eaf0e3 | ||
|
|
de0c30dded | ||
|
|
1ab00f3e3c | ||
|
|
651bea29b4 | ||
|
|
4e03adc2e7 | ||
|
|
d1a3316e44 | ||
|
|
2c96d17748 | ||
|
|
ad4af09d88 | ||
|
|
96b39a5973 | ||
|
|
b16cfa959d | ||
|
|
f98a691933 | ||
|
|
35497f87a7 | ||
|
|
d01fa11983 | ||
|
|
3d8d088b06 | ||
|
|
89a9763b11 | ||
|
|
1efb782666 | ||
|
|
38f3fc816a | ||
|
|
3794df4f31 | ||
|
|
3502681f77 | ||
|
|
8252cc3ec7 | ||
|
|
6a254778e2 | ||
|
|
41607d126a | ||
|
|
f53554a46a | ||
|
|
03e64e842a | ||
|
|
2894bade88 | ||
|
|
cc02c78a8c | ||
|
|
4f56a0a53d | ||
|
|
cbc28bd4fe | ||
|
|
9a31c23881 | ||
|
|
55b3400afa | ||
|
|
8f5fd67ff3 | ||
|
|
ad9b40d599 | ||
|
|
271d39d942 | ||
|
|
696166c9d4 | ||
|
|
aba8840625 | ||
|
|
ac981c62c5 | ||
|
|
41c12afefd | ||
|
|
7c050d681d | ||
|
|
c178e325b8 | ||
|
|
8d787dcd71 | ||
|
|
25c3d15ed7 | ||
|
|
ec9ff0fc1d | ||
|
|
9a228ff045 | ||
|
|
a8cc93f995 | ||
|
|
2b1a166d23 | ||
|
|
a27792cfcf | ||
|
|
e18f3cf381 | ||
|
|
f4c864e88e | ||
|
|
a8112b8373 | ||
|
|
2dbbd6b9d2 | ||
|
|
c92d51e040 | ||
|
|
258ba629a2 | ||
|
|
d90d9f0c40 | ||
|
|
bbcc944855 | ||
|
|
e1157ea935 | ||
|
|
9267450346 | ||
|
|
bb5e96a679 | ||
|
|
b8373ae933 | ||
|
|
5ef923f26c | ||
|
|
7a89f0f0e1 | ||
|
|
496701851f | ||
|
|
4b9f8b232b | ||
|
|
02cbecff64 | ||
|
|
fbe1bbaffd | ||
|
|
94737b2a7a | ||
|
|
07156b6c09 | ||
|
|
18dc75ee62 | ||
|
|
a3f7bcf45b | ||
|
|
c98400a2b7 | ||
|
|
5b151492bd | ||
|
|
c27461572c | ||
|
|
6349162303 | ||
|
|
e935ec55dd | ||
|
|
d328269492 | ||
|
|
134ef04140 | ||
|
|
c8c8cc517d | ||
|
|
e673006969 | ||
|
|
520d885840 | ||
|
|
eb9cb16aeb | ||
|
|
32e72d1117 | ||
|
|
fd0e434087 | ||
|
|
84a279a83f | ||
|
|
9a6b371c96 | ||
|
|
078614fbce | ||
|
|
ec327c006e | ||
|
|
03afe1224a | ||
|
|
11013ce71e | ||
|
|
a185b540bd | ||
|
|
a5df5d981a | ||
|
|
dfff927389 | ||
|
|
e6ebc63c66 | ||
|
|
f31c7b3a88 | ||
|
|
bc9005968a | ||
|
|
b2438b5029 | ||
|
|
51fa86b246 | ||
|
|
b5dfe9c9ed | ||
|
|
c3353c71d4 |
@@ -0,0 +1,50 @@
|
||||
# Set the default behavior, in case people don't have core.autocrlf set.
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files that could be normalized and converted
|
||||
# to native line endings on checkout. However, as per the policy they're
|
||||
# supposed to have LF endings on all platforms.
|
||||
*.[ch] text diff=cpp eol=lf
|
||||
*.[ch]pp text diff=cpp eol=lf
|
||||
*.asm text eol=lf
|
||||
Makefile text eol=lf
|
||||
*.make text eol=lf
|
||||
*.mk text eol=lf
|
||||
*.inc text eol=lf
|
||||
*.md text eol=lf
|
||||
*.xml text eol=lf
|
||||
*.xpm text -diff -merge eol=lf
|
||||
*.pem text -diff -merge eol=lf
|
||||
*.cer text -diff -merge eol=lf
|
||||
*.manifest text eol=lf
|
||||
*.sh text eol=lf
|
||||
*.txt text eol=lf
|
||||
*.html text diff=html eol=lf
|
||||
*.idl text eol=lf
|
||||
*.fbp text eol=lf
|
||||
*.rgs text eol=lf
|
||||
*.pkgproj text eol=lf
|
||||
Sources text eol=lf
|
||||
|
||||
# Declare files that will always have LF line endings on checkout.
|
||||
*.desktop text eol=lf
|
||||
|
||||
# Declare files that will always have CRLF line endings on checkout.
|
||||
*.sln text eol=crlf
|
||||
*.vcproj text eol=crlf
|
||||
*.rc text eol=crlf
|
||||
*.bat text eol=crlf
|
||||
*.cmd text eol=crlf
|
||||
|
||||
# Denote all files that are truly binary and should not be modified.
|
||||
*.png binary
|
||||
*.jpg binary
|
||||
*.pdf binary
|
||||
*.bmp binary
|
||||
*.ico binary
|
||||
*.od[fgpst] binary
|
||||
*.hc binary
|
||||
*.icns binary
|
||||
*.rtf binary
|
||||
*.bz2 binary
|
||||
*.pfx binary
|
||||
+744
@@ -0,0 +1,744 @@
|
||||
VeraCrypt License
|
||||
Software distributed under this license is distributed on an "AS
|
||||
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
|
||||
DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
|
||||
USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
|
||||
SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
|
||||
BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
|
||||
ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
|
||||
SOFTWARE, NOR ANY PART(S) THEREOF.
|
||||
|
||||
VeraCrypt is multi-licensed under Apache License 2.0 and
|
||||
the TrueCrypt License version 3.0, a verbatim copy of both
|
||||
licenses can be found below.
|
||||
|
||||
This license does not grant you rights to use any
|
||||
contributors' name, logo, or trademarks, including IDRIX,
|
||||
VeraCrypt and all derivative names.
|
||||
For example, the following names are not allowed: VeraCrypt,
|
||||
VeraCrypt+, VeraCrypt Professional, iVeraCrypt, etc. Nor any
|
||||
other names confusingly similar to the name VeraCrypt (e.g.,
|
||||
Vera-Crypt, Vera Crypt, VerKrypt, etc.)
|
||||
____________________________________________________________
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
https://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
____________________________________________________________
|
||||
|
||||
TrueCrypt License Version 3.0
|
||||
|
||||
Software distributed under this license is distributed on an "AS
|
||||
IS" BASIS WITHOUT WARRANTIES OF ANY KIND. THE AUTHORS AND
|
||||
DISTRIBUTORS OF THE SOFTWARE DISCLAIM ANY LIABILITY. ANYONE WHO
|
||||
USES, COPIES, MODIFIES, OR (RE)DISTRIBUTES ANY PART OF THE
|
||||
SOFTWARE IS, BY SUCH ACTION(S), ACCEPTING AND AGREEING TO BE
|
||||
BOUND BY ALL TERMS AND CONDITIONS OF THIS LICENSE. IF YOU DO NOT
|
||||
ACCEPT THEM, DO NOT USE, COPY, MODIFY, NOR (RE)DISTRIBUTE THE
|
||||
SOFTWARE, NOR ANY PART(S) THEREOF.
|
||||
|
||||
|
||||
I. Definitions
|
||||
|
||||
1. "This Product" means the work (including, but not limited to,
|
||||
source code, graphics, texts, and accompanying files) made
|
||||
available under and governed by this version of this license
|
||||
("License"), as may be indicated by, but is not limited to,
|
||||
copyright notice(s) attached to or included in the work.
|
||||
|
||||
2. "You" means (and "Your" refers to) an individual or a legal
|
||||
entity (e.g., a non-profit organization, commercial
|
||||
organization, government agency, etc.) exercising permissions
|
||||
granted by this License.
|
||||
|
||||
3. "Modification" means (and "modify" refers to) any alteration
|
||||
of This Product, including, but not limited to, addition to or
|
||||
deletion from the substance or structure of This Product,
|
||||
translation into another language, repackaging, alteration or
|
||||
removal of any file included with This Product, and addition of
|
||||
any new files to This Product.
|
||||
|
||||
4. "Your Product" means This Product modified by You, or any
|
||||
work You derive from (or base on) any part of This Product. In
|
||||
addition, "Your Product" means any work in which You include any
|
||||
(modified or unmodified) portion of This Product. However, if
|
||||
the work in which you include it is an aggregate software
|
||||
distribution (such as an operating system distribution or a
|
||||
cover CD-ROM of a magazine) containing multiple separate
|
||||
products, then the term "Your Product" includes only those
|
||||
products (in the aggregate software distribution) that use,
|
||||
include, or depend on a modified or unmodified version of This
|
||||
Product (and the term "Your Product" does not include the whole
|
||||
aggregate software distribution). For the purposes of this
|
||||
License, a product suite consisting of two or more products is
|
||||
considered a single product (operating system distributions and
|
||||
cover media of magazines are not considered product suites).
|
||||
|
||||
5. "Distribution" means (and "distribute" refers to), regardless
|
||||
of means or methods, conveyance, transfer, providing, or making
|
||||
available of This/Your Product or portions thereof to third
|
||||
parties (including, but not limited to, making This/Your
|
||||
Product, or portions thereof, available for download to third
|
||||
parties, whether or not any third party has downloaded the
|
||||
product, or any portion thereof, made available for download).
|
||||
|
||||
|
||||
|
||||
II. Use, Copying, and Distribution of This Product
|
||||
|
||||
1. Provided that You comply with all applicable terms and
|
||||
conditions of this License, You may make copies of This Product
|
||||
(unmodified) and distribute copies of This Product (unmodified)
|
||||
that are not included in another product forming Your Product
|
||||
(except as permitted under Chapter III). Note: For terms and
|
||||
conditions for copying and distribution of modified versions of
|
||||
This Product, see Chapter III.
|
||||
|
||||
2. Provided that You comply with all applicable terms and
|
||||
conditions of this License, You may use This Product freely (see
|
||||
also Chapter III) on any number of computers/systems for non-
|
||||
commercial and/or commercial purposes.
|
||||
|
||||
|
||||
|
||||
III. Modification, Derivation, and Inclusion in Other Products
|
||||
|
||||
1. If all conditions specified in the following paragraphs in
|
||||
this Chapter (III) are met (for exceptions, see Section III.2)
|
||||
and if You comply with all other applicable terms and conditions
|
||||
of this License, You may modify This Product (thus forming Your
|
||||
Product), derive new works from This Product or portions thereof
|
||||
(thus forming Your Product), include This Product or portions
|
||||
thereof in another product (thus forming Your Product, unless
|
||||
defined otherwise in Chapter I), and You may use (for non-
|
||||
commercial and/or commercial purposes), copy, and/or distribute
|
||||
Your Product.
|
||||
|
||||
a. The name of Your Product (or of Your modified version of
|
||||
This Product) must not contain the name TrueCrypt (for
|
||||
example, the following names are not allowed: TrueCrypt,
|
||||
TrueCrypt+, TrueCrypt Professional, iTrueCrypt, etc.) nor
|
||||
any other names confusingly similar to the name TrueCrypt
|
||||
(e.g., True-Crypt, True Crypt, TruKrypt, etc.)
|
||||
|
||||
All occurrences of the name TrueCrypt that could reasonably
|
||||
be considered to identify Your Product must be removed from
|
||||
Your Product and from any associated materials. Logo(s)
|
||||
included in (or attached to) Your Product (and in/to
|
||||
associated materials) must not incorporate and must not be
|
||||
confusingly similar to any of the TrueCrypt logos
|
||||
(including, but not limited to, the non-textual logo
|
||||
consisting primarily of a key in stylized form) or
|
||||
portion(s) thereof. All graphics contained in This Product
|
||||
(logos, icons, etc.) must be removed from Your Product (or
|
||||
from Your modified version of This Product) and from any
|
||||
associated materials.
|
||||
|
||||
b. The following phrases must be removed from Your Product
|
||||
and from any associated materials, except the text of this
|
||||
License: "A TrueCrypt Foundation Release", "Released by
|
||||
TrueCrypt Foundation", "This is a TrueCrypt Foundation
|
||||
release."
|
||||
|
||||
c. Phrase "Based on TrueCrypt, freely available at
|
||||
http://www.truecrypt.org/" must be displayed by Your Product
|
||||
(if technically feasible) and contained in its
|
||||
documentation. Alternatively, if This Product or its portion
|
||||
You included in Your Product constitutes only a minor
|
||||
portion of Your Product, phrase "Portions of this product
|
||||
are based in part on TrueCrypt, freely available at
|
||||
http://www.truecrypt.org/" may be displayed instead. In each
|
||||
of the cases mentioned above in this paragraph,
|
||||
"http://www.truecrypt.org/" must be a hyperlink (if
|
||||
technically feasible) pointing to http://www.truecrypt.org/
|
||||
and You may freely choose the location within the user
|
||||
interface (if there is any) of Your Product (e.g., an
|
||||
"About" window, etc.) and the way in which Your Product will
|
||||
display the respective phrase.
|
||||
|
||||
Your Product (and any associated materials, e.g., the
|
||||
documentation, the content of the official web site of Your
|
||||
Product, etc.) must not present any Internet address
|
||||
containing the domain name truecrypt.org (or any domain name
|
||||
that forwards to the domain name truecrypt.org) in a manner
|
||||
that might suggest that it is where information about Your
|
||||
Product may be obtained or where bugs found in Your Product
|
||||
may be reported or where support for Your Product may be
|
||||
available or otherwise attempt to indicate that the domain
|
||||
name truecrypt.org is associated with Your Product.
|
||||
|
||||
d. The complete source code of Your Product must be freely
|
||||
and publicly available (for exceptions, see Section III.2)
|
||||
at least until You cease to distribute Your Product. This
|
||||
condition can be met in one or both of the following ways:
|
||||
(i) You include the complete source code of Your Product
|
||||
with every copy of Your Product that You make and distribute
|
||||
and You make all such copies of Your Product available to
|
||||
the general public free of charge, and/or (ii) You include
|
||||
information (valid and correct at least until You cease to
|
||||
distribute Your Product) about where the complete source
|
||||
code of Your Product can be obtained free of charge (e.g.,
|
||||
an Internet address) or for a reasonable reproduction fee
|
||||
with every copy of Your Product that You make and distribute
|
||||
and, if there is a web site officially associated with Your
|
||||
Product, You include the aforementioned information about
|
||||
the source code on a freely and publicly accessible web
|
||||
page to which such web site links via an easily viewable
|
||||
hyperlink (at least until You cease to distribute Your
|
||||
Product).
|
||||
|
||||
The source code of Your Product must not be deliberately
|
||||
obfuscated and it must not be in an intermediate form (e.g.,
|
||||
the output of a preprocessor). Source code means the
|
||||
preferred form in which a programmer would usually modify
|
||||
the program.
|
||||
|
||||
Portions of the source code of Your Product not contained in
|
||||
This Product (e.g., portions added by You in creating Your
|
||||
Product, whether created by You or by third parties) must be
|
||||
available under license(s) that (however, see also
|
||||
Subsection III.1.e) allow(s) anyone to modify and derive new
|
||||
works from the portions of the source code that are not
|
||||
contained in This Product and to use, copy, and redistribute
|
||||
such modifications and/or derivative works. The license(s)
|
||||
must be perpetual, non-exclusive, royalty-free, no-charge,
|
||||
and worldwide, and must not invalidate, weaken, restrict,
|
||||
interpret, amend, modify, interfere with or otherwise affect
|
||||
any part, term, provision, or clause of this License. The
|
||||
text(s) of the license(s) must be included with every copy
|
||||
of Your Product that You make and distribute.
|
||||
|
||||
e. You must not change the license terms of This Product in
|
||||
any way (adding any new terms is considered changing the
|
||||
license terms even if the original terms are retained),
|
||||
which means, e.g., that no part of This Product may be put
|
||||
under another license. You must keep intact all the legal
|
||||
notices contained in the source code files. You must include
|
||||
the following items with every copy of Your Product that You
|
||||
make and distribute: a clear and conspicuous notice stating
|
||||
that Your Product or portion(s) thereof is/are governed by
|
||||
this version of the TrueCrypt License, a verbatim copy of
|
||||
this version of the TrueCrypt License (as contained herein),
|
||||
a clear and conspicuous notice containing information about
|
||||
where the included copy of the License can be found, and an
|
||||
appropriate copyright notice.
|
||||
|
||||
|
||||
2. You are not obligated to comply with Subsection III.1.d if
|
||||
Your Product is not distributed (i.e., Your Product is available
|
||||
only to You).
|
||||
|
||||
|
||||
|
||||
IV. Disclaimer of Liability, Disclaimer of Warranty,
|
||||
Indemnification
|
||||
|
||||
You expressly acknowledge and agree to the following:
|
||||
|
||||
1. IN NO EVENT WILL ANY (CO)AUTHOR OF THIS PRODUCT, OR ANY
|
||||
APPLICABLE INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY WHO
|
||||
MAY COPY AND/OR (RE)DISTRIBUTE THIS PRODUCT OR PORTIONS THEREOF,
|
||||
AS MAY BE PERMITTED HEREIN, BE LIABLE TO YOU OR TO ANY OTHER
|
||||
PARTY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, ANY
|
||||
DIRECT, INDIRECT, GENERAL, SPECIAL, INCIDENTAL, PUNITIVE,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, CORRUPTION OR LOSS OF DATA, ANY LOSSES SUSTAINED BY YOU OR
|
||||
THIRD PARTIES, A FAILURE OF THIS PRODUCT TO OPERATE WITH ANY
|
||||
OTHER PRODUCT, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR
|
||||
BUSINESS INTERRUPTION), WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
TORT (INCLUDING, BUT NOT LIMITED TO, NEGLIGENCE) OR OTHERWISE,
|
||||
ARISING OUT OF THE USE, COPYING, MODIFICATION, OR
|
||||
(RE)DISTRIBUTION OF THIS PRODUCT (OR A PORTION THEREOF) OR OF
|
||||
YOUR PRODUCT (OR A PORTION THEREOF), OR INABILITY TO USE THIS
|
||||
PRODUCT (OR A PORTION THEREOF), EVEN IF SUCH DAMAGES (OR THE
|
||||
POSSIBILITY OF SUCH DAMAGES) ARE/WERE PREDICTABLE OR KNOWN TO
|
||||
ANY (CO)AUTHOR, INTELLECTUAL-PROPERTY OWNER, OR ANY OTHER PARTY.
|
||||
|
||||
2. THIS PRODUCT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THE ENTIRE RISK AS TO
|
||||
THE QUALITY AND PERFORMANCE OF THIS PRODUCT IS WITH YOU. SHOULD
|
||||
THIS PRODUCT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
|
||||
NECESSARY SERVICING, REPAIR, OR CORRECTION.
|
||||
|
||||
3. THIS PRODUCT MAY INCORPORATE IMPLEMENTATIONS OF CRYPTOGRAPHIC
|
||||
ALGORITHMS THAT ARE REGULATED (E.G., SUBJECT TO EXPORT/IMPORT
|
||||
CONTROL REGULATIONS) OR ILLEGAL IN SOME COUNTRIES. IT IS SOLELY
|
||||
YOUR RESPONSIBILITY TO VERIFY THAT IT IS LEGAL TO IMPORT AND/OR
|
||||
(RE)EXPORT AND/OR USE THIS PRODUCT (OR PORTIONS THEREOF) IN
|
||||
COUNTRIES WHERE YOU INTEND TO USE IT AND/OR TO WHICH YOU INTEND
|
||||
TO IMPORT IT AND/OR FROM WHICH YOU INTEND TO EXPORT IT, AND IT
|
||||
IS SOLELY YOUR RESPONSIBILITY TO COMPLY WITH ANY APPLICABLE
|
||||
REGULATIONS, RESTRICTIONS, AND LAWS.
|
||||
|
||||
4. YOU SHALL INDEMNIFY, DEFEND AND HOLD ALL (CO)AUTHORS OF THIS
|
||||
PRODUCT, AND APPLICABLE INTELLECTUAL-PROPERTY OWNERS, HARMLESS
|
||||
FROM AND AGAINST ANY AND ALL LIABILITY, DAMAGES, LOSSES,
|
||||
SETTLEMENTS, PENALTIES, FINES, COSTS, EXPENSES (INCLUDING
|
||||
REASONABLE ATTORNEYS' FEES), DEMANDS, CAUSES OF ACTION, CLAIMS,
|
||||
ACTIONS, PROCEEDINGS, AND SUITS, DIRECTLY RELATED TO OR ARISING
|
||||
OUT OF YOUR USE, INABILITY TO USE, COPYING, (RE)DISTRIBUTION,
|
||||
IMPORT AND/OR (RE)EXPORT OF THIS PRODUCT (OR PORTIONS THEREOF)
|
||||
AND/OR YOUR BREACH OF ANY TERM OF THIS LICENSE.
|
||||
|
||||
|
||||
|
||||
V. Trademarks
|
||||
|
||||
This License does not grant permission to use trademarks
|
||||
associated with (or applying to) This Product, except for fair
|
||||
use as defined by applicable law and except for use expressly
|
||||
permitted or required by this License. Any attempt otherwise to
|
||||
use trademarks associated with (or applying to) This Product
|
||||
automatically and immediately terminates Your rights under This
|
||||
License and may constitute trademark infringement (which may be
|
||||
prosecuted).
|
||||
|
||||
|
||||
|
||||
VI. General Terms and Conditions, Miscellaneous Provisions
|
||||
|
||||
1. ANYONE WHO USES AND/OR COPIES AND/OR MODIFIES AND/OR CREATES
|
||||
DERIVATIVE WORKS OF AND/OR (RE)DISTRIBUTES THIS PRODUCT, OR ANY
|
||||
PORTION(S) THEREOF, IS, BY SUCH ACTION(S), AGREEING TO BE BOUND
|
||||
BY AND ACCEPTING ALL TERMS AND CONDITIONS OF THIS LICENSE (AND
|
||||
THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS LICENSE).
|
||||
IF YOU DO NOT ACCEPT (AND AGREE TO BE BOUND BY) ALL TERMS AND
|
||||
CONDITIONS OF THIS LICENSE, DO NOT USE, COPY, MODIFY, CREATE
|
||||
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
|
||||
PORTION(S) THEREOF.
|
||||
|
||||
2. YOU MAY NOT USE, MODIFY, COPY, CREATE DERIVATIVE WORKS OF,
|
||||
(RE)DISTRIBUTE, OR SUBLICENSE THIS PRODUCT, OR PORTION(S)
|
||||
THEREOF, EXCEPT AS EXPRESSLY PROVIDED IN THIS LICENSE (EVEN IF
|
||||
APPLICABLE LAW GIVES YOU MORE RIGHTS). ANY ATTEMPT (EVEN IF
|
||||
PERMITTED BY APPLICABLE LAW) OTHERWISE TO USE, MODIFY, COPY,
|
||||
CREATE DERIVATIVE WORKS OF, (RE)DISTRIBUTE, OR SUBLICENSE THIS
|
||||
PRODUCT, OR PORTION(S) THEREOF, AUTOMATICALLY AND IMMEDIATELY
|
||||
TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN CONSTITUTE
|
||||
COPYRIGHT INFRINGEMENT (WHICH MAY BE PROSECUTED). ANY CONDITIONS
|
||||
AND RESTRICTIONS CONTAINED IN THIS LICENSE ARE ALSO LIMITATIONS
|
||||
ON THE SCOPE OF THIS LICENSE AND ALSO DEFINE THE SCOPE OF YOUR
|
||||
RIGHTS UNDER THIS LICENSE. YOUR FAILURE TO COMPLY WITH THE TERMS
|
||||
AND CONDITIONS OF THIS LICENSE OR FAILURE TO PERFORM ANY
|
||||
APPLICABLE OBLIGATION IMPOSED BY THIS LICENSE AUTOMATICALLY AND
|
||||
IMMEDIATELY TERMINATES YOUR RIGHTS UNDER THIS LICENSE AND CAN
|
||||
CAUSE OR BE CONSIDERED COPYRIGHT INFRINGEMENT (WHICH MAY BE
|
||||
PROSECUTED). NOTHING IN THIS LICENSE SHALL IMPLY OR BE CONSTRUED
|
||||
AS A PROMISE, OBLIGATION, OR COVENANT NOT TO SUE FOR COPYRIGHT
|
||||
OR TRADEMARK INFRINGEMENT IF YOU DO NOT COMPLY WITH THE TERMS
|
||||
AND CONDITIONS OF THIS LICENSE.
|
||||
|
||||
3. This License does not constitute or imply a waiver of any
|
||||
intellectual property rights except as may be otherwise
|
||||
expressly provided in this License. This License does not
|
||||
transfer, assign, or convey any intellectual property rights
|
||||
(e.g., it does not transfer ownership of copyrights or
|
||||
trademarks).
|
||||
|
||||
4. Subject to the terms and conditions of this License, You may
|
||||
allow a third party to use Your copy of This Product (or a copy
|
||||
that You make and distribute, or Your Product) provided that the
|
||||
third party explicitly accepts and agrees to be bound by all
|
||||
terms and conditions of this License and the third party is not
|
||||
prohibited from using This Product (or portions thereof) by this
|
||||
License (see, e.g., Section VI.7) or by applicable law. However,
|
||||
You are not obligated to ensure that the third party accepts
|
||||
(and agrees to be bound by all terms of) this License if You
|
||||
distribute only the self-extracting package (containing This
|
||||
Product) that does not allow the user to install (nor extract)
|
||||
the files contained in the package until he or she accepts and
|
||||
agrees to be bound by all terms and conditions of this License.
|
||||
|
||||
5. Without specific prior written permission from the authors of
|
||||
This Product (or from their common representative), You must not
|
||||
use the name of This Product, the names of the authors of This
|
||||
Product, or the names of the legal entities (or informal groups)
|
||||
of which the authors were/are members/employees, to endorse or
|
||||
promote Your Product or any work in which You include a modified
|
||||
or unmodified version of This Product, or to endorse or promote
|
||||
You or Your affiliates, or in a way that might suggest that Your
|
||||
Product (or any work in which You include a modified or
|
||||
unmodified version of This Product), You, or Your affiliates
|
||||
is/are endorsed by one or more authors of This Product, or in a
|
||||
way that might suggest that one or more authors of This Product
|
||||
is/are affiliated with You (or Your affiliates) or directly
|
||||
participated in the creation of Your Product or of any work in
|
||||
which You include a modified or unmodified version of This
|
||||
Product.
|
||||
|
||||
6. IF YOU ARE NOT SURE WHETHER YOU UNDERSTAND ALL PARTS OF THIS
|
||||
LICENSE OR IF YOU ARE NOT SURE WHETHER YOU CAN COMPLY WITH ALL
|
||||
TERMS AND CONDITIONS OF THIS LICENSE, YOU MUST NOT USE, COPY,
|
||||
MODIFY, CREATE DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS
|
||||
PRODUCT, NOR ANY PORTION(S) OF IT. YOU SHOULD CONSULT WITH A
|
||||
LAWYER.
|
||||
|
||||
7. IF (IN RELEVANT CONTEXT) ANY PROVISION OF CHAPTER IV OF THIS
|
||||
LICENSE IS UNENFORCEABLE, INVALID, OR PROHIBITED UNDER
|
||||
APPLICABLE LAW IN YOUR JURISDICTION, YOU HAVE NO RIGHTS UNDER
|
||||
THIS LICENSE AND YOU MUST NOT USE, COPY, MODIFY, CREATE
|
||||
DERIVATIVE WORKS OF, NOR (RE)DISTRIBUTE THIS PRODUCT, NOR ANY
|
||||
PORTION(S) THEREOF.
|
||||
|
||||
8. Except as otherwise provided in this License, if any
|
||||
provision of this License, or a portion thereof, is found to be
|
||||
invalid or unenforceable under applicable law, it shall not
|
||||
affect the validity or enforceability of the remainder of this
|
||||
License, and such invalid or unenforceable provision shall be
|
||||
construed to reflect the original intent of the provision and
|
||||
shall be enforced to the maximum extent permitted by applicable
|
||||
law so as to effect the original intent of the provision as
|
||||
closely as possible.
|
||||
|
||||
____________________________________________________________
|
||||
|
||||
|
||||
Third-Party Licenses
|
||||
|
||||
This Product contains components that were created by third
|
||||
parties and that are governed by third-party licenses, which are
|
||||
contained hereinafter (separated by lines consisting of
|
||||
underscores). Each of the third-party licenses applies only to
|
||||
(portions of) the source code file(s) in which the third-party
|
||||
license is contained or in which it is explicitly referenced,
|
||||
and to compiled or otherwise processed forms of such source
|
||||
code. None of the third-party licenses applies to This Product
|
||||
as a whole, even when it uses terms such as "product",
|
||||
"program", or any other equivalent terms/phrases. This Product
|
||||
as a whole is governed by the TrueCrypt License (see above).
|
||||
Some of the third-party components have been modified by the
|
||||
authors of This Product. Unless otherwise stated, such
|
||||
modifications and additions are governed by the TrueCrypt
|
||||
License (see above). Note: Unless otherwise stated, graphics and
|
||||
files that are not part of the source code are governed by the
|
||||
TrueCrypt License.
|
||||
|
||||
____________________________________________________________
|
||||
|
||||
License agreement for Encryption for the Masses.
|
||||
|
||||
Copyright (C) 1998-2000 Paul Le Roux. All Rights Reserved.
|
||||
|
||||
This product can be copied and distributed free of charge,
|
||||
including source code.
|
||||
|
||||
You may modify this product and source code, and distribute such
|
||||
modifications, and you may derive new works based on this
|
||||
product, provided that:
|
||||
|
||||
1. Any product which is simply derived from this product cannot
|
||||
be called E4M, or Encryption for the Masses.
|
||||
|
||||
2. If you use any of the source code in your product, and your
|
||||
product is distributed with source code, you must include this
|
||||
notice with those portions of this source code that you use.
|
||||
|
||||
Or,
|
||||
|
||||
If your product is distributed in binary form only, you must
|
||||
display on any packaging, and marketing materials which
|
||||
reference your product, a notice which states:
|
||||
|
||||
"This product uses components written by Paul Le Roux
|
||||
<pleroux@swprofessionals.com>"
|
||||
|
||||
3. If you use any of the source code originally by Eric Young,
|
||||
you must in addition follow his terms and conditions.
|
||||
|
||||
4. Nothing requires that you accept this License, as you have
|
||||
not signed it. However, nothing else grants you permission to
|
||||
modify or distribute the product or its derivative works.
|
||||
|
||||
These actions are prohibited by law if you do not accept this
|
||||
License.
|
||||
|
||||
5. If any of these license terms is found to be to broad in
|
||||
scope, and declared invalid by any court or legal process, you
|
||||
agree that all other terms shall not be so affected, and shall
|
||||
remain valid and enforceable.
|
||||
|
||||
6. THIS PROGRAM IS DISTRIBUTED FREE OF CHARGE, THEREFORE THERE
|
||||
IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. UNLESS OTHERWISE STATED THE PROGRAM IS PROVIDED
|
||||
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
|
||||
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
||||
ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS
|
||||
WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE
|
||||
COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
7. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY
|
||||
MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE
|
||||
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL,
|
||||
INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
|
||||
INABILITY TO USE THE PROGRAM, INCLUDING BUT NOT LIMITED TO LOSS
|
||||
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH
|
||||
ANY OTHER PROGRAMS, EVEN IF SUCH HOLDER OR OTHER PARTY HAD
|
||||
PREVIOUSLY BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
____________________________________________________________
|
||||
|
||||
Copyright (c) 1998-2008, Brian Gladman, Worcester, UK.
|
||||
All rights reserved.
|
||||
|
||||
LICENSE TERMS
|
||||
|
||||
The free distribution and use of this software is allowed (with
|
||||
or without changes) provided that:
|
||||
|
||||
1. source code distributions include the above copyright
|
||||
notice, this list of conditions and the following
|
||||
disclaimer;
|
||||
|
||||
2. binary distributions include the above copyright notice,
|
||||
this list of conditions and the following disclaimer in
|
||||
their documentation;
|
||||
|
||||
3. the name of the copyright holder is not used to endorse
|
||||
products built using this software without specific written
|
||||
permission.
|
||||
|
||||
DISCLAIMER
|
||||
|
||||
This software is provided 'as is' with no explicit or implied
|
||||
warranties in respect of its properties, including, but not
|
||||
limited to, correctness and/or fitness for purpose.
|
||||
____________________________________________________________
|
||||
|
||||
Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
||||
Jean-loup Gailly Mark Adler
|
||||
jloup@gzip.org madler@alumni.caltech.edu
|
||||
____________________________________________________________
|
||||
Copyright (C) 1999-2016 Dieter Baron and Thomas Klausner
|
||||
|
||||
The authors can be contacted at <libzip@nih.at>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
3. The names of the authors may not be used to endorse or promote
|
||||
products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
|
||||
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
____________________________________________________________
|
||||
Copyright (c) 2013, Alexey Degtyarev. All rights reserved.
|
||||
|
||||
____________________________________________________________
|
||||
Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the GNU Lesser General Public License,
|
||||
version 3.0 (LGPL-3.0).
|
||||
|
||||
The full text of the license may be found at https://opensource.org/licenses/LGPL-3.0
|
||||
____________________________________________________________
|
||||
@@ -0,0 +1,267 @@
|
||||
This archive contains the source code of VeraCrypt.
|
||||
It is based on original TrueCrypt 7.1a with security enhancements and modifications.
|
||||
|
||||
|
||||
Important
|
||||
=========
|
||||
|
||||
You may use the source code contained in this archive only if you accept and
|
||||
agree to the license terms contained in the file 'License.txt', which is
|
||||
included in this archive.
|
||||
|
||||
Note that the license specifies, for example, that a derived work must not be
|
||||
called 'TrueCrypt' or 'VeraCrypt'
|
||||
|
||||
|
||||
|
||||
Contents
|
||||
========
|
||||
|
||||
I. Windows
|
||||
Requirements for Building VeraCrypt for Windows
|
||||
Instructions for Building VeraCrypt for Windows
|
||||
Instructions for Signing and Packaging VeraCrypt for Windows
|
||||
|
||||
II. Linux and Mac OS X
|
||||
Requirements for Building VeraCrypt for Linux and Mac OS X
|
||||
Instructions for Building VeraCrypt for Linux and Mac OS X
|
||||
Mac OS X specifics
|
||||
|
||||
III. FreeBSD and OpenSolaris
|
||||
|
||||
IV. Third-Party Developers (Contributors)
|
||||
|
||||
V. Legal Information
|
||||
|
||||
VI. Further Information
|
||||
|
||||
|
||||
|
||||
I. Windows
|
||||
==========
|
||||
|
||||
Requirements for Building VeraCrypt for Windows:
|
||||
------------------------------------------------
|
||||
|
||||
- Microsoft Visual C++ 2010 SP1 (Professional Edition or compatible)
|
||||
- Microsoft Visual C++ 1.52 (available from MSDN Subscriber Downloads)
|
||||
- Microsoft Windows SDK for Windows 7.1 (configured for Visual C++ 2010)
|
||||
- Microsoft Windows SDK for Windows 8.1 (needed for SHA-256 code signing)
|
||||
- Microsoft Windows Driver Kit 7.1.0 (build 7600.16385.1)
|
||||
- NASM assembler 2.08 or compatible
|
||||
- gzip compressor
|
||||
- upx packer (available at http://upx.sourceforge.net/)
|
||||
|
||||
IMPORTANT:
|
||||
|
||||
The 64-bit editions of Windows Vista and later versions of Windows, and in
|
||||
some cases (e.g. playback of HD DVD content) also the 32-bit editions, do not
|
||||
allow the VeraCrypt driver to run without an appropriate digital signature.
|
||||
Therefore, all .sys files in official VeraCrypt binary packages are digitally
|
||||
signed with the digital certificate of the IDRIX, which was
|
||||
issued by Thawte certification authority. At the end of each official .exe and
|
||||
.sys file, there are embedded digital signatures and all related certificates
|
||||
(i.e. all certificates in the relevant certification chain, such as the
|
||||
certification authority certificates, CA-MS cross-certificate, and the
|
||||
IDRIX certificate).
|
||||
Keep this in mind if you compile VeraCrypt
|
||||
and compare your binaries with the official binaries. If your binaries are
|
||||
unsigned, the sizes of the official binaries will usually be approximately
|
||||
10 KB greater than sizes of your binaries (there may be further differences
|
||||
if you use a different version of the compiler, or if you install a different
|
||||
or no service pack for Visual Studio, or different hotfixes for it, or if you
|
||||
use different versions of the required SDKs).
|
||||
|
||||
|
||||
Instructions for Building VeraCrypt for Windows:
|
||||
------------------------------------------------
|
||||
|
||||
1) Create an environment variable 'MSVC16_ROOT' pointing to the folder 'MSVC15'
|
||||
extracted from the Visual C++ 1.52 self-extracting package.
|
||||
|
||||
Note: The 16-bit installer MSVC15\SETUP.EXE cannot be run on 64-bit Windows,
|
||||
but it is actually not necessary to run it. You only need to extract the
|
||||
folder 'MSVC15', which contains the 32-bit binaries required to build the
|
||||
VeraCrypt Boot Loader.
|
||||
|
||||
2) If you have installed the Windows Driver Development Kit in another
|
||||
directory than '%SYSTEMDRIVE%\WinDDK', create an environment variable
|
||||
'WINDDK_ROOT' pointing to the DDK installation directory.
|
||||
|
||||
3) Open the solution file 'VeraCrypt.sln' in Microsoft Visual Studio 2010.
|
||||
|
||||
4) Select 'All' as the active solution configuration.
|
||||
|
||||
5) Build the solution.
|
||||
|
||||
6) If successful, there should be newly built VeraCrypt binaries in the
|
||||
'Release' folder.
|
||||
|
||||
Instructions for Signing and Packaging VeraCrypt for Windows:
|
||||
-------------------------------------------------------------
|
||||
|
||||
First, create an environment variable 'WSDK81' pointing to the Windows SDK
|
||||
for Windows 8.1 installation directory.
|
||||
The folder "Signing" contains a batch file (sign.bat) that will sign all
|
||||
VeraCrypt components using a code signing certificate present on the
|
||||
certificate store and also build the final installation setup.
|
||||
The batch file suppose that the code signing certificate is issued by Thawt.
|
||||
This is the case for IDRIX's certificate. If yours is issued by another CA,
|
||||
then you should put the Root and Intermediate certificates in the "Signing"
|
||||
folder and then modify sign.bat accordingly.
|
||||
|
||||
VeraCrypt EFI Boot Loader:
|
||||
--------------------------
|
||||
|
||||
VeraCrypt source code contains pre-built EFI binaries under src\Boot\EFI.
|
||||
The source code of VeraCrypt EFI Boot Loader is licensed under LGPL and
|
||||
it is available at https://github.com/veracrypt/VeraCrypt-DCS.
|
||||
For build instructions, please refer to the file src\Boot\EFI\Readme.txt.
|
||||
|
||||
|
||||
II. Linux and Mac OS X
|
||||
======================
|
||||
|
||||
Requirements for Building VeraCrypt for Linux and Mac OS X:
|
||||
-----------------------------------------------------------
|
||||
|
||||
- GNU Make
|
||||
- GNU C++ Compiler 4.0 or compatible
|
||||
- Apple Xcode (Mac OS X only)
|
||||
- NASM assembler 2.08 or compatible (x86/x64 architecture only)
|
||||
- pkg-config
|
||||
- makeself (Linux only)
|
||||
- wxWidgets 3.0 shared library and header files installed or
|
||||
wxWidgets 3.0 library source code (available at http://www.wxwidgets.org)
|
||||
- FUSE library and header files (available at https://github.com/libfuse/libfuse
|
||||
and https://osxfuse.github.io/)
|
||||
|
||||
|
||||
Instructions for Building VeraCrypt for Linux and Mac OS X:
|
||||
-----------------------------------------------------------
|
||||
|
||||
1) Change the current directory to the root of the VeraCrypt source code.
|
||||
|
||||
2) If you have no wxWidgets shared library installed, run the following
|
||||
command to configure the wxWidgets static library for VeraCrypt and to
|
||||
build it:
|
||||
|
||||
$ make WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
|
||||
|
||||
The variable WX_ROOT must point to the location of the source code of the
|
||||
wxWidgets library. Output files will be placed in the './wxrelease/'
|
||||
directory.
|
||||
|
||||
3) To build VeraCrypt, run the following command:
|
||||
|
||||
$ make
|
||||
|
||||
or if you have no wxWidgets shared library installed:
|
||||
|
||||
$ make WXSTATIC=1
|
||||
|
||||
4) If successful, the VeraCrypt executable should be located in the directory
|
||||
'Main'.
|
||||
|
||||
By default, a universal executable supporting both graphical and text user
|
||||
interface (through the switch --text) is built.
|
||||
On Linux, a console-only executable, which requires no GUI library, can be
|
||||
built using the 'NOGUI' parameter:
|
||||
|
||||
$ make NOGUI=1 WXSTATIC=1 WX_ROOT=/usr/src/wxWidgets wxbuild
|
||||
$ make NOGUI=1 WXSTATIC=1
|
||||
|
||||
On MacOSX, building a console-only executable is not supported.
|
||||
|
||||
Mac OS X specifics:
|
||||
-----------------------------------------------------------
|
||||
|
||||
Under MacOSX, the SDK for OSX 10.7 is used by default. To use another version
|
||||
of the SDK (i.e. 10.6), you can export the environment variable VC_OSX_TARGET:
|
||||
|
||||
$ export VC_OSX_TARGET=10.6
|
||||
|
||||
|
||||
Before building under MacOSX, pkg-config must be installed if not yet available.
|
||||
Get it from http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz and
|
||||
compile using the following commands :
|
||||
|
||||
$ ./configure --with-internal-glib
|
||||
$ make
|
||||
$ sudo make install
|
||||
|
||||
After making sure pkg-config is available, download and install OSXFuse from
|
||||
https://osxfuse.github.io/ (MacFUSE compatibility layer must selected)
|
||||
|
||||
The script build_veracrypt_macosx.sh available under "src/Build" performs the
|
||||
full build of VeraCrypt including the creation of the installer pkg. It expects
|
||||
to find the wxWidgets 3.0.2 sources at the same level as where you put
|
||||
VeraCrypt sources (i.e. if "src" path is "/Users/joe/Projects/VeraCrypt/src"
|
||||
then wxWidgets should be at "/Users/joe/Projects/wxWidgets-3.0.2")
|
||||
|
||||
The build process uses Code Signing certificates whose ID is specified in
|
||||
src/Main/Main.make (lines 167 & 169). You'll have to modify these lines to put
|
||||
the ID of your Code Signing certificates or comment them if you don't have one.
|
||||
|
||||
Because of incompatibility issues with OSXFUSE, the SDK 10.9 generates a
|
||||
VeraCrypt binary that has issues communicating with the OSXFUSE kernel extension.
|
||||
Thus, we recommend to use the SDK 10.8 or earlier for building VeraCrypt.
|
||||
|
||||
|
||||
|
||||
III. FreeBSD and OpenSolaris
|
||||
============================
|
||||
|
||||
FreeBSD and OpenSolaris are not yet supported.
|
||||
|
||||
|
||||
|
||||
IV. Third-Party Developers (Contributors)
|
||||
=========================================
|
||||
|
||||
If you intend to implement a feature, please contact us first to make sure:
|
||||
|
||||
1) That the feature has not been implemented (we may have already implemented
|
||||
it, but haven't released the code yet).
|
||||
2) That the feature is acceptable.
|
||||
3) Whether we need help of third-party developers with implementing the feature.
|
||||
|
||||
Information on how to contact us can be found at:
|
||||
https://veracrypt.codeplex.com/
|
||||
|
||||
|
||||
|
||||
V. Legal Information
|
||||
====================
|
||||
|
||||
Copyright Information
|
||||
---------------------
|
||||
|
||||
This software as a whole:
|
||||
Copyright (c) 2013-2016 IDRIX. All rights reserved.
|
||||
|
||||
Portions of this software:
|
||||
Copyright (c) 2013-2016 IDRIX. All rights reserved.
|
||||
Copyright (c) 2003-2012 TrueCrypt Developers Association. All rights reserved.
|
||||
Copyright (c) 1998-2000 Paul Le Roux. All rights reserved.
|
||||
Copyright (c) 1998-2008 Brian Gladman, Worcester, UK. All rights reserved.
|
||||
Copyright (c) 1995-2013 Jean-loup Gailly and Mark Adler.
|
||||
Copyright (c) 2016 Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
|
||||
Copyright (c) Dieter Baron and Thomas Klausner.
|
||||
Copyright (c) 2013, Alexey Degtyarev. All rights reserved.
|
||||
|
||||
For more information, please see the legal notices attached to parts of the
|
||||
source code.
|
||||
|
||||
Trademark Information
|
||||
---------------------
|
||||
|
||||
Any trademarks contained in the source code, binaries, and/or in the
|
||||
documentation, are the sole property of their respective owners.
|
||||
|
||||
|
||||
|
||||
VI. Further Information
|
||||
=======================
|
||||
|
||||
http://www.veracrypt.fr
|
||||
+321
@@ -0,0 +1,321 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
call :freedrive mydriveletter && goto :cont
|
||||
echo ERROR: No free drive letter found.
|
||||
goto :exit
|
||||
:cont
|
||||
|
||||
echo Using drive letter %mydriveletter%: for our tests
|
||||
echo.
|
||||
|
||||
IF NOT EXIST test.sha512.hc GOTO :whirlpool
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-512 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-512 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-512 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha512.hc /hash sha512 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-512 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
:whirlpool
|
||||
|
||||
IF NOT EXIST test.whirlpool.hc GOTO :sha256
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount Whirlpool container (Normal).
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Whirlpool (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount Whirlpool container (Hidden).
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.whirlpool.hc /hash whirlpool /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Whirlpool (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
:sha256
|
||||
|
||||
IF NOT EXIST test.sha256.hc GOTO :ripemd160
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-256 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-256 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount SHA-256 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.sha256.hc /hash sha256 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo SHA-256 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
:ripemd160
|
||||
|
||||
IF NOT EXIST test.ripemd160.hc GOTO :autodetect
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount RIPEMD-160 container (Normal)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password test /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo RIPEMD-160 (Normal) = %hh%:%mm%:%ss%,%cc%
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Mount RIPEMD-160 container (Hidden)
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume test.ripemd160.hc /hash ripemd160 /l %mydriveletter% /password testhidden /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo RIPEMD-160 (Hidden) = %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /dismount %mydriveletter% /silent /q
|
||||
|
||||
:autodetect
|
||||
|
||||
call :availablevolume testvolume && goto :contautodetect
|
||||
goto :exit
|
||||
:contautodetect
|
||||
|
||||
rem Get start time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Try to mount with a wrong password and PRF autodetection
|
||||
"c:\Program Files\VeraCrypt\veracrypt.exe" /volume %testvolume% /l %mydriveletter% /password wrongpassword /q /silent /m ro
|
||||
|
||||
rem Get end time:
|
||||
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
|
||||
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
|
||||
)
|
||||
|
||||
rem Get elapsed time:
|
||||
set /A elapsed=end-start
|
||||
|
||||
rem Show elapsed time:
|
||||
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
|
||||
if %hh% lss 10 set hh=0%hh%
|
||||
if %mm% lss 10 set mm=0%mm%
|
||||
if %ss% lss 10 set ss=0%ss%
|
||||
if %cc% lss 10 set cc=0%cc%
|
||||
echo Wrong Password (PRF Auto-detection)= %hh%:%mm%:%ss%,%cc%
|
||||
echo.
|
||||
|
||||
|
||||
goto :exit
|
||||
|
||||
rem Finds a free drive letter.
|
||||
rem
|
||||
rem Parameters:
|
||||
rem %1 = Output variable name.
|
||||
rem
|
||||
rem Example:
|
||||
rem call :freedrive mydriveletter && goto :cont
|
||||
rem echo ERROR: No free drive letter found.
|
||||
rem goto :EOF
|
||||
rem :cont
|
||||
rem echo Found drive letter: %mydriveletter%
|
||||
:freedrive
|
||||
setlocal EnableDelayedExpansion
|
||||
set exitcode=0
|
||||
set "output_var=%~1"
|
||||
for %%i in (C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z) do (
|
||||
set "drive=%%i:"
|
||||
rem If 'subst' fails, the drive letter is already in use.
|
||||
rem This way we can even detect optical drives that have a drive
|
||||
rem letter but no media in them, a case that goes undetected when
|
||||
rem using 'if exist'.
|
||||
subst !drive! %SystemDrive%\ >nul
|
||||
if !errorlevel! == 0 (
|
||||
subst !drive! /d >nul
|
||||
set "drive=%%i"
|
||||
goto :freedrive0
|
||||
)
|
||||
)
|
||||
set exitcode=1
|
||||
set drive=
|
||||
:freedrive0
|
||||
endlocal & set "%output_var%=%drive%" & exit /b %exitcode%
|
||||
|
||||
:availablevolume
|
||||
setlocal EnableDelayedExpansion
|
||||
set exitcode=0
|
||||
set "output_var=%~1"
|
||||
for %%i in (test.sha512.hc,test.sha256.hc,test.whirlpool.hc,test.ripemd160.hc) do (
|
||||
if exist %%i (
|
||||
set "volume=%%i"
|
||||
goto :availablevolume0
|
||||
)
|
||||
)
|
||||
set exitcode=1
|
||||
set volume=
|
||||
:availablevolume0
|
||||
endlocal & set "%output_var%=%volume%" & exit /b %exitcode%
|
||||
|
||||
:exit
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1344
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1472
-1344
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1470
-1342
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
+1469
-1341
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,35 @@
|
||||
The source code for VeraCrypt EFI bootloader files is available at: https://github.com/veracrypt/VeraCrypt-DCS
|
||||
Use tag "VeraCrypt_1.18" to extract the sources that were used when building VeraCrypt 1.18.
|
||||
|
||||
VeraCrypt-DCS uses EDK II as its UEFI development environement.
|
||||
|
||||
VeraCrypt-DCS is licensed under LGPL: https://github.com/veracrypt/VeraCrypt-DCS/blob/master/LICENSE
|
||||
|
||||
Here the steps to build VeraCrypt-DCS (Visual Studio 2010 SP1 should be installed)
|
||||
* Clone EDK: git clone https://github.com/tianocore/tianocore.github.io.git edk2
|
||||
* Switch to UDK2015 branche: git checkout UDK2015
|
||||
* Clone VeraCrypt-DCS as DcsPkg inside edk2 folder: git clone https://github.com/veracrypt/VeraCrypt-DCS.git DcsPkg
|
||||
* Switch to VeraCrypt_1.18 branche: git checkout VeraCrypt_1.18
|
||||
* Setup EDK by typing edksetup.bat at the root of folder edk2
|
||||
* change directoty to DcsPkg and then type setenv.bat.
|
||||
* change directory to DcsPkg\Library\VeraCryptLib and then type mklinks_src.bat: you will be asked to provide the path to VeraCrypt src folder.
|
||||
* change directory to DcsPkg and then type dcs_bld.bat X64Rel
|
||||
* After the build is finished, EFI bootloader files will be present at edk2\Build\DcsPkg\RELEASE_VS2010x86\X64
|
||||
|
||||
Secure Boot:
|
||||
In order to allow VeraCrypt EFI bootloader to run when EFI Secure Boot is enabled, VeraCrypt EFI bootloader files are signed
|
||||
using a custom key whose public part can be loader into Secure Boot to allow the verification of VeraCrypt EFI files.
|
||||
|
||||
below are instruction to update Secure Boot configuration:
|
||||
1. Enter BIOS configuration
|
||||
2. Switch Secure boot to setup mode (or custom mode). It deletes PK (platform certificate) and allows to load DCS platform key.
|
||||
3. Boot Windows
|
||||
4. execute from admin command prompt
|
||||
powershell -File sb_set_siglists.ps1
|
||||
It sets in PK (platform key) - DCS_platform
|
||||
It sets in KEK (key exchange key) - DCS_key_exchange
|
||||
It sets in db - DCS_sign MicWinProPCA2011_2011-10-19 MicCorUEFCA2011_2011-06-27
|
||||
|
||||
All DCS modules are protected by DCS_sign.
|
||||
All Windows modules are protected by MicWinProPCA2011_2011-10-19
|
||||
All SHIM(linux) modules are protected by MicCorUEFCA2011_2011-06-27
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
Apart from DCS certificates, there are two public DB entries - one for Windows and one for the UEFI Certificate Authority (CA).
|
||||
Windows DB: http://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt
|
||||
UEFI DB: http://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt
|
||||
@@ -0,0 +1,22 @@
|
||||
Set-ExecutionPolicy Bypass -Force
|
||||
Import-Module secureboot
|
||||
|
||||
Set-SecureBootUEFI -Name PK -Time 2015-09-11 -Content $null
|
||||
Set-SecureBootUEFI -Name KEK -Time 2015-09-11 -Content $null
|
||||
Set-SecureBootUEFI -Name db -Time 2015-09-11 -Content $null
|
||||
Set-SecureBootUEFI -Name dbx -Time 2015-09-11 -Content $null
|
||||
|
||||
Write-Host "Setting self-signed PK..."
|
||||
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_platform_SigList.bin -SignedFilePath siglists\DCS_platform_SigList_Serialization.bin.p7 -Name PK
|
||||
|
||||
Write-Host "Setting PK-signed KEK..."
|
||||
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_key_exchange_SigList.bin -SignedFilePath siglists\DCS_key_exchange_SigList_Serialization.bin.p7 -Name KEK
|
||||
|
||||
Write-Host "Setting KEK-signed DCS cert in db..."
|
||||
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\DCS_sign_SigList.bin -SignedFilePath siglists\DCS_sign_SigList_Serialization.bin.p7 -Name db
|
||||
|
||||
Write-Host "Setting KEK-signed MS cert in db..."
|
||||
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicWinProPCA2011_2011-10-19_SigList.bin -SignedFilePath siglists\MicWinProPCA2011_2011-10-19_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
|
||||
|
||||
Write-Host "Setting KEK-signed MS UEFI cert in db..."
|
||||
Set-SecureBootUEFI -Time 2016-08-08T00:00:00Z -ContentFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList.bin -SignedFilePath siglists\MicCorUEFCA2011_2011-06-27_SigList_Serialization.bin.p7 -Name db -AppendWrite:$true
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+32
-28
@@ -1,28 +1,32 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_Bios
|
||||
#define TC_HEADER_Boot_Bios
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define TC_LB_SIZE_BIT_SHIFT_DIVISOR 9
|
||||
|
||||
#define TC_FIRST_BIOS_DRIVE 0x80
|
||||
#define TC_LAST_BIOS_DRIVE 0x8f
|
||||
#define TC_INVALID_BIOS_DRIVE (TC_FIRST_BIOS_DRIVE - 1)
|
||||
|
||||
enum
|
||||
{
|
||||
BiosResultSuccess = 0x00,
|
||||
BiosResultInvalidFunction = 0x01
|
||||
};
|
||||
|
||||
typedef byte BiosResult;
|
||||
|
||||
#endif // TC_HEADER_Boot_Bios
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_Bios
|
||||
#define TC_HEADER_Boot_Bios
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define TC_LB_SIZE_BIT_SHIFT_DIVISOR 9
|
||||
|
||||
#define TC_FIRST_BIOS_DRIVE 0x80
|
||||
#define TC_LAST_BIOS_DRIVE 0x8f
|
||||
#define TC_INVALID_BIOS_DRIVE (TC_FIRST_BIOS_DRIVE - 1)
|
||||
|
||||
enum
|
||||
{
|
||||
BiosResultSuccess = 0x00,
|
||||
BiosResultInvalidFunction = 0x01
|
||||
};
|
||||
|
||||
typedef byte BiosResult;
|
||||
|
||||
#endif // TC_HEADER_Boot_Bios
|
||||
|
||||
+250
-246
@@ -1,246 +1,250 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="Boot"
|
||||
ProjectGUID="{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}"
|
||||
RootNamespace="Boot"
|
||||
Keyword="MakeFileProj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_SHA2 >NUL:
md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_AES_SHA2 >NUL:
md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Serpent_SHA2 >NUL:
md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

del /q /s Release_Twofish_SHA2 >NUL:
md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

del /q /s Rescue >NUL:
md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

del /q /s Rescue_SHA2 >NUL:
md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_AES >NUL:
md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

del /q /s Rescue_AES_SHA2 >NUL:
md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Serpent >NUL:
md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

del /q /s Rescue_Serpent_SHA2 >NUL:
md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Twofish >NUL:
md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

del /q /s Rescue_Twofish_SHA2 >NUL:
md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Rescue Rescue_AES Rescue_Serpent Rescue_Twofish >NUL:
del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 >NUL:
"
|
||||
Output="Release\BootLoader.com"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include""
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
CompileAsManaged=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release Loader|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish >NUL:"
|
||||
Output="Release\BootLoader.com"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include""
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
CompileAsManaged=""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BootConfig.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConsoleIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootCrt.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDebug.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDiskIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootEncryptedIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMain.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMemory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootSector.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Decompressor.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\IntFilter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Platform.cpp"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Common\Crc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Crypto.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Endian.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Pkcs5.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Volumes.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Xts.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Crypto"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Aes_hw_cpu.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\AesSmall.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\AesSmall_x86.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Rmd160.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Serpent.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Sha2Small.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Twofish.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Bios.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootCommon.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConfig.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConsoleIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDebug.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDefs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDiskIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootEncryptedIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMain.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMemory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootStrings.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\IntFilter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Platform.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Build Files"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Makefile"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="Boot"
|
||||
ProjectGUID="{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}"
|
||||
RootNamespace="Boot"
|
||||
Keyword="MakeFileProj"
|
||||
TargetFrameworkVersion="131072"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

md Release_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA

md Release_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2

md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2

md Rescue_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1

md Rescue_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_SHA2 >NUL:
md Release_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_AES_SHA2 >NUL:
md Release_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Serpent_SHA2 >NUL:
md Release_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH

del /q /s Release_Twofish_SHA2 >NUL:
md Release_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2

del /q /s Release_Camellia >NUL:
md Release_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA

del /q /s Release_Camellia_SHA2 >NUL:
md Release_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2

del /q /s Rescue >NUL:
md Rescue 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1

del /q /s Rescue_SHA2 >NUL:
md Rescue_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_AES >NUL:
md Rescue_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1

del /q /s Rescue_AES_SHA2 >NUL:
md Rescue_AES_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Serpent >NUL:
md Rescue_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1

del /q /s Rescue_Serpent_SHA2 >NUL:
md Rescue_Serpent_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Twofish >NUL:
md Rescue_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1

del /q /s Rescue_Twofish_SHA2 >NUL:
md Rescue_Twofish_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2

del /q /s Rescue_Camellia >NUL:
md Rescue_Camellia 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1

del /q /s Rescue_Camellia_SHA2 >NUL:
md Rescue_Camellia_SHA2 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia >NUL:
del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Release_Camellia_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 Rescue_Camellia_SHA2 >NUL:
"
|
||||
Output="Release\BootLoader.com"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include""
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
CompileAsManaged=""
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release Loader|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCNMakeTool"
|
||||
BuildCommandLine="md Release 2>NUL:
nmake.exe /nologo RELEASE=1

md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
|
||||
ReBuildCommandLine="del /q /s Release >NUL:
md Release 2>NUL:
nmake.exe /nologo RELEASE=1

del /q /s Release_AES >NUL:
md Release_AES 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES

del /q /s Release_Serpent >NUL:
md Release_Serpent 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT

del /q /s Release_Twofish >NUL:
md Release_Twofish 2>NUL:
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH"
|
||||
CleanCommandLine="del /q /s Release Release_AES Release_Serpent Release_Twofish >NUL:"
|
||||
Output="Release\BootLoader.com"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG"
|
||||
IncludeSearchPath=""$(SolutionDir)";"$(SolutionDir)\Common";"$(SolutionDir)\Crypto";"$(MSVC16_ROOT)\Include""
|
||||
ForcedIncludes=""
|
||||
AssemblySearchPath=""
|
||||
ForcedUsingAssemblies=""
|
||||
CompileAsManaged=""
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\BootConfig.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConsoleIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootCrt.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDebug.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDiskIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootEncryptedIo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMain.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMemory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootSector.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Decompressor.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\IntFilter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Platform.cpp"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Common"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Common\Crc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Crypto.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Endian.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Pkcs5.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Volumes.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Common\Xts.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Crypto"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Aes_hw_cpu.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\AesSmall.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\AesSmall_x86.asm"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\CamelliaSmall.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Rmd160.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Serpent.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Sha2Small.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Crypto\Twofish.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Bios.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootCommon.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConfig.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootConsoleIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDebug.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDefs.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootDiskIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootEncryptedIo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMain.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootMemory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\BootStrings.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\IntFilter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Platform.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Build Files"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\Makefile"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Release Loader|Win32">
|
||||
<Configuration>Release Loader</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8B7F059F-E4C7-4E11-88F5-EE8B8433072E}</ProjectGuid>
|
||||
<RootNamespace>Boot</RootNamespace>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
|
||||
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">md Release 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1
|
||||
|
||||
md Release_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
|
||||
|
||||
md Release_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
|
||||
|
||||
md Release_AES_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
|
||||
|
||||
md Release_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
|
||||
|
||||
md Release_Serpent_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
|
||||
|
||||
md Release_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
|
||||
|
||||
md Release_Twofish_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
|
||||
|
||||
md Release_Camellia 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
|
||||
|
||||
md Release_Camellia_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
|
||||
|
||||
md Rescue 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
|
||||
|
||||
md Rescue_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
md Rescue_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
|
||||
|
||||
md Rescue_AES_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
md Rescue_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
|
||||
|
||||
md Rescue_Serpent_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
md Rescue_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
|
||||
|
||||
md Rescue_Twofish_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
md Rescue_Camellia 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
|
||||
|
||||
md Rescue_Camellia_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release >NUL:
|
||||
md Release 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1
|
||||
|
||||
del /q /s Release_SHA2 >NUL:
|
||||
md Release_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Release_AES >NUL:
|
||||
md Release_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
|
||||
|
||||
del /q /s Release_AES_SHA2 >NUL:
|
||||
md Release_AES_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Release_Serpent >NUL:
|
||||
md Release_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
|
||||
|
||||
del /q /s Release_Serpent_SHA2 >NUL:
|
||||
md Release_Serpent_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Release_Twofish >NUL:
|
||||
md Release_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH
|
||||
|
||||
del /q /s Release_Twofish_SHA2 >NUL:
|
||||
md Release_Twofish_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Release_Camellia >NUL:
|
||||
md Release_Camellia 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA
|
||||
|
||||
del /q /s Release_Camellia_SHA2 >NUL:
|
||||
md Release_Camellia_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Rescue >NUL:
|
||||
md Rescue 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1
|
||||
|
||||
del /q /s Rescue_SHA2 >NUL:
|
||||
md Rescue_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Rescue_AES >NUL:
|
||||
md Rescue_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1
|
||||
|
||||
del /q /s Rescue_AES_SHA2 >NUL:
|
||||
md Rescue_AES_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Rescue_Serpent >NUL:
|
||||
md Rescue_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1
|
||||
|
||||
del /q /s Rescue_Serpent_SHA2 >NUL:
|
||||
md Rescue_Serpent_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Rescue_Twofish >NUL:
|
||||
md Rescue_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1
|
||||
|
||||
del /q /s Rescue_Twofish_SHA2 >NUL:
|
||||
md Rescue_Twofish_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH RESCUE_DISK=1 SINGLE_PRF=SHA2
|
||||
|
||||
del /q /s Rescue_Camellia >NUL:
|
||||
md Rescue_Camellia 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1
|
||||
|
||||
del /q /s Rescue_Camellia_SHA2 >NUL:
|
||||
md Rescue_Camellia_SHA2 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=CAMELLIA RESCUE_DISK=1 SINGLE_PRF=SHA2</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish Release_Camellia Rescue Rescue_AES Rescue_Serpent Rescue_Twofish Rescue_Camellia >NUL:
|
||||
del /q /s Release_SHA2 Release_AES_SHA2 Release_Serpent_SHA2 Release_Twofish_SHA2 Release_Camellia_SHA2 Rescue_SHA2 Rescue_AES_SHA2 Rescue_Serpent_SHA2 Rescue_Twofish_SHA2 Rescue_Camellia_SHA2 >NUL:
|
||||
</NMakeCleanCommandLine>
|
||||
<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\BootLoader.com</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
|
||||
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
|
||||
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(Configuration)\</IntDir>
|
||||
<NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">md Release 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1
|
||||
|
||||
md Release_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
|
||||
|
||||
md Release_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
|
||||
|
||||
md Release_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeBuildCommandLine>
|
||||
<NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release >NUL:
|
||||
md Release 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1
|
||||
|
||||
del /q /s Release_AES >NUL:
|
||||
md Release_AES 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=AES
|
||||
|
||||
del /q /s Release_Serpent >NUL:
|
||||
md Release_Serpent 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=SERPENT
|
||||
|
||||
del /q /s Release_Twofish >NUL:
|
||||
md Release_Twofish 2>NUL:
|
||||
nmake.exe /nologo RELEASE=1 SINGLE_CIPHER=TWOFISH</NMakeReBuildCommandLine>
|
||||
<NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">del /q /s Release Release_AES Release_Serpent Release_Twofish >NUL:</NMakeCleanCommandLine>
|
||||
<NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">Release\BootLoader.com</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(SolutionDir);$(SolutionDir)\Common;$(SolutionDir)\Crypto;$(MSVC16_ROOT)\Include;$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
|
||||
<NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
|
||||
<NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
|
||||
<NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release Loader|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BootConfig.cpp" />
|
||||
<ClCompile Include="BootConsoleIo.cpp" />
|
||||
<ClCompile Include="BootDebug.cpp" />
|
||||
<ClCompile Include="BootDiskIo.cpp" />
|
||||
<ClCompile Include="BootEncryptedIo.cpp" />
|
||||
<ClCompile Include="BootMain.cpp" />
|
||||
<ClCompile Include="BootMemory.cpp" />
|
||||
<ClCompile Include="Decompressor.c" />
|
||||
<ClCompile Include="IntFilter.cpp" />
|
||||
<ClCompile Include="Platform.cpp" />
|
||||
<ClCompile Include="..\..\Common\Crc.c" />
|
||||
<ClCompile Include="..\..\Common\Crypto.c" />
|
||||
<ClCompile Include="..\..\Common\Endian.c" />
|
||||
<ClCompile Include="..\..\Common\Pkcs5.c" />
|
||||
<ClCompile Include="..\..\Common\Volumes.c" />
|
||||
<ClCompile Include="..\..\Common\Xts.c" />
|
||||
<ClCompile Include="..\..\Crypto\AesSmall.c" />
|
||||
<ClCompile Include="..\..\Crypto\CamelliaSmall.c" />
|
||||
<ClCompile Include="..\..\Crypto\Rmd160.c" />
|
||||
<ClCompile Include="..\..\Crypto\Serpent.c" />
|
||||
<ClCompile Include="..\..\Crypto\Sha2Small.c" />
|
||||
<ClCompile Include="..\..\Crypto\Twofish.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BootCrt.asm" />
|
||||
<None Include="BootSector.asm" />
|
||||
<None Include="..\..\Crypto\Aes_hw_cpu.asm" />
|
||||
<None Include="..\..\Crypto\AesSmall_x86.asm" />
|
||||
<None Include="Makefile" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Bios.h" />
|
||||
<ClInclude Include="BootCommon.h" />
|
||||
<ClInclude Include="BootConfig.h" />
|
||||
<ClInclude Include="BootConsoleIo.h" />
|
||||
<ClInclude Include="BootDebug.h" />
|
||||
<ClInclude Include="BootDefs.h" />
|
||||
<ClInclude Include="BootDiskIo.h" />
|
||||
<ClInclude Include="BootEncryptedIo.h" />
|
||||
<ClInclude Include="BootMain.h" />
|
||||
<ClInclude Include="BootMemory.h" />
|
||||
<ClInclude Include="BootStrings.h" />
|
||||
<ClInclude Include="IntFilter.h" />
|
||||
<ClInclude Include="Platform.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Common">
|
||||
<UniqueIdentifier>{851ac58e-36e0-4dfa-a208-6da2330f5959}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Crypto">
|
||||
<UniqueIdentifier>{76da5bdb-fe11-430a-8667-2fe7f9ac3667}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Build Files">
|
||||
<UniqueIdentifier>{732efef1-4474-4845-aa74-17b852cc0f2e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BootConfig.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootConsoleIo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootDebug.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootDiskIo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootEncryptedIo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootMain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="BootMemory.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Decompressor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IntFilter.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Platform.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Crc.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Crypto.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Endian.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Pkcs5.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Volumes.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Common\Xts.c">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\AesSmall.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\CamelliaSmall.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\Rmd160.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\Serpent.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\Sha2Small.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\Crypto\Twofish.c">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="BootCrt.asm">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="BootSector.asm">
|
||||
<Filter>Source Files</Filter>
|
||||
</None>
|
||||
<None Include="..\..\Crypto\Aes_hw_cpu.asm">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</None>
|
||||
<None Include="..\..\Crypto\AesSmall_x86.asm">
|
||||
<Filter>Source Files\Crypto</Filter>
|
||||
</None>
|
||||
<None Include="Makefile">
|
||||
<Filter>Build Files</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Bios.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootCommon.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootConfig.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootConsoleIo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootDebug.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootDefs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootDiskIo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootEncryptedIo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootMain.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootMemory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="BootStrings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IntFilter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Platform.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
</Project>
|
||||
+214
-78
@@ -1,78 +1,214 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootCommon
|
||||
#define TC_HEADER_Boot_BootCommon
|
||||
|
||||
#include "Common/Password.h"
|
||||
#include "BootDefs.h"
|
||||
|
||||
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
|
||||
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x010e
|
||||
|
||||
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1)
|
||||
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_CD_BOOTSECTOR_OFFSET 0xd000
|
||||
#define TC_CD_BOOT_LOADER_SECTOR 26
|
||||
|
||||
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR + TC_BOOT_LOADER_AREA_SECTOR_COUNT)
|
||||
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_MBR_SECTOR 0
|
||||
#define TC_MAX_MBR_BOOT_CODE_SIZE 440
|
||||
|
||||
#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (512UL * 1024UL * 1024UL)
|
||||
|
||||
|
||||
#pragma pack (1)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte Flags;
|
||||
} BootSectorConfiguration;
|
||||
|
||||
|
||||
// Modifying this value can introduce incompatibility with previous versions
|
||||
#define TC_BOOT_LOADER_ARGS_OFFSET 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Modifying this structure can introduce incompatibility with previous versions
|
||||
char Signature[8];
|
||||
uint16 BootLoaderVersion;
|
||||
uint16 CryptoInfoOffset;
|
||||
uint16 CryptoInfoLength;
|
||||
uint32 HeaderSaltCrc32;
|
||||
Password BootPassword;
|
||||
uint64 HiddenSystemPartitionStart;
|
||||
uint64 DecoySystemPartitionStart;
|
||||
uint32 Flags;
|
||||
uint32 BootDriveSignature;
|
||||
|
||||
uint32 BootArgumentsCrc32;
|
||||
|
||||
} BootArguments;
|
||||
|
||||
// Modifying these values can introduce incompatibility with previous versions
|
||||
#define TC_BOOT_ARGS_FLAG_EXTRA_BOOT_PARTITION 0x1
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
// Boot arguments signature should not be defined as a static string
|
||||
// Modifying these values can introduce incompatibility with previous versions
|
||||
#define TC_SET_BOOT_ARGUMENTS_SIGNATURE(SG) do { SG[0] = 'T'; SG[1] = 'R'; SG[2] = 'U'; SG[3] = 'E'; SG[4] = 0x11; SG[5] = 0x23; SG[6] = 0x45; SG[7] = 0x66; } while (FALSE)
|
||||
#define TC_IS_BOOT_ARGUMENTS_SIGNATURE(SG) (SG[0] == 'T' && SG[1] == 'R' && SG[2] == 'U' && SG[3] == 'E' && SG[4] == 0x11 && SG[5] == 0x23 && SG[6] == 0x45 && SG[7] == 0x66)
|
||||
|
||||
|
||||
#endif // TC_HEADER_Boot_BootCommon
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootCommon
|
||||
#define TC_HEADER_Boot_BootCommon
|
||||
|
||||
#include "Common/Password.h"
|
||||
#include "BootDefs.h"
|
||||
|
||||
// The user will be advised to upgrade the rescue disk if upgrading from the following or any previous version
|
||||
#define TC_RESCUE_DISK_UPGRADE_NOTICE_MAX_VERSION 0x0118
|
||||
|
||||
#define TC_BOOT_LOADER_AREA_SIZE (TC_BOOT_LOADER_AREA_SECTOR_COUNT * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_BOOT_VOLUME_HEADER_SECTOR (TC_BOOT_LOADER_AREA_SECTOR_COUNT - 1)
|
||||
#define TC_BOOT_VOLUME_HEADER_SECTOR_OFFSET (TC_BOOT_VOLUME_HEADER_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_CD_BOOTSECTOR_OFFSET 0xd000
|
||||
#define TC_CD_BOOT_LOADER_SECTOR 26
|
||||
|
||||
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR TC_BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
#define TC_ORIG_BOOT_LOADER_BACKUP_SECTOR_OFFSET (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR (TC_ORIG_BOOT_LOADER_BACKUP_SECTOR + TC_BOOT_LOADER_AREA_SECTOR_COUNT)
|
||||
#define TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR_OFFSET (TC_BOOT_LOADER_BACKUP_RESCUE_DISK_SECTOR * TC_SECTOR_SIZE_BIOS)
|
||||
|
||||
#define TC_MBR_SECTOR 0
|
||||
#define TC_MAX_MBR_BOOT_CODE_SIZE 440
|
||||
|
||||
#define TC_MAX_EXTRA_BOOT_PARTITION_SIZE (512UL * 1024UL * 1024UL)
|
||||
|
||||
|
||||
#pragma pack (1)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte Flags;
|
||||
} BootSectorConfiguration;
|
||||
|
||||
|
||||
// Modifying this value can introduce incompatibility with previous versions
|
||||
#define TC_BOOT_LOADER_ARGS_OFFSET 0x10
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Modifying this structure can introduce incompatibility with previous versions
|
||||
char Signature[8];
|
||||
uint16 BootLoaderVersion;
|
||||
uint16 CryptoInfoOffset;
|
||||
uint16 CryptoInfoLength;
|
||||
uint32 HeaderSaltCrc32;
|
||||
Password BootPassword;
|
||||
uint64 HiddenSystemPartitionStart;
|
||||
uint64 DecoySystemPartitionStart;
|
||||
uint32 Flags;
|
||||
uint32 BootDriveSignature;
|
||||
|
||||
uint32 BootArgumentsCrc32;
|
||||
|
||||
} BootArguments;
|
||||
|
||||
// Modifying these values can introduce incompatibility with previous versions
|
||||
#define TC_BOOT_ARGS_FLAG_EXTRA_BOOT_PARTITION 0x1
|
||||
|
||||
#pragma pack ()
|
||||
|
||||
// Boot arguments signature should not be defined as a static string
|
||||
// Modifying these values can introduce incompatibility with previous versions
|
||||
#define TC_SET_BOOT_ARGUMENTS_SIGNATURE(SG) do { SG[0] = 'T'; SG[1] = 'R'; SG[2] = 'U'; SG[3] = 'E'; SG[4] = 0x11; SG[5] = 0x23; SG[6] = 0x45; SG[7] = 0x66; } while (FALSE)
|
||||
#define TC_IS_BOOT_ARGUMENTS_SIGNATURE(SG) (SG[0] == 'T' && SG[1] == 'R' && SG[2] == 'U' && SG[3] == 'E' && SG[4] == 0x11 && SG[5] == 0x23 && SG[6] == 0x45 && SG[7] == 0x66)
|
||||
|
||||
#if defined(_MSC_VER) && !defined(TC_WINDOWS_BOOT)
|
||||
|
||||
#define DCS_DISK_ENTRY_LIST_HEADER_SIGN SIGNATURE_64 ('D','C','S','D','E','L','S','T')
|
||||
|
||||
#define DE_IDX_CRYPTOHEADER 0
|
||||
#define DE_IDX_LIST 1
|
||||
#define DE_IDX_DISKID 2
|
||||
#define DE_IDX_MAINGPTHDR 3
|
||||
#define DE_IDX_MAINGPTENTRYS 4
|
||||
#define DE_IDX_ALTGPTHDR 5
|
||||
#define DE_IDX_ALTGPTENTRYS 6
|
||||
#define DE_IDX_EXEC 7
|
||||
#define DE_IDX_PWDCACHE 8
|
||||
#define DE_IDX_RND 9
|
||||
#define DE_IDX_TOTAL 10
|
||||
static_assert(DE_IDX_TOTAL <= 15, "DE_IDX_TOTAL too big");
|
||||
|
||||
enum DcsDiskEntryTypes {
|
||||
DE_Unused = 0,
|
||||
DE_Sectors,
|
||||
DE_List,
|
||||
DE_DISKID,
|
||||
DE_ExecParams,
|
||||
DE_PwdCache,
|
||||
DE_Rnd
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct _SECREGION_BOOT_PARAMS {
|
||||
uint64 Ptr;
|
||||
uint32 Size;
|
||||
uint32 Crc;
|
||||
} SECREGION_BOOT_PARAMS;
|
||||
|
||||
typedef struct {
|
||||
uint32 Data1;
|
||||
uint16 Data2;
|
||||
uint16 Data3;
|
||||
byte Data4[8];
|
||||
} DCS_GUID;
|
||||
|
||||
// DE types
|
||||
typedef struct _DCS_DISK_ENTRY_SECTORS {
|
||||
uint32 Type;
|
||||
uint32 Offset; // Offset in memory
|
||||
uint64 Reserved;
|
||||
uint64 Start; // Start on disk (byte)
|
||||
uint64 Length; // length on disk (byte)
|
||||
} DCS_DISK_ENTRY_SECTORS;
|
||||
static_assert(sizeof(DCS_DISK_ENTRY_SECTORS) == 32, "Wrong size DCS_DISK_ENTRY_SECTORS");
|
||||
|
||||
typedef struct _DCS_DISK_ENTRY_PARAMS {
|
||||
uint32 Type;
|
||||
uint32 Offset;
|
||||
uint64 Reserved[2];
|
||||
uint64 Length; // size of data
|
||||
} DCS_DISK_ENTRY_PARAMS;
|
||||
static_assert(sizeof(DCS_DISK_ENTRY_PARAMS) == 32, "Wrong size DCS_DISK_ENTRY_PARAMS");
|
||||
|
||||
typedef struct _DCS_DISK_ENTRY_DISKID {
|
||||
uint32 Type;
|
||||
uint32 MbrID;
|
||||
uint64 ReservedDiskId;
|
||||
DCS_GUID GptID;
|
||||
} DCS_DISK_ENTRY_DISKID;
|
||||
static_assert(sizeof(DCS_DISK_ENTRY_DISKID) == 32, "Wrong size DCS_DISK_ENTRY_DISKID");
|
||||
|
||||
#pragma warning(disable:4201)
|
||||
typedef struct _DCS_DISK_ENTRY {
|
||||
union {
|
||||
struct {
|
||||
uint32 Type;
|
||||
uint32 Offset;
|
||||
byte reserved[16];
|
||||
uint64 Length; // size of structure at Offset
|
||||
};
|
||||
DCS_DISK_ENTRY_SECTORS Sectors;
|
||||
DCS_DISK_ENTRY_DISKID DiskId;
|
||||
DCS_DISK_ENTRY_PARAMS Prm;
|
||||
};
|
||||
} DCS_DISK_ENTRY;
|
||||
#pragma warning(default:4201)
|
||||
static_assert(sizeof(DCS_DISK_ENTRY) == 32, "Wrong size DCS_DISK_ENTRY");
|
||||
|
||||
// Static compile time checks field offsets
|
||||
#ifndef FIELD_OFFSET
|
||||
#define FIELD_OFFSET(t, f) ((UINTN)(&((t*)0)->f))
|
||||
#endif
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Type), "Wrong Type offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_DISKID, Type), "Wrong Type offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Type) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Type), "Wrong Type offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Length), "Wrong Length offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Length) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Length), "Wrong Length offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_SECTORS, Offset), "Wrong Offset offset");
|
||||
static_assert(FIELD_OFFSET(DCS_DISK_ENTRY, Offset) == FIELD_OFFSET(DCS_DISK_ENTRY_PARAMS, Offset), "Wrong Offset offset");
|
||||
|
||||
// DE type specific data
|
||||
// DE List
|
||||
typedef struct _DCS_DISK_ENTRY_LIST {
|
||||
// EFI_TABLE_HEADER
|
||||
uint64 Signature;
|
||||
uint32 Revision;
|
||||
uint32 HeaderSize; //< The size, in bytes, of the entire table including the EFI_TABLE_HEADER.
|
||||
uint32 CRC32; //< The 32-bit CRC for the entire table. This value is computed by setting this field to 0, and computing the 32-bit CRC for HeaderSize bytes.
|
||||
uint32 Reserved; //< Reserved field that must be set to 0.
|
||||
//
|
||||
uint32 Count;
|
||||
uint32 DataSize;
|
||||
//
|
||||
DCS_DISK_ENTRY DE[15];
|
||||
} DCS_DISK_ENTRY_LIST;
|
||||
static_assert(sizeof(DCS_DISK_ENTRY_LIST) == 512, "Wrong size DCS_DISK_ENTRY_LIST");
|
||||
|
||||
typedef struct _DCS_DEP_EXEC {
|
||||
DCS_GUID ExecPartGuid;
|
||||
uint16 ExecCmd[248];
|
||||
} DCS_DEP_EXEC;
|
||||
static_assert(sizeof(DCS_DEP_EXEC) == 512, "Wrong size DCS_DEP_EXEC");
|
||||
|
||||
#define DCS_DEP_PWD_CACHE_SIGN SIGNATURE_64 ('P','W','D','C','A','C','H','E')
|
||||
typedef struct _DCS_DEP_PWD_CACHE {
|
||||
uint64 Sign;
|
||||
uint32 CRC;
|
||||
uint32 Count;
|
||||
Password Pwd[4];
|
||||
int32 Pim[4];
|
||||
byte pad[512 - 8 - 4 - 4 - (sizeof(Password) + 4) * 4];
|
||||
} DCS_DEP_PWD_CACHE;
|
||||
static_assert(sizeof(DCS_DEP_PWD_CACHE) == 512, "Wrong size DCS_DEP_PWD_CACHE");
|
||||
#pragma pack()
|
||||
|
||||
#endif // #if !defined(TC_WINDOWS_BOOT)
|
||||
|
||||
#endif // TC_HEADER_Boot_BootCommon
|
||||
|
||||
+102
-90
@@ -1,90 +1,102 @@
|
||||
/*
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "BootConfig.h"
|
||||
|
||||
byte BootSectorFlags;
|
||||
|
||||
byte BootLoaderDrive;
|
||||
byte BootDrive;
|
||||
bool BootDriveGeometryValid = false;
|
||||
bool PreventNormalSystemBoot = false;
|
||||
bool PreventBootMenu = false;
|
||||
char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
|
||||
uint32 OuterVolumeBackupHeaderCrc;
|
||||
|
||||
bool BootStarted = false;
|
||||
|
||||
DriveGeometry BootDriveGeometry;
|
||||
|
||||
CRYPTO_INFO *BootCryptoInfo;
|
||||
Partition EncryptedVirtualPartition;
|
||||
|
||||
Partition ActivePartition;
|
||||
Partition PartitionFollowingActive;
|
||||
bool ExtraBootPartitionPresent = false;
|
||||
uint64 HiddenVolumeStartUnitNo;
|
||||
uint64 HiddenVolumeStartSector;
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
|
||||
void ReadBootSectorUserConfiguration ()
|
||||
{
|
||||
byte userConfig;
|
||||
|
||||
AcquireSectorBuffer();
|
||||
|
||||
if (ReadWriteMBR (false, BootLoaderDrive, true) != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
|
||||
|
||||
#ifdef TC_WINDOWS_BOOT_AES
|
||||
EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION));
|
||||
#endif
|
||||
|
||||
PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC);
|
||||
|
||||
memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
|
||||
CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
|
||||
|
||||
if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE)
|
||||
{
|
||||
if (CustomUserMessage[0])
|
||||
{
|
||||
InitVideoMode();
|
||||
Print (CustomUserMessage);
|
||||
}
|
||||
|
||||
DisableScreenOutput();
|
||||
}
|
||||
|
||||
OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);
|
||||
|
||||
ret:
|
||||
ReleaseSectorBuffer();
|
||||
}
|
||||
|
||||
|
||||
BiosResult UpdateBootSectorConfiguration (byte drive)
|
||||
{
|
||||
AcquireSectorBuffer();
|
||||
|
||||
BiosResult result = ReadWriteMBR (false, drive);
|
||||
if (result != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags;
|
||||
result = ReadWriteMBR (true, drive);
|
||||
|
||||
ret:
|
||||
ReleaseSectorBuffer();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // !TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "BootConfig.h"
|
||||
|
||||
byte BootSectorFlags;
|
||||
|
||||
byte BootLoaderDrive;
|
||||
byte BootDrive;
|
||||
bool BootDriveGeometryValid = false;
|
||||
bool PreventNormalSystemBoot = false;
|
||||
bool PreventBootMenu = false;
|
||||
char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
|
||||
uint32 OuterVolumeBackupHeaderCrc;
|
||||
|
||||
bool BootStarted = false;
|
||||
|
||||
DriveGeometry BootDriveGeometry;
|
||||
|
||||
CRYPTO_INFO *BootCryptoInfo;
|
||||
Partition EncryptedVirtualPartition;
|
||||
|
||||
Partition ActivePartition;
|
||||
Partition PartitionFollowingActive;
|
||||
bool ExtraBootPartitionPresent = false;
|
||||
uint64 PimValueOrHiddenVolumeStartUnitNo; // reuse this variable for stored PIM value to reduce memory usage
|
||||
uint64 HiddenVolumeStartSector;
|
||||
|
||||
#ifndef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
|
||||
void ReadBootSectorUserConfiguration ()
|
||||
{
|
||||
byte userConfig;
|
||||
|
||||
AcquireSectorBuffer();
|
||||
|
||||
if (ReadWriteMBR (false, BootLoaderDrive, true) != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
userConfig = SectorBuffer[TC_BOOT_SECTOR_USER_CONFIG_OFFSET];
|
||||
|
||||
#ifdef TC_WINDOWS_BOOT_AES
|
||||
EnableHwEncryption (!(userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION));
|
||||
#endif
|
||||
|
||||
PreventBootMenu = (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_ESC);
|
||||
|
||||
memcpy (CustomUserMessage, SectorBuffer + TC_BOOT_SECTOR_USER_MESSAGE_OFFSET, TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH);
|
||||
CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH] = 0;
|
||||
|
||||
if (userConfig & TC_BOOT_USER_CFG_FLAG_SILENT_MODE)
|
||||
{
|
||||
if (CustomUserMessage[0])
|
||||
{
|
||||
InitVideoMode();
|
||||
Print (CustomUserMessage);
|
||||
}
|
||||
|
||||
DisableScreenOutput();
|
||||
}
|
||||
|
||||
if (userConfig & TC_BOOT_USER_CFG_FLAG_DISABLE_PIM)
|
||||
{
|
||||
PimValueOrHiddenVolumeStartUnitNo.LowPart = 0;
|
||||
memcpy (&PimValueOrHiddenVolumeStartUnitNo.LowPart, SectorBuffer + TC_BOOT_SECTOR_PIM_VALUE_OFFSET, TC_BOOT_SECTOR_PIM_VALUE_SIZE);
|
||||
}
|
||||
else
|
||||
PimValueOrHiddenVolumeStartUnitNo.LowPart = -1;
|
||||
|
||||
OuterVolumeBackupHeaderCrc = *(uint32 *) (SectorBuffer + TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET);
|
||||
|
||||
ret:
|
||||
ReleaseSectorBuffer();
|
||||
}
|
||||
|
||||
|
||||
BiosResult UpdateBootSectorConfiguration (byte drive)
|
||||
{
|
||||
AcquireSectorBuffer();
|
||||
|
||||
BiosResult result = ReadWriteMBR (false, drive);
|
||||
if (result != BiosResultSuccess)
|
||||
goto ret;
|
||||
|
||||
SectorBuffer[TC_BOOT_SECTOR_CONFIG_OFFSET] = BootSectorFlags;
|
||||
result = ReadWriteMBR (true, drive);
|
||||
|
||||
ret:
|
||||
ReleaseSectorBuffer();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // !TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
|
||||
@@ -1,42 +1,46 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConfig
|
||||
#define TC_HEADER_Boot_BootConfig
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "Platform.h"
|
||||
#include "BootDiskIo.h"
|
||||
|
||||
extern byte BootSectorFlags;
|
||||
|
||||
extern byte BootLoaderDrive;
|
||||
extern byte BootDrive;
|
||||
extern bool BootDriveGeometryValid;
|
||||
extern DriveGeometry BootDriveGeometry;
|
||||
extern bool PreventNormalSystemBoot;
|
||||
extern bool PreventBootMenu;
|
||||
extern char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
|
||||
extern uint32 OuterVolumeBackupHeaderCrc;
|
||||
|
||||
extern bool BootStarted;
|
||||
|
||||
extern CRYPTO_INFO *BootCryptoInfo;
|
||||
extern Partition EncryptedVirtualPartition;
|
||||
|
||||
extern Partition ActivePartition;
|
||||
extern Partition PartitionFollowingActive;
|
||||
extern bool ExtraBootPartitionPresent;
|
||||
extern uint64 HiddenVolumeStartUnitNo;
|
||||
extern uint64 HiddenVolumeStartSector;
|
||||
|
||||
|
||||
void ReadBootSectorUserConfiguration ();
|
||||
BiosResult UpdateBootSectorConfiguration (byte drive);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootConfig
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConfig
|
||||
#define TC_HEADER_Boot_BootConfig
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "Platform.h"
|
||||
#include "BootDiskIo.h"
|
||||
|
||||
extern byte BootSectorFlags;
|
||||
|
||||
extern byte BootLoaderDrive;
|
||||
extern byte BootDrive;
|
||||
extern bool BootDriveGeometryValid;
|
||||
extern DriveGeometry BootDriveGeometry;
|
||||
extern bool PreventNormalSystemBoot;
|
||||
extern bool PreventBootMenu;
|
||||
extern char CustomUserMessage[TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH + 1];
|
||||
extern uint32 OuterVolumeBackupHeaderCrc;
|
||||
|
||||
extern bool BootStarted;
|
||||
|
||||
extern CRYPTO_INFO *BootCryptoInfo;
|
||||
extern Partition EncryptedVirtualPartition;
|
||||
|
||||
extern Partition ActivePartition;
|
||||
extern Partition PartitionFollowingActive;
|
||||
extern bool ExtraBootPartitionPresent;
|
||||
extern uint64 PimValueOrHiddenVolumeStartUnitNo; // reuse this variable for stored PIM value to reduce memory usage
|
||||
extern uint64 HiddenVolumeStartSector;
|
||||
|
||||
|
||||
void ReadBootSectorUserConfiguration ();
|
||||
BiosResult UpdateBootSectorConfiguration (byte drive);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootConfig
|
||||
|
||||
+345
-330
@@ -1,330 +1,345 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootStrings.h"
|
||||
|
||||
|
||||
static int ScreenOutputDisabled = 0;
|
||||
|
||||
void DisableScreenOutput ()
|
||||
{
|
||||
++ScreenOutputDisabled;
|
||||
}
|
||||
|
||||
|
||||
void EnableScreenOutput ()
|
||||
{
|
||||
--ScreenOutputDisabled;
|
||||
}
|
||||
|
||||
|
||||
void PrintChar (char c)
|
||||
{
|
||||
#ifdef TC_BOOT_TRACING_ENABLED
|
||||
WriteDebugPort (c);
|
||||
#endif
|
||||
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 7
|
||||
mov al, c
|
||||
mov ah, 0xe
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintCharAtCursor (char c)
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 7
|
||||
mov al, c
|
||||
mov cx, 1
|
||||
mov ah, 0xa
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Print (const char *str)
|
||||
{
|
||||
char c;
|
||||
while (c = *str++)
|
||||
PrintChar (c);
|
||||
}
|
||||
|
||||
|
||||
void Print (uint32 number)
|
||||
{
|
||||
char str[12];
|
||||
int pos = 0;
|
||||
while (number >= 10)
|
||||
{
|
||||
str[pos++] = (char) (number % 10) + '0';
|
||||
number /= 10;
|
||||
}
|
||||
str[pos] = (char) (number % 10) + '0';
|
||||
|
||||
while (pos >= 0)
|
||||
PrintChar (str[pos--]);
|
||||
}
|
||||
|
||||
|
||||
void Print (const uint64 &number)
|
||||
{
|
||||
if (number.HighPart == 0)
|
||||
Print (number.LowPart);
|
||||
else
|
||||
PrintHex (number);
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (byte b)
|
||||
{
|
||||
PrintChar (((b >> 4) >= 0xA ? 'A' - 0xA : '0') + (b >> 4));
|
||||
PrintChar (((b & 0xF) >= 0xA ? 'A' - 0xA : '0') + (b & 0xF));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (uint16 data)
|
||||
{
|
||||
PrintHex (byte (data >> 8));
|
||||
PrintHex (byte (data));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (uint32 data)
|
||||
{
|
||||
PrintHex (uint16 (data >> 16));
|
||||
PrintHex (uint16 (data));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (const uint64 &data)
|
||||
{
|
||||
PrintHex (data.HighPart);
|
||||
PrintHex (data.LowPart);
|
||||
}
|
||||
|
||||
void PrintRepeatedChar (char c, int n)
|
||||
{
|
||||
while (n-- > 0)
|
||||
PrintChar (c);
|
||||
}
|
||||
|
||||
|
||||
void PrintEndl ()
|
||||
{
|
||||
Print ("\r\n");
|
||||
}
|
||||
|
||||
|
||||
void PrintEndl (int cnt)
|
||||
{
|
||||
while (cnt-- > 0)
|
||||
PrintEndl ();
|
||||
}
|
||||
|
||||
|
||||
void Beep ()
|
||||
{
|
||||
PrintChar (7);
|
||||
}
|
||||
|
||||
|
||||
void InitVideoMode ()
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
// Text mode 80x25
|
||||
mov ax, 3
|
||||
int 0x10
|
||||
|
||||
// Page 0
|
||||
mov ax, 0x500
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ClearScreen ()
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
// White text on black
|
||||
mov bh, 7
|
||||
xor cx, cx
|
||||
mov dx, 0x184f
|
||||
mov ax, 0x600
|
||||
int 0x10
|
||||
|
||||
// Cursor at 0,0
|
||||
xor bh, bh
|
||||
xor dx, dx
|
||||
mov ah, 2
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintBackspace ()
|
||||
{
|
||||
PrintChar (TC_BIOS_CHAR_BACKSPACE);
|
||||
PrintCharAtCursor (' ');
|
||||
}
|
||||
|
||||
|
||||
void PrintError (const char *message)
|
||||
{
|
||||
Print (TC_BOOT_STR_ERROR);
|
||||
Print (message);
|
||||
PrintEndl();
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
void PrintErrorNoEndl (const char *message)
|
||||
{
|
||||
Print (TC_BOOT_STR_ERROR);
|
||||
Print (message);
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
byte GetShiftFlags ()
|
||||
{
|
||||
byte flags;
|
||||
__asm
|
||||
{
|
||||
mov ah, 2
|
||||
int 0x16
|
||||
mov flags, al
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
byte GetKeyboardChar ()
|
||||
{
|
||||
return GetKeyboardChar (nullptr);
|
||||
}
|
||||
|
||||
|
||||
byte GetKeyboardChar (byte *scanCode)
|
||||
{
|
||||
// Work around potential BIOS bugs (Windows boot manager polls the keystroke buffer)
|
||||
while (!IsKeyboardCharAvailable());
|
||||
|
||||
byte asciiCode;
|
||||
byte scan;
|
||||
__asm
|
||||
{
|
||||
mov ah, 0
|
||||
int 0x16
|
||||
mov asciiCode, al
|
||||
mov scan, ah
|
||||
}
|
||||
|
||||
if (scanCode)
|
||||
*scanCode = scan;
|
||||
|
||||
return asciiCode;
|
||||
}
|
||||
|
||||
|
||||
bool IsKeyboardCharAvailable ()
|
||||
{
|
||||
bool available = false;
|
||||
__asm
|
||||
{
|
||||
mov ah, 1
|
||||
int 0x16
|
||||
jz not_avail
|
||||
mov available, true
|
||||
not_avail:
|
||||
}
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
|
||||
bool EscKeyPressed ()
|
||||
{
|
||||
if (IsKeyboardCharAvailable ())
|
||||
{
|
||||
byte keyScanCode;
|
||||
GetKeyboardChar (&keyScanCode);
|
||||
return keyScanCode == TC_BIOS_KEY_ESC;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void ClearBiosKeystrokeBuffer ()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
mov di, 0x41e
|
||||
mov cx, 32
|
||||
cld
|
||||
rep stosb
|
||||
pop es
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool IsPrintable (char c)
|
||||
{
|
||||
return c >= ' ' && c <= '~';
|
||||
}
|
||||
|
||||
|
||||
int GetString (char *buffer, size_t bufferSize)
|
||||
{
|
||||
byte c;
|
||||
byte scanCode;
|
||||
size_t pos = 0;
|
||||
|
||||
while (pos < bufferSize)
|
||||
{
|
||||
c = GetKeyboardChar (&scanCode);
|
||||
|
||||
if (scanCode == TC_BIOS_KEY_ENTER)
|
||||
break;
|
||||
|
||||
if (scanCode == TC_BIOS_KEY_ESC)
|
||||
return 0;
|
||||
|
||||
buffer[pos++] = c;
|
||||
PrintChar (IsPrintable (c) ? c : ' ');
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootStrings.h"
|
||||
|
||||
|
||||
static int ScreenOutputDisabled = 0;
|
||||
|
||||
void DisableScreenOutput ()
|
||||
{
|
||||
++ScreenOutputDisabled;
|
||||
}
|
||||
|
||||
|
||||
void EnableScreenOutput ()
|
||||
{
|
||||
--ScreenOutputDisabled;
|
||||
}
|
||||
|
||||
|
||||
void PrintChar (char c)
|
||||
{
|
||||
#ifdef TC_BOOT_TRACING_ENABLED
|
||||
WriteDebugPort (c);
|
||||
#endif
|
||||
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 7
|
||||
mov al, c
|
||||
mov ah, 0xe
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintCharAtCursor (char c)
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 7
|
||||
mov al, c
|
||||
mov cx, 1
|
||||
mov ah, 0xa
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Print (const char *str)
|
||||
{
|
||||
char c;
|
||||
while (c = *str++)
|
||||
PrintChar (c);
|
||||
}
|
||||
|
||||
|
||||
void Print (uint32 number)
|
||||
{
|
||||
char str[12];
|
||||
int pos = 0;
|
||||
while (number >= 10)
|
||||
{
|
||||
str[pos++] = (char) (number % 10) + '0';
|
||||
number /= 10;
|
||||
}
|
||||
str[pos] = (char) (number % 10) + '0';
|
||||
|
||||
while (pos >= 0)
|
||||
PrintChar (str[pos--]);
|
||||
}
|
||||
|
||||
|
||||
void Print (const uint64 &number)
|
||||
{
|
||||
if (number.HighPart == 0)
|
||||
Print (number.LowPart);
|
||||
else
|
||||
PrintHex (number);
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (byte b)
|
||||
{
|
||||
PrintChar (((b >> 4) >= 0xA ? 'A' - 0xA : '0') + (b >> 4));
|
||||
PrintChar (((b & 0xF) >= 0xA ? 'A' - 0xA : '0') + (b & 0xF));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (uint16 data)
|
||||
{
|
||||
PrintHex (byte (data >> 8));
|
||||
PrintHex (byte (data));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (uint32 data)
|
||||
{
|
||||
PrintHex (uint16 (data >> 16));
|
||||
PrintHex (uint16 (data));
|
||||
}
|
||||
|
||||
|
||||
void PrintHex (const uint64 &data)
|
||||
{
|
||||
PrintHex (data.HighPart);
|
||||
PrintHex (data.LowPart);
|
||||
}
|
||||
|
||||
void PrintRepeatedChar (char c, int n)
|
||||
{
|
||||
while (n-- > 0)
|
||||
PrintChar (c);
|
||||
}
|
||||
|
||||
|
||||
void PrintEndl ()
|
||||
{
|
||||
Print ("\r\n");
|
||||
}
|
||||
|
||||
|
||||
void PrintEndl (int cnt)
|
||||
{
|
||||
while (cnt-- > 0)
|
||||
PrintEndl ();
|
||||
}
|
||||
|
||||
|
||||
void Beep ()
|
||||
{
|
||||
PrintChar (7);
|
||||
}
|
||||
|
||||
|
||||
void InitVideoMode ()
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
// Text mode 80x25
|
||||
mov ax, 3
|
||||
int 0x10
|
||||
|
||||
// Page 0
|
||||
mov ax, 0x500
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ClearScreen ()
|
||||
{
|
||||
if (ScreenOutputDisabled)
|
||||
return;
|
||||
|
||||
__asm
|
||||
{
|
||||
// White text on black
|
||||
mov bh, 7
|
||||
xor cx, cx
|
||||
mov dx, 0x184f
|
||||
mov ax, 0x600
|
||||
int 0x10
|
||||
|
||||
// Cursor at 0,0
|
||||
xor bh, bh
|
||||
xor dx, dx
|
||||
mov ah, 2
|
||||
int 0x10
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintBackspace ()
|
||||
{
|
||||
PrintChar (TC_BIOS_CHAR_BACKSPACE);
|
||||
PrintCharAtCursor (' ');
|
||||
}
|
||||
|
||||
|
||||
void PrintError (const char *message)
|
||||
{
|
||||
Print (TC_BOOT_STR_ERROR);
|
||||
Print (message);
|
||||
PrintEndl();
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
void PrintErrorNoEndl (const char *message)
|
||||
{
|
||||
Print (TC_BOOT_STR_ERROR);
|
||||
Print (message);
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
byte GetShiftFlags ()
|
||||
{
|
||||
byte flags;
|
||||
__asm
|
||||
{
|
||||
mov ah, 2
|
||||
int 0x16
|
||||
mov flags, al
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
byte GetKeyboardChar ()
|
||||
{
|
||||
return GetKeyboardChar (nullptr);
|
||||
}
|
||||
|
||||
|
||||
byte GetKeyboardChar (byte *scanCode)
|
||||
{
|
||||
// Work around potential BIOS bugs (Windows boot manager polls the keystroke buffer)
|
||||
while (!IsKeyboardCharAvailable());
|
||||
|
||||
byte asciiCode;
|
||||
byte scan;
|
||||
__asm
|
||||
{
|
||||
mov ah, 0
|
||||
int 0x16
|
||||
mov asciiCode, al
|
||||
mov scan, ah
|
||||
}
|
||||
|
||||
if (scanCode)
|
||||
*scanCode = scan;
|
||||
|
||||
return asciiCode;
|
||||
}
|
||||
|
||||
|
||||
bool IsKeyboardCharAvailable ()
|
||||
{
|
||||
bool available = false;
|
||||
__asm
|
||||
{
|
||||
mov ah, 1
|
||||
int 0x16
|
||||
jz not_avail
|
||||
mov available, true
|
||||
not_avail:
|
||||
}
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
|
||||
bool EscKeyPressed ()
|
||||
{
|
||||
if (IsKeyboardCharAvailable ())
|
||||
{
|
||||
byte keyScanCode;
|
||||
GetKeyboardChar (&keyScanCode);
|
||||
return keyScanCode == TC_BIOS_KEY_ESC;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void ClearBiosKeystrokeBuffer ()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
mov di, 0x41e
|
||||
mov cx, 32
|
||||
cld
|
||||
rep stosb
|
||||
|
||||
// reset position pointers at 0x41A and 0x41C to the begining
|
||||
// of keyboard buffer to avoid revealing password/PIM length
|
||||
mov ax, 0x001e
|
||||
mov es:[0x41a], ax
|
||||
mov es:[0x41c], ax
|
||||
pop es
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool IsPrintable (char c)
|
||||
{
|
||||
return c >= ' ' && c <= '~';
|
||||
}
|
||||
|
||||
bool IsDigit (char c)
|
||||
{
|
||||
return c >= '0' && c <= '9';
|
||||
}
|
||||
|
||||
|
||||
int GetString (char *buffer, size_t bufferSize)
|
||||
{
|
||||
byte c;
|
||||
byte scanCode;
|
||||
size_t pos = 0;
|
||||
|
||||
while (pos < bufferSize)
|
||||
{
|
||||
c = GetKeyboardChar (&scanCode);
|
||||
|
||||
if (scanCode == TC_BIOS_KEY_ENTER)
|
||||
break;
|
||||
|
||||
if (scanCode == TC_BIOS_KEY_ESC)
|
||||
return 0;
|
||||
|
||||
buffer[pos++] = c;
|
||||
PrintChar (IsPrintable (c) ? c : ' ');
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
@@ -1,67 +1,72 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConsoleIo
|
||||
#define TC_HEADER_Boot_BootConsoleIo
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define TC_DEBUG_PORT 0
|
||||
|
||||
#define TC_BIOS_KEY_ESC 1
|
||||
#define TC_BIOS_KEY_BACKSPACE 14
|
||||
#define TC_BIOS_KEY_ENTER 28
|
||||
#define TC_BIOS_KEY_F1 0x3b
|
||||
#define TC_BIOS_KEY_F2 0x3c
|
||||
#define TC_BIOS_KEY_F3 0x3d
|
||||
#define TC_BIOS_KEY_F4 0x3e
|
||||
#define TC_BIOS_KEY_F5 0x3f
|
||||
#define TC_BIOS_KEY_F6 0x40
|
||||
#define TC_BIOS_KEY_F7 0x41
|
||||
#define TC_BIOS_KEY_F8 0x42
|
||||
#define TC_BIOS_KEY_F9 0x43
|
||||
#define TC_BIOS_KEY_F10 0x44
|
||||
|
||||
#define TC_BIOS_SHIFTMASK_CAPSLOCK (1 << 6)
|
||||
#define TC_BIOS_SHIFTMASK_LSHIFT (1 << 1)
|
||||
#define TC_BIOS_SHIFTMASK_RSHIFT (1 << 0)
|
||||
|
||||
#define TC_BIOS_CHAR_BACKSPACE 8
|
||||
|
||||
#define TC_BIOS_MAX_CHARS_PER_LINE 80
|
||||
|
||||
void Beep ();
|
||||
void ClearBiosKeystrokeBuffer ();
|
||||
void ClearScreen ();
|
||||
void DisableScreenOutput ();
|
||||
void EnableScreenOutput ();
|
||||
bool EscKeyPressed ();
|
||||
byte GetKeyboardChar ();
|
||||
byte GetKeyboardChar (byte *scanCode);
|
||||
byte GetShiftFlags ();
|
||||
int GetString (char *buffer, size_t bufferSize);
|
||||
void InitVideoMode ();
|
||||
bool IsKeyboardCharAvailable ();
|
||||
bool IsPrintable (char c);
|
||||
void Print (const char *str);
|
||||
void Print (uint32 number);
|
||||
void Print (const uint64 &number);
|
||||
void PrintBackspace ();
|
||||
void PrintChar (char c);
|
||||
void PrintCharAtCursor (char c);
|
||||
void PrintEndl ();
|
||||
void PrintEndl (int cnt);
|
||||
void PrintRepeatedChar (char c, int n);
|
||||
void PrintError (const char *message);
|
||||
void PrintErrorNoEndl (const char *message);
|
||||
void PrintHex (byte b);
|
||||
void PrintHex (uint16 data);
|
||||
void PrintHex (uint32 data);
|
||||
void PrintHex (const uint64 &data);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootConsoleIo
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootConsoleIo
|
||||
#define TC_HEADER_Boot_BootConsoleIo
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
#define TC_DEBUG_PORT 0
|
||||
|
||||
#define TC_BIOS_KEY_ESC 1
|
||||
#define TC_BIOS_KEY_BACKSPACE 14
|
||||
#define TC_BIOS_KEY_ENTER 28
|
||||
#define TC_BIOS_KEY_F1 0x3b
|
||||
#define TC_BIOS_KEY_F2 0x3c
|
||||
#define TC_BIOS_KEY_F3 0x3d
|
||||
#define TC_BIOS_KEY_F4 0x3e
|
||||
#define TC_BIOS_KEY_F5 0x3f
|
||||
#define TC_BIOS_KEY_F6 0x40
|
||||
#define TC_BIOS_KEY_F7 0x41
|
||||
#define TC_BIOS_KEY_F8 0x42
|
||||
#define TC_BIOS_KEY_F9 0x43
|
||||
#define TC_BIOS_KEY_F10 0x44
|
||||
|
||||
#define TC_BIOS_SHIFTMASK_CAPSLOCK (1 << 6)
|
||||
#define TC_BIOS_SHIFTMASK_LSHIFT (1 << 1)
|
||||
#define TC_BIOS_SHIFTMASK_RSHIFT (1 << 0)
|
||||
|
||||
#define TC_BIOS_CHAR_BACKSPACE 8
|
||||
|
||||
#define TC_BIOS_MAX_CHARS_PER_LINE 80
|
||||
|
||||
void Beep ();
|
||||
void ClearBiosKeystrokeBuffer ();
|
||||
void ClearScreen ();
|
||||
void DisableScreenOutput ();
|
||||
void EnableScreenOutput ();
|
||||
bool EscKeyPressed ();
|
||||
byte GetKeyboardChar ();
|
||||
byte GetKeyboardChar (byte *scanCode);
|
||||
byte GetShiftFlags ();
|
||||
int GetString (char *buffer, size_t bufferSize);
|
||||
void InitVideoMode ();
|
||||
bool IsKeyboardCharAvailable ();
|
||||
bool IsPrintable (char c);
|
||||
bool IsDigit (char c);
|
||||
void Print (const char *str);
|
||||
void Print (uint32 number);
|
||||
void Print (const uint64 &number);
|
||||
void PrintBackspace ();
|
||||
void PrintChar (char c);
|
||||
void PrintCharAtCursor (char c);
|
||||
void PrintEndl ();
|
||||
void PrintEndl (int cnt);
|
||||
void PrintRepeatedChar (char c, int n);
|
||||
void PrintError (const char *message);
|
||||
void PrintErrorNoEndl (const char *message);
|
||||
void PrintHex (byte b);
|
||||
void PrintHex (uint16 data);
|
||||
void PrintHex (uint32 data);
|
||||
void PrintHex (const uint64 &data);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootConsoleIo
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
;
|
||||
; Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
;
|
||||
; Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
; the file License.txt included in TrueCrypt binary and source code distribution
|
||||
; packages.
|
||||
;
|
||||
|
||||
.MODEL tiny, C
|
||||
.386
|
||||
|
||||
INCLUDE BootDefs.i
|
||||
|
||||
EXTERNDEF main:NEAR
|
||||
|
||||
_TEXT SEGMENT
|
||||
ORG TC_COM_EXECUTABLE_OFFSET
|
||||
|
||||
start:
|
||||
jmp main
|
||||
|
||||
_TEXT ENDS
|
||||
END start
|
||||
;
|
||||
; Derived from source code of TrueCrypt 7.1a, which is
|
||||
; Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
; by the TrueCrypt License 3.0.
|
||||
;
|
||||
; Modifications and additions to the original source code (contained in this file)
|
||||
; and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
; and are governed by the Apache License 2.0 the full text of which is
|
||||
; contained in the file License.txt included in VeraCrypt binary and source
|
||||
; code distribution packages.
|
||||
;
|
||||
|
||||
.MODEL tiny, C
|
||||
.386
|
||||
|
||||
INCLUDE BootDefs.i
|
||||
|
||||
EXTERNDEF main:NEAR
|
||||
|
||||
_TEXT SEGMENT
|
||||
ORG TC_COM_EXECUTABLE_OFFSET
|
||||
|
||||
start:
|
||||
jmp main
|
||||
|
||||
_TEXT ENDS
|
||||
END start
|
||||
|
||||
+181
-177
@@ -1,177 +1,181 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootDebug.h"
|
||||
|
||||
|
||||
#ifdef TC_BOOT_TRACING_ENABLED
|
||||
|
||||
void InitDebugPort ()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 1
|
||||
int 0x17
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 0xe2
|
||||
int 0x17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WriteDebugPort (byte dataByte)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov al, dataByte
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 0
|
||||
int 0x17
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_TRACING_ENABLED
|
||||
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
|
||||
extern "C" void PrintDebug (uint32 debugVal)
|
||||
{
|
||||
Print (debugVal);
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintVal (const char *message, const uint32 value, bool newLine, bool hex)
|
||||
{
|
||||
Print (message);
|
||||
Print (": ");
|
||||
|
||||
if (hex)
|
||||
PrintHex (value);
|
||||
else
|
||||
Print (value);
|
||||
|
||||
if (newLine)
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintVal (const char *message, const uint64 &value, bool newLine, bool hex)
|
||||
{
|
||||
Print (message);
|
||||
Print (": ");
|
||||
PrintHex (value);
|
||||
if (newLine)
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment)
|
||||
{
|
||||
const size_t width = 16;
|
||||
for (size_t pos = 0; pos < size; )
|
||||
{
|
||||
for (int pass = 1; pass <= 2; ++pass)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < width && pos < size; ++i)
|
||||
{
|
||||
byte dataByte;
|
||||
if (memSegment)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov si, ss:memSegment
|
||||
mov es, ss:[si]
|
||||
mov si, ss:mem
|
||||
add si, pos
|
||||
mov al, es:[si]
|
||||
mov dataByte, al
|
||||
pop es
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
dataByte = mem[pos++];
|
||||
|
||||
if (pass == 1)
|
||||
{
|
||||
PrintHex (dataByte);
|
||||
PrintChar (' ');
|
||||
}
|
||||
else
|
||||
PrintChar (IsPrintable (dataByte) ? dataByte : '.');
|
||||
}
|
||||
|
||||
if (pass == 1)
|
||||
{
|
||||
pos -= i;
|
||||
PrintChar (' ');
|
||||
}
|
||||
}
|
||||
|
||||
PrintEndl ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size)
|
||||
{
|
||||
PrintHexDump ((byte *) memOffset, size, &memSegment);
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_DEBUG_ENABLED
|
||||
|
||||
|
||||
#ifdef TC_BOOT_STACK_CHECKING_ENABLED
|
||||
|
||||
extern "C" char end[];
|
||||
|
||||
static void PrintStackInfo ()
|
||||
{
|
||||
uint16 spReg;
|
||||
__asm mov spReg, sp
|
||||
|
||||
Print ("Stack: "); Print (TC_BOOT_LOADER_STACK_TOP - spReg);
|
||||
Print ("/"); Print (TC_BOOT_LOADER_STACK_TOP - (uint16) end);
|
||||
}
|
||||
|
||||
|
||||
void CheckStack ()
|
||||
{
|
||||
uint16 spReg;
|
||||
__asm mov spReg, sp
|
||||
|
||||
if (*(uint32 *) end != 0x12345678UL || spReg < (uint16) end)
|
||||
{
|
||||
__asm cli
|
||||
__asm mov sp, TC_BOOT_LOADER_STACK_TOP
|
||||
|
||||
PrintError ("Stack overflow");
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InitStackChecker ()
|
||||
{
|
||||
*(uint32 *) end = 0x12345678UL;
|
||||
|
||||
PrintStackInfo();
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_STACK_CHECKING_ENABLED
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Platform.h"
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootDebug.h"
|
||||
|
||||
|
||||
#ifdef TC_BOOT_TRACING_ENABLED
|
||||
|
||||
void InitDebugPort ()
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 1
|
||||
int 0x17
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 0xe2
|
||||
int 0x17
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WriteDebugPort (byte dataByte)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov al, dataByte
|
||||
mov dx, TC_DEBUG_PORT
|
||||
mov ah, 0
|
||||
int 0x17
|
||||
}
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_TRACING_ENABLED
|
||||
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
|
||||
extern "C" void PrintDebug (uint32 debugVal)
|
||||
{
|
||||
Print (debugVal);
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintVal (const char *message, const uint32 value, bool newLine, bool hex)
|
||||
{
|
||||
Print (message);
|
||||
Print (": ");
|
||||
|
||||
if (hex)
|
||||
PrintHex (value);
|
||||
else
|
||||
Print (value);
|
||||
|
||||
if (newLine)
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintVal (const char *message, const uint64 &value, bool newLine, bool hex)
|
||||
{
|
||||
Print (message);
|
||||
Print (": ");
|
||||
PrintHex (value);
|
||||
if (newLine)
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
|
||||
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment)
|
||||
{
|
||||
const size_t width = 16;
|
||||
for (size_t pos = 0; pos < size; )
|
||||
{
|
||||
for (int pass = 1; pass <= 2; ++pass)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < width && pos < size; ++i)
|
||||
{
|
||||
byte dataByte;
|
||||
if (memSegment)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov si, ss:memSegment
|
||||
mov es, ss:[si]
|
||||
mov si, ss:mem
|
||||
add si, pos
|
||||
mov al, es:[si]
|
||||
mov dataByte, al
|
||||
pop es
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
else
|
||||
dataByte = mem[pos++];
|
||||
|
||||
if (pass == 1)
|
||||
{
|
||||
PrintHex (dataByte);
|
||||
PrintChar (' ');
|
||||
}
|
||||
else
|
||||
PrintChar (IsPrintable (dataByte) ? dataByte : '.');
|
||||
}
|
||||
|
||||
if (pass == 1)
|
||||
{
|
||||
pos -= i;
|
||||
PrintChar (' ');
|
||||
}
|
||||
}
|
||||
|
||||
PrintEndl ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size)
|
||||
{
|
||||
PrintHexDump ((byte *) memOffset, size, &memSegment);
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_DEBUG_ENABLED
|
||||
|
||||
|
||||
#ifdef TC_BOOT_STACK_CHECKING_ENABLED
|
||||
|
||||
extern "C" char end[];
|
||||
|
||||
static void PrintStackInfo ()
|
||||
{
|
||||
uint16 spReg;
|
||||
__asm mov spReg, sp
|
||||
|
||||
Print ("Stack: "); Print (TC_BOOT_LOADER_STACK_TOP - spReg);
|
||||
Print ("/"); Print (TC_BOOT_LOADER_STACK_TOP - (uint16) end);
|
||||
}
|
||||
|
||||
|
||||
void CheckStack ()
|
||||
{
|
||||
uint16 spReg;
|
||||
__asm mov spReg, sp
|
||||
|
||||
if (*(uint32 *) end != 0x12345678UL || spReg < (uint16) end)
|
||||
{
|
||||
__asm cli
|
||||
__asm mov sp, TC_BOOT_LOADER_STACK_TOP
|
||||
|
||||
PrintError ("Stack overflow");
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InitStackChecker ()
|
||||
{
|
||||
*(uint32 *) end = 0x12345678UL;
|
||||
|
||||
PrintStackInfo();
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
#endif // TC_BOOT_STACK_CHECKING_ENABLED
|
||||
|
||||
@@ -1,56 +1,60 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDebug
|
||||
#define TC_HEADER_Boot_BootDebug
|
||||
|
||||
#include "Platform.h"
|
||||
#include "BootConsoleIo.h"
|
||||
|
||||
#if 0
|
||||
# define TC_BOOT_DEBUG_ENABLED
|
||||
#endif
|
||||
|
||||
#if 0 || defined (TC_BOOT_DEBUG_ENABLED)
|
||||
# define TC_BOOT_STACK_CHECKING_ENABLED
|
||||
extern "C" void CheckStack ();
|
||||
#else
|
||||
# define CheckStack()
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
# define TC_BOOT_TRACING_ENABLED
|
||||
# if 1
|
||||
# define TC_TRACE_INT13
|
||||
# endif
|
||||
# if 0
|
||||
# define TC_TRACE_INT15
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
# define trace_point do { Print(__FILE__); PrintChar (':'); Print (TC_TO_STRING (__LINE__)); PrintEndl(); } while (false)
|
||||
# define trace_val(VAL) PrintVal (#VAL, VAL);
|
||||
# define trace_hex(VAL) do { Print (#VAL), PrintChar (':'); PrintHex (VAL); PrintEndl(); } while (false)
|
||||
# define assert(COND) do { if (!(COND)) { trace_point; __asm jmp $ } } while (false)
|
||||
#else
|
||||
# define trace_point
|
||||
# define trace_val(VAL)
|
||||
# define trace_hex(VAL)
|
||||
# define assert(COND)
|
||||
#endif
|
||||
|
||||
void InitDebugPort ();
|
||||
void InitStackChecker ();
|
||||
void WriteDebugPort (byte dataByte);
|
||||
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment = nullptr);
|
||||
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size);
|
||||
void PrintVal (const char *message, const uint32 value, bool newLine = true, bool hex = false);
|
||||
void PrintVal (const char *message, const uint64 &value, bool newLine = true, bool hex = false);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDebug
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDebug
|
||||
#define TC_HEADER_Boot_BootDebug
|
||||
|
||||
#include "Platform.h"
|
||||
#include "BootConsoleIo.h"
|
||||
|
||||
#if 0
|
||||
# define TC_BOOT_DEBUG_ENABLED
|
||||
#endif
|
||||
|
||||
#if 0 || defined (TC_BOOT_DEBUG_ENABLED)
|
||||
# define TC_BOOT_STACK_CHECKING_ENABLED
|
||||
extern "C" void CheckStack ();
|
||||
#else
|
||||
# define CheckStack()
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
# define TC_BOOT_TRACING_ENABLED
|
||||
# if 1
|
||||
# define TC_TRACE_INT13
|
||||
# endif
|
||||
# if 0
|
||||
# define TC_TRACE_INT15
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
# define trace_point do { Print(__FILE__); PrintChar (':'); Print (TC_TO_STRING (__LINE__)); PrintEndl(); } while (false)
|
||||
# define trace_val(VAL) PrintVal (#VAL, VAL);
|
||||
# define trace_hex(VAL) do { Print (#VAL), PrintChar (':'); PrintHex (VAL); PrintEndl(); } while (false)
|
||||
# define assert(COND) do { if (!(COND)) { trace_point; __asm jmp $ } } while (false)
|
||||
#else
|
||||
# define trace_point
|
||||
# define trace_val(VAL)
|
||||
# define trace_hex(VAL)
|
||||
# define assert(COND)
|
||||
#endif
|
||||
|
||||
void InitDebugPort ();
|
||||
void InitStackChecker ();
|
||||
void WriteDebugPort (byte dataByte);
|
||||
void PrintHexDump (byte *mem, size_t size, uint16 *memSegment = nullptr);
|
||||
void PrintHexDump (uint16 memSegment, uint16 memOffset, size_t size);
|
||||
void PrintVal (const char *message, const uint32 value, bool newLine = true, bool hex = false);
|
||||
void PrintVal (const char *message, const uint64 &value, bool newLine = true, bool hex = false);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDebug
|
||||
|
||||
+210
-188
@@ -1,188 +1,210 @@
|
||||
/*
|
||||
Copyright (c) 2008-2009 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDefs
|
||||
#define TC_HEADER_Boot_BootDefs
|
||||
|
||||
// Total memory required (CODE + DATA + BSS + STACK + 0x100) in KBytes - determined from linker map.
|
||||
#define TC__BOOT_MEMORY_REQUIRED 42
|
||||
|
||||
#ifdef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
|
||||
# undef TC__BOOT_MEMORY_REQUIRED
|
||||
|
||||
# ifdef TC_WINDOWS_BOOT_AES
|
||||
# ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
# define TC__BOOT_MEMORY_REQUIRED 30
|
||||
# else
|
||||
# define TC__BOOT_MEMORY_REQUIRED 28
|
||||
# endif
|
||||
# elif defined (TC_WINDOWS_BOOT_SERPENT)
|
||||
# define TC__BOOT_MEMORY_REQUIRED 32
|
||||
# elif defined (TC_WINDOWS_BOOT_TWOFISH)
|
||||
# define TC__BOOT_MEMORY_REQUIRED 40
|
||||
# endif
|
||||
|
||||
#if 0
|
||||
# undef TC__BOOT_MEMORY_REQUIRED
|
||||
# define TC__BOOT_MEMORY_REQUIRED 60
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Modifying this value can introduce incompatibility with previous versions
|
||||
#define TC__BOOT_LOADER_SEGMENT TC_HEX (9000) // Some buggy BIOS routines fail if CS bits 0-10 are not zero
|
||||
|
||||
#if TC__BOOT_MEMORY_REQUIRED <= 32
|
||||
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16)
|
||||
#else
|
||||
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16)
|
||||
#endif
|
||||
|
||||
#define TC__COM_EXECUTABLE_OFFSET TC_HEX (100)
|
||||
|
||||
#define TC__BOOT_LOADER_LOWMEM_SEGMENT TC_HEX (2000)
|
||||
#define TC__BOOT_LOADER_BUFFER_SEGMENT TC_HEX (4000)
|
||||
#define TC__BOOT_LOADER_ALT_SEGMENT TC_HEX (6000)
|
||||
|
||||
#define TC__BOOT_LOADER_STACK_TOP (TC_BOOT_MEMORY_REQUIRED * TC_UNSIGNED (1024) - 4)
|
||||
|
||||
#define TC__LB_SIZE 512
|
||||
#define TC__BOOT_LOADER_AREA_SECTOR_COUNT 63
|
||||
|
||||
#define TC__BOOT_SECTOR_VERSION_OFFSET 430
|
||||
#define TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET 432
|
||||
#define TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET 434
|
||||
#define TC__BOOT_SECTOR_USER_CONFIG_OFFSET 438
|
||||
#define TC__BOOT_SECTOR_CONFIG_OFFSET 439 // The last byte that is reserved for the boot loader
|
||||
|
||||
#define TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH 24
|
||||
#define TC__BOOT_SECTOR_USER_MESSAGE_OFFSET (TC__BOOT_SECTOR_VERSION_OFFSET - TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)
|
||||
|
||||
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE 4
|
||||
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET (TC__BOOT_SECTOR_USER_MESSAGE_OFFSET - TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE)
|
||||
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR 2
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT 4
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE 32768
|
||||
#define TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET (TC_COM_EXECUTABLE_OFFSET + 3072)
|
||||
|
||||
#define TC__BOOT_LOADER_START_SECTOR (TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT)
|
||||
#define TC__MAX_BOOT_LOADER_SECTOR_COUNT (TC_BOOT_LOADER_AREA_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT - 2)
|
||||
#define TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE ((TC_BOOT_LOADER_AREA_SECTOR_COUNT - 2) * TC_LB_SIZE)
|
||||
|
||||
#define TC__BOOT_LOADER_BACKUP_SECTOR_COUNT 30
|
||||
|
||||
#define TC__GZIP_HEADER_SIZE 10
|
||||
|
||||
#define TC__BOOT_CFG_FLAG_AREA_SIZE 1 // In bytes
|
||||
|
||||
// If you add more flags, revise TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
#define TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_HEX (02)
|
||||
#define TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_HEX (04)
|
||||
#define TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC_HEX (10)
|
||||
#define TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_HEX (20)
|
||||
#define TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE (TC_HEX (40) + TC_HEX (80))
|
||||
|
||||
// Modifying the following values can introduce incompatibility with previous versions
|
||||
#define TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_HEX (01)
|
||||
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02)
|
||||
#define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04)
|
||||
|
||||
// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value)
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_NONE 0
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_CLONING TC_HEX (40) // The boot loader is to copy the content of the system partition to the hidden volume
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_WIPING TC_HEX (80) // The boot loader has successfully copied the content of the system partition to the hidden volume. The original OS is to be wiped now.
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_WIPED (TC_HEX (40) + TC_HEX (80)) // The original OS has been wiped. The user is required to install a new OS (decoy OS) on the system partition now.
|
||||
|
||||
|
||||
#ifdef TC_ASM_PREPROCESS
|
||||
|
||||
#define TC_HEX(N) 0##N##h
|
||||
#define TC_UNSIGNED(N) N
|
||||
|
||||
TC_BOOT_MEMORY_REQUIRED = TC__BOOT_MEMORY_REQUIRED
|
||||
TC_BOOT_LOADER_SEGMENT = TC__BOOT_LOADER_SEGMENT
|
||||
TC_BOOT_LOADER_SEGMENT_LOW = TC__BOOT_LOADER_SEGMENT_LOW
|
||||
TC_COM_EXECUTABLE_OFFSET = TC__COM_EXECUTABLE_OFFSET
|
||||
TC_BOOT_LOADER_LOWMEM_SEGMENT = TC__BOOT_LOADER_LOWMEM_SEGMENT
|
||||
TC_BOOT_LOADER_BUFFER_SEGMENT = TC__BOOT_LOADER_BUFFER_SEGMENT
|
||||
TC_BOOT_LOADER_ALT_SEGMENT = TC__BOOT_LOADER_ALT_SEGMENT
|
||||
TC_BOOT_LOADER_STACK_TOP = TC__BOOT_LOADER_STACK_TOP
|
||||
TC_LB_SIZE = TC__LB_SIZE
|
||||
TC_BOOT_LOADER_AREA_SECTOR_COUNT = TC__BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET = TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
|
||||
TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET = TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
|
||||
TC_BOOT_SECTOR_CONFIG_OFFSET = TC__BOOT_SECTOR_CONFIG_OFFSET
|
||||
TC_BOOT_SECTOR_USER_CONFIG_OFFSET = TC__BOOT_SECTOR_USER_CONFIG_OFFSET
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR = TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT = TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE = TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE
|
||||
TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET = TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET
|
||||
TC_BOOT_LOADER_START_SECTOR = TC__BOOT_LOADER_START_SECTOR
|
||||
TC_MAX_BOOT_LOADER_SECTOR_COUNT = TC__MAX_BOOT_LOADER_SECTOR_COUNT
|
||||
TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE = TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
|
||||
TC_BOOT_LOADER_BACKUP_SECTOR_COUNT = TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
|
||||
TC_GZIP_HEADER_SIZE = TC__GZIP_HEADER_SIZE
|
||||
TC_BOOT_CFG_FLAG_AREA_SIZE = TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE = TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
|
||||
TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER = TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
|
||||
TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER = TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
|
||||
TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE = TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
|
||||
TC_BOOT_USER_CFG_FLAG_SILENT_MODE = TC__BOOT_USER_CFG_FLAG_SILENT_MODE
|
||||
TC_HIDDEN_OS_CREATION_PHASE_NONE = TC__HIDDEN_OS_CREATION_PHASE_NONE
|
||||
TC_HIDDEN_OS_CREATION_PHASE_CLONING = TC__HIDDEN_OS_CREATION_PHASE_CLONING
|
||||
TC_HIDDEN_OS_CREATION_PHASE_WIPING = TC__HIDDEN_OS_CREATION_PHASE_WIPING
|
||||
TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
|
||||
|
||||
#else // TC_ASM_PREPROCESS
|
||||
|
||||
#define TC_HEX(N) 0x##N
|
||||
#define TC_UNSIGNED(N) N##U
|
||||
|
||||
#define TC_BOOT_MEMORY_REQUIRED TC__BOOT_MEMORY_REQUIRED
|
||||
#define TC_BOOT_LOADER_SEGMENT TC__BOOT_LOADER_SEGMENT
|
||||
#define TC_COM_EXECUTABLE_OFFSET TC__COM_EXECUTABLE_OFFSET
|
||||
#define TC_BOOT_LOADER_LOWMEM_SEGMENT TC__BOOT_LOADER_LOWMEM_SEGMENT
|
||||
#define TC_BOOT_LOADER_BUFFER_SEGMENT TC__BOOT_LOADER_BUFFER_SEGMENT
|
||||
#define TC_BOOT_LOADER_ALT_SEGMENT TC__BOOT_LOADER_ALT_SEGMENT
|
||||
#define TC_BOOT_LOADER_STACK_TOP (TC__BOOT_LOADER_STACK_TOP)
|
||||
#define TC_BOOT_LOADER_AREA_SECTOR_COUNT TC__BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
#define TC_BOOT_SECTOR_USER_MESSAGE_OFFSET TC__BOOT_SECTOR_USER_MESSAGE_OFFSET
|
||||
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE
|
||||
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET
|
||||
#define TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH
|
||||
#define TC_BOOT_SECTOR_VERSION_OFFSET TC__BOOT_SECTOR_VERSION_OFFSET
|
||||
#define TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
|
||||
#define TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
|
||||
#define TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
|
||||
#define TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
|
||||
#define TC_BOOT_SECTOR_CONFIG_OFFSET TC__BOOT_SECTOR_CONFIG_OFFSET
|
||||
#define TC_BOOT_SECTOR_USER_CONFIG_OFFSET TC__BOOT_SECTOR_USER_CONFIG_OFFSET
|
||||
#define TC_BOOT_LOADER_START_SECTOR TC__BOOT_LOADER_START_SECTOR
|
||||
#define TC_LB_SIZE TC__LB_SIZE
|
||||
#define TC_MAX_BOOT_LOADER_SECTOR_COUNT TC__MAX_BOOT_LOADER_SECTOR_COUNT
|
||||
#define TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
|
||||
#define TC_BOOT_LOADER_BACKUP_SECTOR_COUNT TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
|
||||
#define TC_GZIP_HEADER_SIZE TC__GZIP_HEADER_SIZE
|
||||
#define TC_BOOT_CFG_FLAG_AREA_SIZE TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
#define TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
|
||||
#define TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
|
||||
#define TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
|
||||
#define TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION
|
||||
#define TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
|
||||
#define TC_BOOT_USER_CFG_FLAG_SILENT_MODE TC__BOOT_USER_CFG_FLAG_SILENT_MODE
|
||||
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC
|
||||
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_WIPED TC__HIDDEN_OS_CREATION_PHASE_WIPED
|
||||
|
||||
#endif // TC_ASM_PREPROCESS
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDefs
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDefs
|
||||
#define TC_HEADER_Boot_BootDefs
|
||||
|
||||
// Total memory required (CODE + DATA + BSS + STACK + 0x100) in KBytes - determined from linker map.
|
||||
#define TC__BOOT_MEMORY_REQUIRED 43
|
||||
|
||||
#ifdef TC_WINDOWS_BOOT_SINGLE_CIPHER_MODE
|
||||
# undef TC__BOOT_MEMORY_REQUIRED
|
||||
|
||||
# ifdef TC_WINDOWS_BOOT_AES
|
||||
# ifdef TC_WINDOWS_BOOT_RESCUE_DISK_MODE
|
||||
# define TC__BOOT_MEMORY_REQUIRED 31
|
||||
# else
|
||||
# define TC__BOOT_MEMORY_REQUIRED 29
|
||||
# endif
|
||||
# elif defined (TC_WINDOWS_BOOT_SERPENT)
|
||||
# define TC__BOOT_MEMORY_REQUIRED 33
|
||||
# elif defined (TC_WINDOWS_BOOT_TWOFISH)
|
||||
# define TC__BOOT_MEMORY_REQUIRED 41
|
||||
# elif defined (TC_WINDOWS_BOOT_CAMELLIA)
|
||||
# define TC__BOOT_MEMORY_REQUIRED 31
|
||||
# endif
|
||||
|
||||
#if 0
|
||||
# undef TC__BOOT_MEMORY_REQUIRED
|
||||
# define TC__BOOT_MEMORY_REQUIRED 60
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// Modifying this value can introduce incompatibility with previous versions
|
||||
#define TC__BOOT_LOADER_SEGMENT TC_HEX (9000) // Some buggy BIOS routines fail if CS bits 0-10 are not zero
|
||||
|
||||
#if TC__BOOT_MEMORY_REQUIRED <= 32
|
||||
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 32 * 1024 / 16)
|
||||
#else
|
||||
# define TC__BOOT_LOADER_SEGMENT_LOW (TC__BOOT_LOADER_SEGMENT - 64 * 1024 / 16)
|
||||
#endif
|
||||
|
||||
#define TC__COM_EXECUTABLE_OFFSET TC_HEX (100)
|
||||
|
||||
#define TC__BOOT_LOADER_LOWMEM_SEGMENT TC_HEX (2000)
|
||||
#define TC__BOOT_LOADER_BUFFER_SEGMENT TC_HEX (4000)
|
||||
#define TC__BOOT_LOADER_ALT_SEGMENT TC_HEX (6000)
|
||||
|
||||
#define TC__BOOT_LOADER_STACK_TOP (TC_BOOT_MEMORY_REQUIRED * TC_UNSIGNED (1024) - 4)
|
||||
|
||||
#define TC__LB_SIZE 512
|
||||
#define TC__BOOT_LOADER_AREA_SECTOR_COUNT 63
|
||||
|
||||
#define TC__BOOT_SECTOR_VERSION_OFFSET 430
|
||||
#define TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET 432
|
||||
#define TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET 434
|
||||
#define TC__BOOT_SECTOR_USER_CONFIG_OFFSET 438
|
||||
#define TC__BOOT_SECTOR_CONFIG_OFFSET 439 // The last byte that is reserved for the boot loader
|
||||
|
||||
#define TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH 24
|
||||
#define TC__BOOT_SECTOR_USER_MESSAGE_OFFSET (TC__BOOT_SECTOR_VERSION_OFFSET - TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH)
|
||||
|
||||
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE 4
|
||||
#define TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET (TC__BOOT_SECTOR_USER_MESSAGE_OFFSET - TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE)
|
||||
|
||||
#define TC__BOOT_SECTOR_PIM_VALUE_SIZE 2
|
||||
#define TC__BOOT_SECTOR_PIM_VALUE_OFFSET (TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET - TC__BOOT_SECTOR_PIM_VALUE_SIZE)
|
||||
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR 2
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT 4
|
||||
#define TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE 32768
|
||||
#define TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET (TC_COM_EXECUTABLE_OFFSET + 3072)
|
||||
|
||||
#define TC__BOOT_LOADER_START_SECTOR (TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR + TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT)
|
||||
#define TC__MAX_BOOT_LOADER_SECTOR_COUNT (TC_BOOT_LOADER_AREA_SECTOR_COUNT - TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT - 2)
|
||||
#define TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE ((TC_BOOT_LOADER_AREA_SECTOR_COUNT - 2) * TC_LB_SIZE)
|
||||
|
||||
#define TC__BOOT_LOADER_BACKUP_SECTOR_COUNT 30
|
||||
|
||||
#define TC__GZIP_HEADER_SIZE 10
|
||||
|
||||
#define TC__BOOT_CFG_FLAG_AREA_SIZE 1 // In bytes
|
||||
|
||||
// If you add more flags, revise TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
#define TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC_HEX (02)
|
||||
#define TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC_HEX (04)
|
||||
#define TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC_HEX (10)
|
||||
#define TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC_HEX (20)
|
||||
#define TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE (TC_HEX (40) + TC_HEX (80))
|
||||
|
||||
// Modifying the following values can introduce incompatibility with previous versions
|
||||
#define TC__BOOT_USER_CFG_FLAG_SILENT_MODE TC_HEX (01)
|
||||
#define TC__BOOT_USER_CFG_FLAG_DISABLE_ESC TC_HEX (02)
|
||||
#define TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC_HEX (04)
|
||||
#define TC__BOOT_USER_CFG_FLAG_DISABLE_PIM TC_HEX (08)
|
||||
#define TC__BOOT_USER_CFG_FLAG_STORE_HASH TC_HEX (10)
|
||||
|
||||
// The following items are treated as a 2-bit value (apply TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE to obtain the value)
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_NONE 0
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_CLONING TC_HEX (40) // The boot loader is to copy the content of the system partition to the hidden volume
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_WIPING TC_HEX (80) // The boot loader has successfully copied the content of the system partition to the hidden volume. The original OS is to be wiped now.
|
||||
#define TC__HIDDEN_OS_CREATION_PHASE_WIPED (TC_HEX (40) + TC_HEX (80)) // The original OS has been wiped. The user is required to install a new OS (decoy OS) on the system partition now.
|
||||
|
||||
|
||||
#ifdef TC_ASM_PREPROCESS
|
||||
|
||||
#define TC_HEX(N) 0##N##h
|
||||
#define TC_UNSIGNED(N) N
|
||||
|
||||
TC_BOOT_MEMORY_REQUIRED = TC__BOOT_MEMORY_REQUIRED
|
||||
TC_BOOT_LOADER_SEGMENT = TC__BOOT_LOADER_SEGMENT
|
||||
TC_BOOT_LOADER_SEGMENT_LOW = TC__BOOT_LOADER_SEGMENT_LOW
|
||||
TC_COM_EXECUTABLE_OFFSET = TC__COM_EXECUTABLE_OFFSET
|
||||
TC_BOOT_LOADER_LOWMEM_SEGMENT = TC__BOOT_LOADER_LOWMEM_SEGMENT
|
||||
TC_BOOT_LOADER_BUFFER_SEGMENT = TC__BOOT_LOADER_BUFFER_SEGMENT
|
||||
TC_BOOT_LOADER_ALT_SEGMENT = TC__BOOT_LOADER_ALT_SEGMENT
|
||||
TC_BOOT_LOADER_STACK_TOP = TC__BOOT_LOADER_STACK_TOP
|
||||
TC_LB_SIZE = TC__LB_SIZE
|
||||
TC_BOOT_LOADER_AREA_SECTOR_COUNT = TC__BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET = TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
|
||||
TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET = TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
|
||||
TC_BOOT_SECTOR_CONFIG_OFFSET = TC__BOOT_SECTOR_CONFIG_OFFSET
|
||||
TC_BOOT_SECTOR_USER_CONFIG_OFFSET = TC__BOOT_SECTOR_USER_CONFIG_OFFSET
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR = TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT = TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
|
||||
TC_BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE = TC__BOOT_LOADER_DECOMPRESSOR_MEMORY_SIZE
|
||||
TC_BOOT_LOADER_COMPRESSED_BUFFER_OFFSET = TC__BOOT_LOADER_COMPRESSED_BUFFER_OFFSET
|
||||
TC_BOOT_LOADER_START_SECTOR = TC__BOOT_LOADER_START_SECTOR
|
||||
TC_MAX_BOOT_LOADER_SECTOR_COUNT = TC__MAX_BOOT_LOADER_SECTOR_COUNT
|
||||
TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE = TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
|
||||
TC_BOOT_LOADER_BACKUP_SECTOR_COUNT = TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
|
||||
TC_GZIP_HEADER_SIZE = TC__GZIP_HEADER_SIZE
|
||||
TC_BOOT_CFG_FLAG_AREA_SIZE = TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE = TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
|
||||
TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER = TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
|
||||
TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER = TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
|
||||
TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE = TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
|
||||
TC_BOOT_USER_CFG_FLAG_SILENT_MODE = TC__BOOT_USER_CFG_FLAG_SILENT_MODE
|
||||
TC_HIDDEN_OS_CREATION_PHASE_NONE = TC__HIDDEN_OS_CREATION_PHASE_NONE
|
||||
TC_HIDDEN_OS_CREATION_PHASE_CLONING = TC__HIDDEN_OS_CREATION_PHASE_CLONING
|
||||
TC_HIDDEN_OS_CREATION_PHASE_WIPING = TC__HIDDEN_OS_CREATION_PHASE_WIPING
|
||||
TC_HIDDEN_OS_CREATION_PHASE_WIPED = TC__HIDDEN_OS_CREATION_PHASE_WIPED
|
||||
|
||||
#else // TC_ASM_PREPROCESS
|
||||
|
||||
#define TC_HEX(N) 0x##N
|
||||
#define TC_UNSIGNED(N) N##U
|
||||
|
||||
#define TC_BOOT_MEMORY_REQUIRED TC__BOOT_MEMORY_REQUIRED
|
||||
#define TC_BOOT_LOADER_SEGMENT TC__BOOT_LOADER_SEGMENT
|
||||
#define TC_COM_EXECUTABLE_OFFSET TC__COM_EXECUTABLE_OFFSET
|
||||
#define TC_BOOT_LOADER_LOWMEM_SEGMENT TC__BOOT_LOADER_LOWMEM_SEGMENT
|
||||
#define TC_BOOT_LOADER_BUFFER_SEGMENT TC__BOOT_LOADER_BUFFER_SEGMENT
|
||||
#define TC_BOOT_LOADER_ALT_SEGMENT TC__BOOT_LOADER_ALT_SEGMENT
|
||||
#define TC_BOOT_LOADER_STACK_TOP (TC__BOOT_LOADER_STACK_TOP)
|
||||
#define TC_BOOT_LOADER_AREA_SECTOR_COUNT TC__BOOT_LOADER_AREA_SECTOR_COUNT
|
||||
#define TC_BOOT_SECTOR_USER_MESSAGE_OFFSET TC__BOOT_SECTOR_USER_MESSAGE_OFFSET
|
||||
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_SIZE
|
||||
#define TC_BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET TC__BOOT_SECTOR_OUTER_VOLUME_BAK_HEADER_CRC_OFFSET
|
||||
#define TC_BOOT_SECTOR_PIM_VALUE_SIZE TC__BOOT_SECTOR_PIM_VALUE_SIZE
|
||||
#define TC_BOOT_SECTOR_PIM_VALUE_OFFSET TC__BOOT_SECTOR_PIM_VALUE_OFFSET
|
||||
#define TC_BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH TC__BOOT_SECTOR_USER_MESSAGE_MAX_LENGTH
|
||||
#define TC_BOOT_SECTOR_VERSION_OFFSET TC__BOOT_SECTOR_VERSION_OFFSET
|
||||
#define TC_BOOT_SECTOR_LOADER_LENGTH_OFFSET TC__BOOT_SECTOR_LOADER_LENGTH_OFFSET
|
||||
#define TC_BOOT_SECTOR_LOADER_CHECKSUM_OFFSET TC__BOOT_SECTOR_LOADER_CHECKSUM_OFFSET
|
||||
#define TC_BOOT_LOADER_DECOMPRESSOR_START_SECTOR TC__BOOT_LOADER_DECOMPRESSOR_START_SECTOR
|
||||
#define TC_BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT TC__BOOT_LOADER_DECOMPRESSOR_SECTOR_COUNT
|
||||
#define TC_BOOT_SECTOR_CONFIG_OFFSET TC__BOOT_SECTOR_CONFIG_OFFSET
|
||||
#define TC_BOOT_SECTOR_USER_CONFIG_OFFSET TC__BOOT_SECTOR_USER_CONFIG_OFFSET
|
||||
#define TC_BOOT_LOADER_START_SECTOR TC__BOOT_LOADER_START_SECTOR
|
||||
#define TC_LB_SIZE TC__LB_SIZE
|
||||
#define TC_MAX_BOOT_LOADER_SECTOR_COUNT TC__MAX_BOOT_LOADER_SECTOR_COUNT
|
||||
#define TC_MAX_BOOT_LOADER_DECOMPRESSED_SIZE TC__MAX_BOOT_LOADER_DECOMPRESSED_SIZE
|
||||
#define TC_BOOT_LOADER_BACKUP_SECTOR_COUNT TC__BOOT_LOADER_BACKUP_SECTOR_COUNT
|
||||
#define TC_GZIP_HEADER_SIZE TC__GZIP_HEADER_SIZE
|
||||
#define TC_BOOT_CFG_FLAG_AREA_SIZE TC__BOOT_CFG_FLAG_AREA_SIZE
|
||||
#define TC_BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE TC__BOOT_CFG_FLAG_BACKUP_LOADER_AVAILABLE
|
||||
#define TC_BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER TC__BOOT_CFG_FLAG_WINDOWS_VISTA_OR_LATER
|
||||
#define TC_BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER TC__BOOT_CFG_FLAG_RESCUE_DISK_ORIG_SYS_LOADER
|
||||
#define TC_BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION TC__BOOT_CFG_FLAG_RESCUE_DISABLE_HW_ENCRYPTION
|
||||
#define TC_BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE TC__BOOT_CFG_MASK_HIDDEN_OS_CREATION_PHASE
|
||||
#define TC_BOOT_USER_CFG_FLAG_SILENT_MODE TC__BOOT_USER_CFG_FLAG_SILENT_MODE
|
||||
#define TC_BOOT_USER_CFG_FLAG_DISABLE_ESC TC__BOOT_USER_CFG_FLAG_DISABLE_ESC
|
||||
#define TC_BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION TC__BOOT_USER_CFG_FLAG_DISABLE_HW_ENCRYPTION
|
||||
#define TC_BOOT_USER_CFG_FLAG_DISABLE_PIM TC__BOOT_USER_CFG_FLAG_DISABLE_PIM
|
||||
#define TC_BOOT_USER_CFG_FLAG_STORE_HASH TC__BOOT_USER_CFG_FLAG_STORE_HASH
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_NONE TC__HIDDEN_OS_CREATION_PHASE_NONE
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_CLONING TC__HIDDEN_OS_CREATION_PHASE_CLONING
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_WIPING TC__HIDDEN_OS_CREATION_PHASE_WIPING
|
||||
#define TC_HIDDEN_OS_CREATION_PHASE_WIPED TC__HIDDEN_OS_CREATION_PHASE_WIPED
|
||||
|
||||
#endif // TC_ASM_PREPROCESS
|
||||
|
||||
#define EFI_BOOTARGS_REGIONS_LOW 0x90000, 0x88000, 0x80000
|
||||
#define EFI_BOOTARGS_REGIONS_HIGH \
|
||||
0x100000, 0x200000, 0x300000, 0x400000, 0x500000, 0x600000, 0x700000, 0x800000, \
|
||||
0x900000, 0xA00000, 0xB00000, 0xC00000, 0xD00000, 0xE00000, 0xF00000, 0x1000000
|
||||
|
||||
#define EFI_BOOTARGS_REGIONS EFI_BOOTARGS_REGIONS_LOW, EFI_BOOTARGS_REGIONS_HIGH
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDefs
|
||||
|
||||
+491
-487
@@ -1,487 +1,491 @@
|
||||
/*
|
||||
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootConfig.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootStrings.h"
|
||||
|
||||
|
||||
byte SectorBuffer[TC_LB_SIZE];
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
static bool SectorBufferInUse = false;
|
||||
|
||||
void AcquireSectorBuffer ()
|
||||
{
|
||||
if (SectorBufferInUse)
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
|
||||
SectorBufferInUse = true;
|
||||
}
|
||||
|
||||
|
||||
void ReleaseSectorBuffer ()
|
||||
{
|
||||
SectorBufferInUse = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
bool IsLbaSupported (byte drive)
|
||||
{
|
||||
static byte CachedDrive = TC_INVALID_BIOS_DRIVE;
|
||||
static bool CachedStatus;
|
||||
uint16 result = 0;
|
||||
|
||||
if (CachedDrive == drive)
|
||||
goto ret;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 0x55aa
|
||||
mov dl, drive
|
||||
mov ah, 0x41
|
||||
int 0x13
|
||||
jc err
|
||||
mov result, bx
|
||||
err:
|
||||
}
|
||||
|
||||
CachedDrive = drive;
|
||||
CachedStatus = (result == 0xaa55);
|
||||
ret:
|
||||
return CachedStatus;
|
||||
}
|
||||
|
||||
|
||||
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs)
|
||||
{
|
||||
PrintEndl();
|
||||
Print (write ? "Write" : "Read"); Print (" error:");
|
||||
Print (error);
|
||||
Print (" Drive:");
|
||||
Print (drive ^ 0x80);
|
||||
|
||||
if (sector)
|
||||
{
|
||||
Print (" Sector:");
|
||||
Print (*sector);
|
||||
}
|
||||
|
||||
if (chs)
|
||||
{
|
||||
Print (" CHS:");
|
||||
Print (*chs);
|
||||
}
|
||||
|
||||
PrintEndl();
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
void Print (const ChsAddress &chs)
|
||||
{
|
||||
Print (chs.Cylinder);
|
||||
PrintChar ('/');
|
||||
Print (chs.Head);
|
||||
PrintChar ('/');
|
||||
Print (chs.Sector);
|
||||
}
|
||||
|
||||
|
||||
void PrintSectorCountInMB (const uint64 §orCount)
|
||||
{
|
||||
Print (sectorCount >> (TC_LB_SIZE_BIT_SHIFT_DIVISOR + 2)); Print (" MB ");
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
byte cylinderLow = (byte) chs.Cylinder;
|
||||
byte sector = chs.Sector;
|
||||
sector |= byte (chs.Cylinder >> 2) & 0xc0;
|
||||
byte function = write ? 0x03 : 0x02;
|
||||
|
||||
BiosResult result;
|
||||
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
|
||||
|
||||
do
|
||||
{
|
||||
result = BiosResultSuccess;
|
||||
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov ax, bufferSegment
|
||||
mov es, ax
|
||||
mov bx, bufferOffset
|
||||
mov dl, drive
|
||||
mov ch, cylinderLow
|
||||
mov si, chs
|
||||
mov dh, [si].Head
|
||||
mov cl, sector
|
||||
mov al, sectorCount
|
||||
mov ah, function
|
||||
int 0x13
|
||||
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
|
||||
mov result, ah
|
||||
ok:
|
||||
pop es
|
||||
}
|
||||
|
||||
if (result == BiosResultEccCorrected)
|
||||
result = BiosResultSuccess;
|
||||
|
||||
// Some BIOSes report I/O errors prematurely in some cases
|
||||
} while (result != BiosResultSuccess && --tryCount != 0);
|
||||
|
||||
if (!silent && result != BiosResultSuccess)
|
||||
PrintDiskError (result, write, drive, nullptr, &chs);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
uint16 codeSeg;
|
||||
__asm mov codeSeg, cs
|
||||
return ReadWriteSectors (write, codeSeg, (uint16) buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (false, buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (true, buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
if (!IsLbaSupported (drive))
|
||||
{
|
||||
DriveGeometry geometry;
|
||||
|
||||
BiosResult result = GetDriveGeometry (drive, geometry, silent);
|
||||
if (result != BiosResultSuccess)
|
||||
return result;
|
||||
|
||||
ChsAddress chs;
|
||||
LbaToChs (geometry, sector, chs);
|
||||
return ReadWriteSectors (write, (uint16) (dapPacket.Buffer >> 16), (uint16) dapPacket.Buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
dapPacket.Size = sizeof (dapPacket);
|
||||
dapPacket.Reserved = 0;
|
||||
dapPacket.SectorCount = sectorCount;
|
||||
dapPacket.Sector = sector;
|
||||
|
||||
byte function = write ? 0x43 : 0x42;
|
||||
|
||||
BiosResult result;
|
||||
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
|
||||
|
||||
do
|
||||
{
|
||||
result = BiosResultSuccess;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 0x55aa
|
||||
mov dl, drive
|
||||
mov si, [dapPacket]
|
||||
mov ah, function
|
||||
xor al, al
|
||||
int 0x13
|
||||
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
|
||||
mov result, ah
|
||||
ok:
|
||||
}
|
||||
|
||||
if (result == BiosResultEccCorrected)
|
||||
result = BiosResultSuccess;
|
||||
|
||||
// Some BIOSes report I/O errors prematurely in some cases
|
||||
} while (result != BiosResultSuccess && --tryCount != 0);
|
||||
|
||||
if (!silent && result != BiosResultSuccess)
|
||||
PrintDiskError (result, write, drive, §or);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosLbaPacket dapPacket;
|
||||
dapPacket.Buffer = (uint32) buffer;
|
||||
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosLbaPacket dapPacket;
|
||||
dapPacket.Buffer = ((uint32) bufferSegment << 16) | bufferOffset;
|
||||
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (false, bufferSegment, bufferOffset, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosResult result;
|
||||
uint16 codeSeg;
|
||||
__asm mov codeSeg, cs
|
||||
|
||||
result = ReadSectors (BootStarted ? codeSeg : TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, drive, sector, sectorCount, silent);
|
||||
|
||||
// Alternative segment is used to prevent memory corruption caused by buggy BIOSes
|
||||
if (!BootStarted)
|
||||
CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, buffer, sectorCount * TC_LB_SIZE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (true, buffer, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
byte maxCylinderLow, maxHead, maxSector;
|
||||
BiosResult result;
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov dl, drive
|
||||
mov ah, 0x08
|
||||
int 0x13
|
||||
|
||||
mov result, ah
|
||||
mov maxCylinderLow, ch
|
||||
mov maxSector, cl
|
||||
mov maxHead, dh
|
||||
pop es
|
||||
}
|
||||
|
||||
if (result == BiosResultSuccess)
|
||||
{
|
||||
geometry.Cylinders = (maxCylinderLow | (uint16 (maxSector & 0xc0) << 2)) + 1;
|
||||
geometry.Heads = maxHead + 1;
|
||||
geometry.Sectors = maxSector & ~0xc0;
|
||||
}
|
||||
else if (!silent)
|
||||
{
|
||||
Print ("Drive ");
|
||||
Print (drive ^ 0x80);
|
||||
Print (" not found: ");
|
||||
PrintErrorNoEndl ("");
|
||||
Print (result);
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba)
|
||||
{
|
||||
lba.HighPart = 0;
|
||||
lba.LowPart = (uint32 (chs.Cylinder) * geometry.Heads + chs.Head) * geometry.Sectors + chs.Sector - 1;
|
||||
}
|
||||
|
||||
|
||||
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs)
|
||||
{
|
||||
chs.Sector = (byte) ((lba.LowPart % geometry.Sectors) + 1);
|
||||
uint32 ch = lba.LowPart / geometry.Sectors;
|
||||
chs.Head = (byte) (ch % geometry.Heads);
|
||||
chs.Cylinder = (uint16) (ch / geometry.Heads);
|
||||
}
|
||||
|
||||
|
||||
void PartitionEntryMBRToPartition (const PartitionEntryMBR &partEntry, Partition &partition)
|
||||
{
|
||||
partition.Active = partEntry.BootIndicator == 0x80;
|
||||
partition.EndSector.HighPart = 0;
|
||||
partition.EndSector.LowPart = partEntry.StartLBA + partEntry.SectorCountLBA - 1;
|
||||
partition.SectorCount.HighPart = 0;
|
||||
partition.SectorCount.LowPart = partEntry.SectorCountLBA;
|
||||
partition.StartSector.HighPart = 0;
|
||||
partition.StartSector.LowPart = partEntry.StartLBA;
|
||||
partition.Type = partEntry.Type;
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteMBR (bool write, byte drive, bool silent)
|
||||
{
|
||||
uint64 mbrSector;
|
||||
mbrSector.HighPart = 0;
|
||||
mbrSector.LowPart = 0;
|
||||
|
||||
if (write)
|
||||
return WriteSectors (SectorBuffer, drive, mbrSector, 1, silent);
|
||||
|
||||
return ReadSectors (SectorBuffer, drive, mbrSector, 1, silent); // Uses alternative segment
|
||||
}
|
||||
|
||||
|
||||
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent)
|
||||
{
|
||||
Partition *followingPartition;
|
||||
Partition tmpPartition;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
assert (partitionArrayCapacity == 1);
|
||||
partitionArrayCapacity = 0xff;
|
||||
followingPartition = partitionArray;
|
||||
partitionArray = &tmpPartition;
|
||||
|
||||
followingPartition->Drive = TC_INVALID_BIOS_DRIVE;
|
||||
followingPartition->StartSector.LowPart = 0xFFFFffffUL;
|
||||
}
|
||||
|
||||
AcquireSectorBuffer();
|
||||
BiosResult result = ReadWriteMBR (false, drive, silent);
|
||||
ReleaseSectorBuffer();
|
||||
|
||||
partitionCount = 0;
|
||||
|
||||
MBR *mbr = (MBR *) SectorBuffer;
|
||||
if (result != BiosResultSuccess || mbr->Signature != 0xaa55)
|
||||
return result;
|
||||
|
||||
PartitionEntryMBR mbrPartitions[4];
|
||||
memcpy (mbrPartitions, mbr->Partitions, sizeof (mbrPartitions));
|
||||
size_t partitionArrayPos = 0, partitionNumber;
|
||||
|
||||
for (partitionNumber = 0;
|
||||
partitionNumber < array_capacity (mbrPartitions) && partitionArrayPos < partitionArrayCapacity;
|
||||
++partitionNumber)
|
||||
{
|
||||
const PartitionEntryMBR &partEntry = mbrPartitions[partitionNumber];
|
||||
|
||||
if (partEntry.SectorCountLBA > 0)
|
||||
{
|
||||
Partition &partition = partitionArray[partitionArrayPos];
|
||||
PartitionEntryMBRToPartition (partEntry, partition);
|
||||
|
||||
if (activeOnly && !partition.Active)
|
||||
continue;
|
||||
|
||||
partition.Drive = drive;
|
||||
partition.Number = partitionArrayPos;
|
||||
|
||||
if (partEntry.Type == 0x5 || partEntry.Type == 0xf) // Extended partition
|
||||
{
|
||||
if (IsLbaSupported (drive))
|
||||
{
|
||||
// Find all extended partitions
|
||||
uint64 firstExtStartLBA = partition.StartSector;
|
||||
uint64 extStartLBA = partition.StartSector;
|
||||
MBR *extMbr = (MBR *) SectorBuffer;
|
||||
|
||||
while (partitionArrayPos < partitionArrayCapacity &&
|
||||
(result = ReadSectors ((byte *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess
|
||||
&& extMbr->Signature == 0xaa55)
|
||||
{
|
||||
if (extMbr->Partitions[0].SectorCountLBA > 0)
|
||||
{
|
||||
Partition &logPart = partitionArray[partitionArrayPos];
|
||||
PartitionEntryMBRToPartition (extMbr->Partitions[0], logPart);
|
||||
logPart.Drive = drive;
|
||||
|
||||
logPart.Number = partitionArrayPos;
|
||||
logPart.Primary = false;
|
||||
|
||||
logPart.StartSector.LowPart += extStartLBA.LowPart;
|
||||
logPart.EndSector.LowPart += extStartLBA.LowPart;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
if (logPart.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
|
||||
&& logPart.StartSector.LowPart < followingPartition->StartSector.LowPart)
|
||||
{
|
||||
*followingPartition = logPart;
|
||||
}
|
||||
}
|
||||
else
|
||||
++partitionArrayPos;
|
||||
}
|
||||
|
||||
// Secondary extended
|
||||
if (extMbr->Partitions[1].Type != 0x5 && extMbr->Partitions[1].Type == 0xf
|
||||
|| extMbr->Partitions[1].SectorCountLBA == 0)
|
||||
break;
|
||||
|
||||
extStartLBA.LowPart = extMbr->Partitions[1].StartLBA + firstExtStartLBA.LowPart;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
partition.Primary = true;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
if (partition.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
|
||||
&& partition.StartSector.LowPart < followingPartition->StartSector.LowPart)
|
||||
{
|
||||
*followingPartition = partition;
|
||||
}
|
||||
}
|
||||
else
|
||||
++partitionArrayPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
partitionCount = partitionArrayPos;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool GetActivePartition (byte drive)
|
||||
{
|
||||
size_t partCount;
|
||||
|
||||
if (GetDrivePartitions (drive, &ActivePartition, 1, partCount, true) != BiosResultSuccess || partCount < 1)
|
||||
{
|
||||
ActivePartition.Drive = TC_INVALID_BIOS_DRIVE;
|
||||
PrintError (TC_BOOT_STR_NO_BOOT_PARTITION);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Bios.h"
|
||||
#include "BootConsoleIo.h"
|
||||
#include "BootConfig.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootStrings.h"
|
||||
|
||||
|
||||
byte SectorBuffer[TC_LB_SIZE];
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
static bool SectorBufferInUse = false;
|
||||
|
||||
void AcquireSectorBuffer ()
|
||||
{
|
||||
if (SectorBufferInUse)
|
||||
TC_THROW_FATAL_EXCEPTION;
|
||||
|
||||
SectorBufferInUse = true;
|
||||
}
|
||||
|
||||
|
||||
void ReleaseSectorBuffer ()
|
||||
{
|
||||
SectorBufferInUse = false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
bool IsLbaSupported (byte drive)
|
||||
{
|
||||
static byte CachedDrive = TC_INVALID_BIOS_DRIVE;
|
||||
static bool CachedStatus;
|
||||
uint16 result = 0;
|
||||
|
||||
if (CachedDrive == drive)
|
||||
goto ret;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 0x55aa
|
||||
mov dl, drive
|
||||
mov ah, 0x41
|
||||
int 0x13
|
||||
jc err
|
||||
mov result, bx
|
||||
err:
|
||||
}
|
||||
|
||||
CachedDrive = drive;
|
||||
CachedStatus = (result == 0xaa55);
|
||||
ret:
|
||||
return CachedStatus;
|
||||
}
|
||||
|
||||
|
||||
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs)
|
||||
{
|
||||
PrintEndl();
|
||||
Print (write ? "Write" : "Read"); Print (" error:");
|
||||
Print (error);
|
||||
Print (" Drive:");
|
||||
Print (drive ^ 0x80);
|
||||
|
||||
if (sector)
|
||||
{
|
||||
Print (" Sector:");
|
||||
Print (*sector);
|
||||
}
|
||||
|
||||
if (chs)
|
||||
{
|
||||
Print (" CHS:");
|
||||
Print (*chs);
|
||||
}
|
||||
|
||||
PrintEndl();
|
||||
Beep();
|
||||
}
|
||||
|
||||
|
||||
void Print (const ChsAddress &chs)
|
||||
{
|
||||
Print (chs.Cylinder);
|
||||
PrintChar ('/');
|
||||
Print (chs.Head);
|
||||
PrintChar ('/');
|
||||
Print (chs.Sector);
|
||||
}
|
||||
|
||||
|
||||
void PrintSectorCountInMB (const uint64 §orCount)
|
||||
{
|
||||
Print (sectorCount >> (TC_LB_SIZE_BIT_SHIFT_DIVISOR + 2)); Print (" MB ");
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
byte cylinderLow = (byte) chs.Cylinder;
|
||||
byte sector = chs.Sector;
|
||||
sector |= byte (chs.Cylinder >> 2) & 0xc0;
|
||||
byte function = write ? 0x03 : 0x02;
|
||||
|
||||
BiosResult result;
|
||||
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
|
||||
|
||||
do
|
||||
{
|
||||
result = BiosResultSuccess;
|
||||
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov ax, bufferSegment
|
||||
mov es, ax
|
||||
mov bx, bufferOffset
|
||||
mov dl, drive
|
||||
mov ch, cylinderLow
|
||||
mov si, chs
|
||||
mov dh, [si].Head
|
||||
mov cl, sector
|
||||
mov al, sectorCount
|
||||
mov ah, function
|
||||
int 0x13
|
||||
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
|
||||
mov result, ah
|
||||
ok:
|
||||
pop es
|
||||
}
|
||||
|
||||
if (result == BiosResultEccCorrected)
|
||||
result = BiosResultSuccess;
|
||||
|
||||
// Some BIOSes report I/O errors prematurely in some cases
|
||||
} while (result != BiosResultSuccess && --tryCount != 0);
|
||||
|
||||
if (!silent && result != BiosResultSuccess)
|
||||
PrintDiskError (result, write, drive, nullptr, &chs);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
uint16 codeSeg;
|
||||
__asm mov codeSeg, cs
|
||||
return ReadWriteSectors (write, codeSeg, (uint16) buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (false, buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (true, buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
static BiosResult ReadWriteSectors (bool write, BiosLbaPacket &dapPacket, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
if (!IsLbaSupported (drive))
|
||||
{
|
||||
DriveGeometry geometry;
|
||||
|
||||
BiosResult result = GetDriveGeometry (drive, geometry, silent);
|
||||
if (result != BiosResultSuccess)
|
||||
return result;
|
||||
|
||||
ChsAddress chs;
|
||||
LbaToChs (geometry, sector, chs);
|
||||
return ReadWriteSectors (write, (uint16) (dapPacket.Buffer >> 16), (uint16) dapPacket.Buffer, drive, chs, sectorCount, silent);
|
||||
}
|
||||
|
||||
dapPacket.Size = sizeof (dapPacket);
|
||||
dapPacket.Reserved = 0;
|
||||
dapPacket.SectorCount = sectorCount;
|
||||
dapPacket.Sector = sector;
|
||||
|
||||
byte function = write ? 0x43 : 0x42;
|
||||
|
||||
BiosResult result;
|
||||
byte tryCount = TC_MAX_BIOS_DISK_IO_RETRIES;
|
||||
|
||||
do
|
||||
{
|
||||
result = BiosResultSuccess;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov bx, 0x55aa
|
||||
mov dl, drive
|
||||
mov si, [dapPacket]
|
||||
mov ah, function
|
||||
xor al, al
|
||||
int 0x13
|
||||
jnc ok // If CF=0, ignore AH to prevent issues caused by potential bugs in BIOSes
|
||||
mov result, ah
|
||||
ok:
|
||||
}
|
||||
|
||||
if (result == BiosResultEccCorrected)
|
||||
result = BiosResultSuccess;
|
||||
|
||||
// Some BIOSes report I/O errors prematurely in some cases
|
||||
} while (result != BiosResultSuccess && --tryCount != 0);
|
||||
|
||||
if (!silent && result != BiosResultSuccess)
|
||||
PrintDiskError (result, write, drive, §or);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static BiosResult ReadWriteSectors (bool write, byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosLbaPacket dapPacket;
|
||||
dapPacket.Buffer = (uint32) buffer;
|
||||
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosLbaPacket dapPacket;
|
||||
dapPacket.Buffer = ((uint32) bufferSegment << 16) | bufferOffset;
|
||||
return ReadWriteSectors (write, dapPacket, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (false, bufferSegment, bufferOffset, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
BiosResult result;
|
||||
uint16 codeSeg;
|
||||
__asm mov codeSeg, cs
|
||||
|
||||
result = ReadSectors (BootStarted ? codeSeg : TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, drive, sector, sectorCount, silent);
|
||||
|
||||
// Alternative segment is used to prevent memory corruption caused by buggy BIOSes
|
||||
if (!BootStarted)
|
||||
CopyMemory (TC_BOOT_LOADER_ALT_SEGMENT, (uint16) buffer, buffer, sectorCount * TC_LB_SIZE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent)
|
||||
{
|
||||
return ReadWriteSectors (true, buffer, drive, sector, sectorCount, silent);
|
||||
}
|
||||
|
||||
|
||||
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent)
|
||||
{
|
||||
CheckStack();
|
||||
|
||||
byte maxCylinderLow, maxHead, maxSector;
|
||||
BiosResult result;
|
||||
__asm
|
||||
{
|
||||
push es
|
||||
mov dl, drive
|
||||
mov ah, 0x08
|
||||
int 0x13
|
||||
|
||||
mov result, ah
|
||||
mov maxCylinderLow, ch
|
||||
mov maxSector, cl
|
||||
mov maxHead, dh
|
||||
pop es
|
||||
}
|
||||
|
||||
if (result == BiosResultSuccess)
|
||||
{
|
||||
geometry.Cylinders = (maxCylinderLow | (uint16 (maxSector & 0xc0) << 2)) + 1;
|
||||
geometry.Heads = maxHead + 1;
|
||||
geometry.Sectors = maxSector & ~0xc0;
|
||||
}
|
||||
else if (!silent)
|
||||
{
|
||||
Print ("Drive ");
|
||||
Print (drive ^ 0x80);
|
||||
Print (" not found: ");
|
||||
PrintErrorNoEndl ("");
|
||||
Print (result);
|
||||
PrintEndl();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba)
|
||||
{
|
||||
lba.HighPart = 0;
|
||||
lba.LowPart = (uint32 (chs.Cylinder) * geometry.Heads + chs.Head) * geometry.Sectors + chs.Sector - 1;
|
||||
}
|
||||
|
||||
|
||||
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs)
|
||||
{
|
||||
chs.Sector = (byte) ((lba.LowPart % geometry.Sectors) + 1);
|
||||
uint32 ch = lba.LowPart / geometry.Sectors;
|
||||
chs.Head = (byte) (ch % geometry.Heads);
|
||||
chs.Cylinder = (uint16) (ch / geometry.Heads);
|
||||
}
|
||||
|
||||
|
||||
void PartitionEntryMBRToPartition (const PartitionEntryMBR &partEntry, Partition &partition)
|
||||
{
|
||||
partition.Active = partEntry.BootIndicator == 0x80;
|
||||
partition.EndSector.HighPart = 0;
|
||||
partition.EndSector.LowPart = partEntry.StartLBA + partEntry.SectorCountLBA - 1;
|
||||
partition.SectorCount.HighPart = 0;
|
||||
partition.SectorCount.LowPart = partEntry.SectorCountLBA;
|
||||
partition.StartSector.HighPart = 0;
|
||||
partition.StartSector.LowPart = partEntry.StartLBA;
|
||||
partition.Type = partEntry.Type;
|
||||
}
|
||||
|
||||
|
||||
BiosResult ReadWriteMBR (bool write, byte drive, bool silent)
|
||||
{
|
||||
uint64 mbrSector;
|
||||
mbrSector.HighPart = 0;
|
||||
mbrSector.LowPart = 0;
|
||||
|
||||
if (write)
|
||||
return WriteSectors (SectorBuffer, drive, mbrSector, 1, silent);
|
||||
|
||||
return ReadSectors (SectorBuffer, drive, mbrSector, 1, silent); // Uses alternative segment
|
||||
}
|
||||
|
||||
|
||||
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly, Partition *findPartitionFollowingThis, bool silent)
|
||||
{
|
||||
Partition *followingPartition;
|
||||
Partition tmpPartition;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
assert (partitionArrayCapacity == 1);
|
||||
partitionArrayCapacity = 0xff;
|
||||
followingPartition = partitionArray;
|
||||
partitionArray = &tmpPartition;
|
||||
|
||||
followingPartition->Drive = TC_INVALID_BIOS_DRIVE;
|
||||
followingPartition->StartSector.LowPart = 0xFFFFffffUL;
|
||||
}
|
||||
|
||||
AcquireSectorBuffer();
|
||||
BiosResult result = ReadWriteMBR (false, drive, silent);
|
||||
ReleaseSectorBuffer();
|
||||
|
||||
partitionCount = 0;
|
||||
|
||||
MBR *mbr = (MBR *) SectorBuffer;
|
||||
if (result != BiosResultSuccess || mbr->Signature != 0xaa55)
|
||||
return result;
|
||||
|
||||
PartitionEntryMBR mbrPartitions[4];
|
||||
memcpy (mbrPartitions, mbr->Partitions, sizeof (mbrPartitions));
|
||||
size_t partitionArrayPos = 0, partitionNumber;
|
||||
|
||||
for (partitionNumber = 0;
|
||||
partitionNumber < array_capacity (mbrPartitions) && partitionArrayPos < partitionArrayCapacity;
|
||||
++partitionNumber)
|
||||
{
|
||||
const PartitionEntryMBR &partEntry = mbrPartitions[partitionNumber];
|
||||
|
||||
if (partEntry.SectorCountLBA > 0)
|
||||
{
|
||||
Partition &partition = partitionArray[partitionArrayPos];
|
||||
PartitionEntryMBRToPartition (partEntry, partition);
|
||||
|
||||
if (activeOnly && !partition.Active)
|
||||
continue;
|
||||
|
||||
partition.Drive = drive;
|
||||
partition.Number = partitionArrayPos;
|
||||
|
||||
if (partEntry.Type == 0x5 || partEntry.Type == 0xf) // Extended partition
|
||||
{
|
||||
if (IsLbaSupported (drive))
|
||||
{
|
||||
// Find all extended partitions
|
||||
uint64 firstExtStartLBA = partition.StartSector;
|
||||
uint64 extStartLBA = partition.StartSector;
|
||||
MBR *extMbr = (MBR *) SectorBuffer;
|
||||
|
||||
while (partitionArrayPos < partitionArrayCapacity &&
|
||||
(result = ReadSectors ((byte *) extMbr, drive, extStartLBA, 1, silent)) == BiosResultSuccess
|
||||
&& extMbr->Signature == 0xaa55)
|
||||
{
|
||||
if (extMbr->Partitions[0].SectorCountLBA > 0)
|
||||
{
|
||||
Partition &logPart = partitionArray[partitionArrayPos];
|
||||
PartitionEntryMBRToPartition (extMbr->Partitions[0], logPart);
|
||||
logPart.Drive = drive;
|
||||
|
||||
logPart.Number = partitionArrayPos;
|
||||
logPart.Primary = false;
|
||||
|
||||
logPart.StartSector.LowPart += extStartLBA.LowPart;
|
||||
logPart.EndSector.LowPart += extStartLBA.LowPart;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
if (logPart.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
|
||||
&& logPart.StartSector.LowPart < followingPartition->StartSector.LowPart)
|
||||
{
|
||||
*followingPartition = logPart;
|
||||
}
|
||||
}
|
||||
else
|
||||
++partitionArrayPos;
|
||||
}
|
||||
|
||||
// Secondary extended
|
||||
if (extMbr->Partitions[1].Type != 0x5 && extMbr->Partitions[1].Type == 0xf
|
||||
|| extMbr->Partitions[1].SectorCountLBA == 0)
|
||||
break;
|
||||
|
||||
extStartLBA.LowPart = extMbr->Partitions[1].StartLBA + firstExtStartLBA.LowPart;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
partition.Primary = true;
|
||||
|
||||
if (findPartitionFollowingThis)
|
||||
{
|
||||
if (partition.StartSector.LowPart > findPartitionFollowingThis->EndSector.LowPart
|
||||
&& partition.StartSector.LowPart < followingPartition->StartSector.LowPart)
|
||||
{
|
||||
*followingPartition = partition;
|
||||
}
|
||||
}
|
||||
else
|
||||
++partitionArrayPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
partitionCount = partitionArrayPos;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
bool GetActivePartition (byte drive)
|
||||
{
|
||||
size_t partCount;
|
||||
|
||||
if (GetDrivePartitions (drive, &ActivePartition, 1, partCount, true) != BiosResultSuccess || partCount < 1)
|
||||
{
|
||||
ActivePartition.Drive = TC_INVALID_BIOS_DRIVE;
|
||||
PrintError (TC_BOOT_STR_NO_BOOT_PARTITION);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+120
-116
@@ -1,116 +1,120 @@
|
||||
/*
|
||||
Copyright (c) 2008-2011 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDiskIo
|
||||
#define TC_HEADER_Boot_BootDiskIo
|
||||
|
||||
#include "Bios.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
|
||||
#define TC_MAX_BIOS_DISK_IO_RETRIES 5
|
||||
|
||||
enum
|
||||
{
|
||||
BiosResultEccCorrected = 0x11
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct PartitionEntryMBR
|
||||
{
|
||||
byte BootIndicator;
|
||||
|
||||
byte StartHead;
|
||||
byte StartCylSector;
|
||||
byte StartCylinder;
|
||||
|
||||
byte Type;
|
||||
|
||||
byte EndHead;
|
||||
byte EndSector;
|
||||
byte EndCylinder;
|
||||
|
||||
uint32 StartLBA;
|
||||
uint32 SectorCountLBA;
|
||||
};
|
||||
|
||||
struct MBR
|
||||
{
|
||||
byte Code[446];
|
||||
PartitionEntryMBR Partitions[4];
|
||||
uint16 Signature;
|
||||
};
|
||||
|
||||
struct BiosLbaPacket
|
||||
{
|
||||
byte Size;
|
||||
byte Reserved;
|
||||
uint16 SectorCount;
|
||||
uint32 Buffer;
|
||||
uint64 Sector;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
struct ChsAddress
|
||||
{
|
||||
uint16 Cylinder;
|
||||
byte Head;
|
||||
byte Sector;
|
||||
};
|
||||
|
||||
struct Partition
|
||||
{
|
||||
byte Number;
|
||||
byte Drive;
|
||||
bool Active;
|
||||
uint64 EndSector;
|
||||
bool Primary;
|
||||
uint64 SectorCount;
|
||||
uint64 StartSector;
|
||||
byte Type;
|
||||
};
|
||||
|
||||
struct DriveGeometry
|
||||
{
|
||||
uint16 Cylinders;
|
||||
byte Heads;
|
||||
byte Sectors;
|
||||
};
|
||||
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
void AcquireSectorBuffer ();
|
||||
void ReleaseSectorBuffer ();
|
||||
#else
|
||||
# define AcquireSectorBuffer()
|
||||
# define ReleaseSectorBuffer()
|
||||
#endif
|
||||
|
||||
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba);
|
||||
bool GetActivePartition (byte drive);
|
||||
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent = false);
|
||||
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly = false, Partition *findPartitionFollowingThis = nullptr, bool silent = false);
|
||||
bool IsLbaSupported (byte drive);
|
||||
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs);
|
||||
void Print (const ChsAddress &chs);
|
||||
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs = nullptr);
|
||||
void PrintSectorCountInMB (const uint64 §orCount);
|
||||
BiosResult ReadWriteMBR (bool write, byte drive, bool silent = false);
|
||||
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent);
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
|
||||
|
||||
extern byte SectorBuffer[TC_LB_SIZE];
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDiskIo
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootDiskIo
|
||||
#define TC_HEADER_Boot_BootDiskIo
|
||||
|
||||
#include "Bios.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
|
||||
#define TC_MAX_BIOS_DISK_IO_RETRIES 5
|
||||
|
||||
enum
|
||||
{
|
||||
BiosResultEccCorrected = 0x11
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
struct PartitionEntryMBR
|
||||
{
|
||||
byte BootIndicator;
|
||||
|
||||
byte StartHead;
|
||||
byte StartCylSector;
|
||||
byte StartCylinder;
|
||||
|
||||
byte Type;
|
||||
|
||||
byte EndHead;
|
||||
byte EndSector;
|
||||
byte EndCylinder;
|
||||
|
||||
uint32 StartLBA;
|
||||
uint32 SectorCountLBA;
|
||||
};
|
||||
|
||||
struct MBR
|
||||
{
|
||||
byte Code[446];
|
||||
PartitionEntryMBR Partitions[4];
|
||||
uint16 Signature;
|
||||
};
|
||||
|
||||
struct BiosLbaPacket
|
||||
{
|
||||
byte Size;
|
||||
byte Reserved;
|
||||
uint16 SectorCount;
|
||||
uint32 Buffer;
|
||||
uint64 Sector;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
|
||||
struct ChsAddress
|
||||
{
|
||||
uint16 Cylinder;
|
||||
byte Head;
|
||||
byte Sector;
|
||||
};
|
||||
|
||||
struct Partition
|
||||
{
|
||||
byte Number;
|
||||
byte Drive;
|
||||
bool Active;
|
||||
uint64 EndSector;
|
||||
bool Primary;
|
||||
uint64 SectorCount;
|
||||
uint64 StartSector;
|
||||
byte Type;
|
||||
};
|
||||
|
||||
struct DriveGeometry
|
||||
{
|
||||
uint16 Cylinders;
|
||||
byte Heads;
|
||||
byte Sectors;
|
||||
};
|
||||
|
||||
|
||||
#ifdef TC_BOOT_DEBUG_ENABLED
|
||||
void AcquireSectorBuffer ();
|
||||
void ReleaseSectorBuffer ();
|
||||
#else
|
||||
# define AcquireSectorBuffer()
|
||||
# define ReleaseSectorBuffer()
|
||||
#endif
|
||||
|
||||
void ChsToLba (const DriveGeometry &geometry, const ChsAddress &chs, uint64 &lba);
|
||||
bool GetActivePartition (byte drive);
|
||||
BiosResult GetDriveGeometry (byte drive, DriveGeometry &geometry, bool silent = false);
|
||||
BiosResult GetDrivePartitions (byte drive, Partition *partitionArray, size_t partitionArrayCapacity, size_t &partitionCount, bool activeOnly = false, Partition *findPartitionFollowingThis = nullptr, bool silent = false);
|
||||
bool IsLbaSupported (byte drive);
|
||||
void LbaToChs (const DriveGeometry &geometry, const uint64 &lba, ChsAddress &chs);
|
||||
void Print (const ChsAddress &chs);
|
||||
void PrintDiskError (BiosResult error, bool write, byte drive, const uint64 *sector, const ChsAddress *chs = nullptr);
|
||||
void PrintSectorCountInMB (const uint64 §orCount);
|
||||
BiosResult ReadWriteMBR (bool write, byte drive, bool silent = false);
|
||||
BiosResult ReadSectors (uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult ReadSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
|
||||
BiosResult ReadWriteSectors (bool write, uint16 bufferSegment, uint16 bufferOffset, byte drive, const uint64 §or, uint16 sectorCount, bool silent);
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const uint64 §or, uint16 sectorCount, bool silent = false);
|
||||
BiosResult WriteSectors (byte *buffer, byte drive, const ChsAddress &chs, byte sectorCount, bool silent = false);
|
||||
|
||||
extern byte SectorBuffer[TC_LB_SIZE];
|
||||
|
||||
#endif // TC_HEADER_Boot_BootDiskIo
|
||||
|
||||
@@ -1,128 +1,132 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "Platform.h"
|
||||
#include "BootConfig.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootEncryptedIo.h"
|
||||
|
||||
|
||||
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount)
|
||||
{
|
||||
BiosResult result;
|
||||
bool decrypt = true;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
|
||||
return BiosResultInvalidFunction;
|
||||
|
||||
if (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
|
||||
{
|
||||
// Remap the request to the hidden volume
|
||||
sector -= EncryptedVirtualPartition.StartSector;
|
||||
sector += HiddenVolumeStartSector;
|
||||
}
|
||||
else
|
||||
decrypt = false;
|
||||
}
|
||||
|
||||
result = ReadSectors (destSegment, destOffset, drive, sector, sectorCount);
|
||||
|
||||
if (result != BiosResultSuccess || !decrypt)
|
||||
return result;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
// Convert sector number to data unit number of the hidden volume
|
||||
sector -= HiddenVolumeStartSector;
|
||||
sector += HiddenVolumeStartUnitNo;
|
||||
}
|
||||
|
||||
if (drive == EncryptedVirtualPartition.Drive)
|
||||
{
|
||||
while (sectorCount-- > 0)
|
||||
{
|
||||
if (BootCryptoInfo->hiddenVolume
|
||||
|| (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector))
|
||||
{
|
||||
AcquireSectorBuffer();
|
||||
CopyMemory (destSegment, destOffset, SectorBuffer, TC_LB_SIZE);
|
||||
|
||||
DecryptDataUnits (SectorBuffer, §or, 1, BootCryptoInfo);
|
||||
|
||||
CopyMemory (SectorBuffer, destSegment, destOffset, TC_LB_SIZE);
|
||||
ReleaseSectorBuffer();
|
||||
}
|
||||
|
||||
++sector;
|
||||
destOffset += TC_LB_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount)
|
||||
{
|
||||
BiosResult result = BiosResultSuccess;
|
||||
AcquireSectorBuffer();
|
||||
uint64 dataUnitNo;
|
||||
uint64 writeOffset;
|
||||
|
||||
dataUnitNo = sector;
|
||||
writeOffset.HighPart = 0;
|
||||
writeOffset.LowPart = 0;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
|
||||
return BiosResultInvalidFunction;
|
||||
|
||||
// Remap the request to the hidden volume
|
||||
writeOffset = HiddenVolumeStartSector;
|
||||
writeOffset -= EncryptedVirtualPartition.StartSector;
|
||||
dataUnitNo -= EncryptedVirtualPartition.StartSector;
|
||||
dataUnitNo += HiddenVolumeStartUnitNo;
|
||||
}
|
||||
|
||||
while (sectorCount-- > 0)
|
||||
{
|
||||
CopyMemory (sourceSegment, sourceOffset, SectorBuffer, TC_LB_SIZE);
|
||||
|
||||
if (drive == EncryptedVirtualPartition.Drive && sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
|
||||
{
|
||||
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo);
|
||||
}
|
||||
|
||||
result = WriteSectors (SectorBuffer, drive, sector + writeOffset, 1);
|
||||
|
||||
if (result != BiosResultSuccess)
|
||||
break;
|
||||
|
||||
++sector;
|
||||
++dataUnitNo;
|
||||
sourceOffset += TC_LB_SIZE;
|
||||
}
|
||||
|
||||
ReleaseSectorBuffer();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 §or, uint16 sectorCount)
|
||||
{
|
||||
uint64 readWriteEnd = sector + --sectorCount;
|
||||
|
||||
return ((sector < EncryptedVirtualPartition.StartSector && readWriteEnd >= EncryptedVirtualPartition.StartSector)
|
||||
|| (sector >= EncryptedVirtualPartition.StartSector && readWriteEnd > EncryptedVirtualPartition.EndSector));
|
||||
}
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#include "Crypto.h"
|
||||
#include "Platform.h"
|
||||
#include "BootConfig.h"
|
||||
#include "BootDebug.h"
|
||||
#include "BootDefs.h"
|
||||
#include "BootDiskIo.h"
|
||||
#include "BootEncryptedIo.h"
|
||||
|
||||
|
||||
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount)
|
||||
{
|
||||
BiosResult result;
|
||||
bool decrypt = true;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
|
||||
return BiosResultInvalidFunction;
|
||||
|
||||
if (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
|
||||
{
|
||||
// Remap the request to the hidden volume
|
||||
sector -= EncryptedVirtualPartition.StartSector;
|
||||
sector += HiddenVolumeStartSector;
|
||||
}
|
||||
else
|
||||
decrypt = false;
|
||||
}
|
||||
|
||||
result = ReadSectors (destSegment, destOffset, drive, sector, sectorCount);
|
||||
|
||||
if (result != BiosResultSuccess || !decrypt)
|
||||
return result;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
// Convert sector number to data unit number of the hidden volume
|
||||
sector -= HiddenVolumeStartSector;
|
||||
sector += PimValueOrHiddenVolumeStartUnitNo;
|
||||
}
|
||||
|
||||
if (drive == EncryptedVirtualPartition.Drive)
|
||||
{
|
||||
while (sectorCount-- > 0)
|
||||
{
|
||||
if (BootCryptoInfo->hiddenVolume
|
||||
|| (sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector))
|
||||
{
|
||||
AcquireSectorBuffer();
|
||||
CopyMemory (destSegment, destOffset, SectorBuffer, TC_LB_SIZE);
|
||||
|
||||
DecryptDataUnits (SectorBuffer, §or, 1, BootCryptoInfo);
|
||||
|
||||
CopyMemory (SectorBuffer, destSegment, destOffset, TC_LB_SIZE);
|
||||
ReleaseSectorBuffer();
|
||||
}
|
||||
|
||||
++sector;
|
||||
destOffset += TC_LB_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount)
|
||||
{
|
||||
BiosResult result = BiosResultSuccess;
|
||||
AcquireSectorBuffer();
|
||||
uint64 dataUnitNo;
|
||||
uint64 writeOffset;
|
||||
|
||||
dataUnitNo = sector;
|
||||
writeOffset.HighPart = 0;
|
||||
writeOffset.LowPart = 0;
|
||||
|
||||
if (BootCryptoInfo->hiddenVolume)
|
||||
{
|
||||
if (ReadWritePartiallyCoversEncryptedArea (sector, sectorCount))
|
||||
return BiosResultInvalidFunction;
|
||||
|
||||
// Remap the request to the hidden volume
|
||||
writeOffset = HiddenVolumeStartSector;
|
||||
writeOffset -= EncryptedVirtualPartition.StartSector;
|
||||
dataUnitNo -= EncryptedVirtualPartition.StartSector;
|
||||
dataUnitNo += PimValueOrHiddenVolumeStartUnitNo;
|
||||
}
|
||||
|
||||
while (sectorCount-- > 0)
|
||||
{
|
||||
CopyMemory (sourceSegment, sourceOffset, SectorBuffer, TC_LB_SIZE);
|
||||
|
||||
if (drive == EncryptedVirtualPartition.Drive && sector >= EncryptedVirtualPartition.StartSector && sector <= EncryptedVirtualPartition.EndSector)
|
||||
{
|
||||
EncryptDataUnits (SectorBuffer, &dataUnitNo, 1, BootCryptoInfo);
|
||||
}
|
||||
|
||||
result = WriteSectors (SectorBuffer, drive, sector + writeOffset, 1);
|
||||
|
||||
if (result != BiosResultSuccess)
|
||||
break;
|
||||
|
||||
++sector;
|
||||
++dataUnitNo;
|
||||
sourceOffset += TC_LB_SIZE;
|
||||
}
|
||||
|
||||
ReleaseSectorBuffer();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 §or, uint16 sectorCount)
|
||||
{
|
||||
uint64 readWriteEnd = sector + --sectorCount;
|
||||
|
||||
return ((sector < EncryptedVirtualPartition.StartSector && readWriteEnd >= EncryptedVirtualPartition.StartSector)
|
||||
|| (sector >= EncryptedVirtualPartition.StartSector && readWriteEnd > EncryptedVirtualPartition.EndSector));
|
||||
}
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
/*
|
||||
Copyright (c) 2008 TrueCrypt Developers Association. All rights reserved.
|
||||
|
||||
Governed by the TrueCrypt License 3.0 the full text of which is contained in
|
||||
the file License.txt included in TrueCrypt binary and source code distribution
|
||||
packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootEncryptionIo
|
||||
#define TC_HEADER_Boot_BootEncryptionIo
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount);
|
||||
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount);
|
||||
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 §or, uint16 sectorCount);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootEncryptionIo
|
||||
/*
|
||||
Derived from source code of TrueCrypt 7.1a, which is
|
||||
Copyright (c) 2008-2012 TrueCrypt Developers Association and which is governed
|
||||
by the TrueCrypt License 3.0.
|
||||
|
||||
Modifications and additions to the original source code (contained in this file)
|
||||
and all other portions of this file are Copyright (c) 2013-2016 IDRIX
|
||||
and are governed by the Apache License 2.0 the full text of which is
|
||||
contained in the file License.txt included in VeraCrypt binary and source
|
||||
code distribution packages.
|
||||
*/
|
||||
|
||||
#ifndef TC_HEADER_Boot_BootEncryptionIo
|
||||
#define TC_HEADER_Boot_BootEncryptionIo
|
||||
|
||||
#include "Platform.h"
|
||||
|
||||
BiosResult ReadEncryptedSectors (uint16 destSegment, uint16 destOffset, byte drive, uint64 sector, uint16 sectorCount);
|
||||
BiosResult WriteEncryptedSectors (uint16 sourceSegment, uint16 sourceOffset, byte drive, uint64 sector, uint16 sectorCount);
|
||||
static bool ReadWritePartiallyCoversEncryptedArea (const uint64 §or, uint16 sectorCount);
|
||||
|
||||
#endif // TC_HEADER_Boot_BootEncryptionIo
|
||||
|
||||
+1272
-1151
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user