/usr/include/libewf.h is in libewf-dev 20100226-1build2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 | /*
* Library for the Expert Witness Compression Format Support (EWF)
*
* Copyright (c) 2006-2009, Joachim Metz <forensics@hoffmannbv.nl>,
* Hoffmann Investigations.
*
* Refer to AUTHORS for acknowledgements.
*
* This software is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this software. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined( _LIBEWF_H )
#define _LIBEWF_H
#include <libewf/codepage.h>
#include <libewf/definitions.h>
#include <libewf/error.h>
#include <libewf/extern.h>
#include <libewf/features.h>
#include <libewf/types.h>
#if 1 || defined( HAVE_V1_API )
#include <libewf/handle.h>
#endif
#include <stdio.h>
#if defined( LIBEWF_HAVE_BFIO )
#include <libbfio.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* -------------------------------------------------------------------------
* Support functions
* ------------------------------------------------------------------------- */
/* Returns the library version
*/
LIBEWF_EXTERN const char *libewf_get_version(
void );
/* Returns the flags for reading
*/
LIBEWF_EXTERN uint8_t libewf_get_flags_read(
void );
/* Returns the flags for reading and writing
*/
LIBEWF_EXTERN uint8_t libewf_get_flags_read_write(
void );
/* Returns the flags for writing
*/
LIBEWF_EXTERN uint8_t libewf_get_flags_write(
void );
/* Returns the flags for resume writing
*/
LIBEWF_EXTERN uint8_t libewf_get_flags_write_resume(
void );
/* Determines if a file is an EWF file (check for the EWF file signature)
* Returns 1 if true, 0 if not or -1 on error
*/
#if 0 || defined( HAVE_V2_API )
LIBEWF_EXTERN int libewf_check_file_signature(
const char *filename,
libewf_error_t **error );
#else
LIBEWF_EXTERN int libewf_check_file_signature(
const char *filename );
#endif
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Determines if a file is an EWF file (check for the EWF file signature)
* Returns 1 if true, 0 if not or -1 on error
*/
#if 0 || defined( HAVE_V2_API )
LIBEWF_EXTERN int libewf_check_file_signature_wide(
const wchar_t *filename,
libewf_error_t **error );
#else
LIBEWF_EXTERN int libewf_check_file_signature_wide(
const wchar_t *filename );
#endif
#endif
#if 0 || defined( HAVE_V2_API )
#if defined( LIBEWF_HAVE_BFIO )
/* Determines if a file is an EWF file (check for the EWF file signature) using a Basic File IO (bfio) handle
* Returns 1 if true, 0 if not or -1 on error
*/
LIBEWF_EXTERN int libewf_check_file_signature_file_io_handle(
libbfio_handle_t *file_io_handle,
libewf_error_t **error );
#endif
#endif
/* Globs the segment files according to the EWF naming schema
* if the format is known the filename should contain the base of the filename
* otherwise the function will try to determine the format based on the extension
* Returns 1 if successful or -1 on error
*/
#if 0 || defined( HAVE_V2_API )
LIBEWF_EXTERN int libewf_glob(
const char *filename,
size_t filename_length,
uint8_t format,
char **filenames[],
int *amount_of_filenames,
libewf_error_t **error );
#else
/* Globs the segment files according to the EWF naming schema
* if the format is known the filename should contain the base of the filename
* otherwise the function will try to determine the format based on the extension
* Returns the amount of filenames if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_glob(
const char *filename,
size_t filename_length,
uint8_t format,
char **filenames[] );
#endif
#if 0 || defined( HAVE_V2_API )
/* Frees the globbed filenames
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_glob_free(
char *filenames[],
int amount_of_filenames,
libewf_error_t **error );
#endif
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Globs the segment files according to the EWF naming schema
* if the format is known the filename should contain the base of the filename
* otherwise the function will try to determine the format based on the extension
* Returns 1 if successful or -1 on error
*/
#if 0 || defined( HAVE_V2_API )
LIBEWF_EXTERN int libewf_glob_wide(
const wchar_t *filename,
size_t filename_length,
uint8_t format,
wchar_t **filenames[],
int *amount_of_filenames,
libewf_error_t **error );
#else
/* Globs the segment files according to the EWF naming schema
* if the format is known the filename should contain the base of the filename
* otherwise the function will try to determine the format based on the extension
* Returns the amount of filenames if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_glob_wide(
const wchar_t *filename,
size_t filename_length,
uint8_t format,
wchar_t **filenames[] );
#endif
#if 0 || defined( HAVE_V2_API )
/* Frees the globbed filenames
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_glob_free(
char *filenames[],
int amount_of_filenames,
libewf_error_t **error );
#endif
#endif
/* -------------------------------------------------------------------------
* Notify functions (APIv1)
* ------------------------------------------------------------------------- */
#if 1 || defined( HAVE_V1_API )
/* Set the notify values
*/
LIBEWF_EXTERN void libewf_set_notify_values(
FILE *stream,
uint8_t verbose );
#endif
/* -------------------------------------------------------------------------
* Notify functions (APIv2)
* ------------------------------------------------------------------------- */
#if 0 || defined( HAVE_V2_API )
/* Set the verbose notification
*/
LIBEWF_EXTERN void libewf_notify_set_verbose(
int verbose );
/* Set the notification stream
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_notify_set_stream(
FILE *stream,
libewf_error_t **error );
/* Opens the notification stream using a filename
* The stream is opened in append mode
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_notify_stream_open(
const char *filename,
libewf_error_t **error );
/* Closes the notification stream if opened using a filename
* Returns 0 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_notify_stream_close(
libewf_error_t **error );
#endif
/* -------------------------------------------------------------------------
* Error functions (APIv2)
* ------------------------------------------------------------------------- */
#if 0 || defined( HAVE_V2_API )
/* Frees the error including elements
*/
LIBEWF_EXTERN void libewf_error_free(
libewf_error_t **error );
/* Prints a descriptive string of the error to the stream
* Returns the amount of printed characters if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_error_fprint(
libewf_error_t *error,
FILE *stream );
/* Prints a descriptive string of the error to the string
* Returns the amount of printed characters if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_error_sprint(
libewf_error_t *error,
char *string,
size_t size );
/* Prints a backtrace of the error to the stream
* Returns the amount of printed characters if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_error_backtrace_fprint(
libewf_error_t *error,
FILE *stream );
/* Prints a backtrace of the error to the string
* Returns the amount of printed characters if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_error_backtrace_sprint(
libewf_error_t *error,
char *string,
size_t size );
#endif
/* -------------------------------------------------------------------------
* File/Handle functions (APIv1)
* ------------------------------------------------------------------------- */
#if 1 || defined( HAVE_V1_API )
/* Signals the libewf handle to abort its current activity
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_signal_abort(
libewf_handle_t *handle );
/* Opens a set of EWF file(s)
* For reading files should contain all filenames that make up an EWF image
* For writing files should contain the base of the filename, extentions like .e01 will be automatically added
* Returns a pointer to the new instance of handle, NULL on error
*/
LIBEWF_EXTERN libewf_handle_t *libewf_open(
char * const filenames[],
int amount_of_filenames,
uint8_t flags );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Opens a set of EWF file(s)
* For reading files should contain all filenames that make up an EWF image
* For writing files should contain the base of the filename, extentions like .e01 will be automatically added
* Returns a pointer to the new instance of handle, NULL on error
*/
LIBEWF_EXTERN libewf_handle_t *libewf_open_wide(
wchar_t * const filenames[],
int amount_of_filenames,
uint8_t flags );
#endif
/* Closes the EWF handle and frees memory used within the handle
* Returns 0 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_close(
libewf_handle_t *handle );
/* Seeks a certain offset of the media data within the EWF file(s)
* It will set the related file offset to the specific chunk offset
* Returns the offset if seek is successful or -1 on error
*/
LIBEWF_EXTERN off64_t libewf_seek_offset(
libewf_handle_t *handle,
off64_t offset );
/* Retrieves the current offset of the media data within the EWF file(s)
* Returns the offset if successful or -1 on error
*/
LIBEWF_EXTERN off64_t libewf_get_offset(
libewf_handle_t *handle );
/* Prepares a buffer with chunk data after reading it according to the handle settings
* intended for raw read
* The buffer size cannot be larger than the chunk size
* Returns the resulting chunk size or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_raw_read_prepare_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
void *uncompressed_buffer,
size_t *uncompressed_buffer_size,
int8_t is_compressed,
uint32_t chunk_crc,
int8_t read_crc );
/* Reads 'raw' data from the curent offset into a buffer
* size contains the size of the buffer
* The function sets the chunk crc, is compressed and read crc values
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_raw_read_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
int8_t *is_compressed,
uint32_t *chunk_crc,
int8_t *read_crc );
/* Reads data from the curent offset into a buffer
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_read_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size );
/* Reads media data from an offset into a buffer
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_read_random(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
off64_t offset );
/* Prepares a buffer with chunk data before writing according to the handle settings
* intended for raw write
* The buffer size cannot be larger than the chunk size
* The function sets the chunk crc, is compressed and write crc values
* Returns the resulting chunk size or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_raw_write_prepare_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
void *compressed_buffer,
size_t *compressed_buffer_size,
int8_t *is_compressed,
uint32_t *chunk_crc,
int8_t *write_crc );
/* Writes 'raw' data in EWF format from a buffer at the current offset
* the necessary settings of the write values must have been made
* size contains the size of the data within the buffer while
* data size contains the size of the actual input data
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_raw_write_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
size_t data_size,
int8_t is_compressed,
uint32_t chunk_crc,
int8_t write_crc );
/* Writes data in EWF format from a buffer at the current offset
* the necessary settings of the write values must have been made
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_write_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size );
/* Writes data in EWF format from a buffer at an specific offset,
* the necessary settings of the write values must have been made
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_write_random(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
off64_t offset );
/* Finalizes the write by correcting the EWF the meta data in the segment files
* This function is required after writing from stream
* Returns the amount of input bytes written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_write_finalize(
libewf_handle_t *handle );
/* Retrieves the segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_segment_filename(
libewf_handle_t *handle,
char *filename,
size_t filename_size );
/* Sets the segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_segment_filename(
libewf_handle_t *handle,
const char *filename,
size_t filename_length );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Retrieves the segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_segment_filename_wide(
libewf_handle_t *handle,
wchar_t *filename,
size_t filename_size );
/* Sets the segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_segment_filename_wide(
libewf_handle_t *handle,
const wchar_t *filename,
size_t filename_length );
#endif
/* Retrieves the segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_segment_file_size(
libewf_handle_t *handle,
size64_t *segment_file_size );
/* Sets the segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_segment_file_size(
libewf_handle_t *handle,
size64_t segment_file_size );
/* Retrieves the delta segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_delta_segment_filename(
libewf_handle_t *handle,
char *filename,
size_t filename_size );
/* Sets the delta segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_delta_segment_filename(
libewf_handle_t *handle,
const char *filename,
size_t filename_length );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Retrieves the delta segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_delta_segment_filename_wide(
libewf_handle_t *handle,
wchar_t *filename,
size_t filename_size );
/* Sets the delta segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_delta_segment_filename_wide(
libewf_handle_t *handle,
const wchar_t *filename,
size_t filename_length );
#endif
/* Retrieves the delta segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_delta_segment_file_size(
libewf_handle_t *handle,
size64_t *delta_segment_file_size );
/* Sets the delta segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_delta_segment_file_size(
libewf_handle_t *handle,
size64_t delta_segment_file_size );
#endif
/* -------------------------------------------------------------------------
* File/Handle functions (APIv2)
* ------------------------------------------------------------------------- */
#if 0 || defined( HAVE_V2_API )
/* Initialize the handle
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_initialize(
libewf_handle_t **handle,
libewf_error_t **error );
/* Frees the handle including elements
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_free(
libewf_handle_t **handle,
libewf_error_t **error );
/* Signals the libewf handle to abort its current activity
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_signal_abort(
libewf_handle_t *handle,
libewf_error_t **error );
/* Opens a set of EWF file(s)
* For reading files should contain all filenames that make up an EWF image
* For writing files should contain the base of the filename, extentions like .e01 will be automatically added
* Returns a pointer to the new instance of handle, NULL on error
*/
LIBEWF_EXTERN int libewf_handle_open(
libewf_handle_t *handle,
char * const filenames[],
int amount_of_filenames,
uint8_t flags,
libewf_error_t **error );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Opens a set of EWF file(s)
* For reading files should contain all filenames that make up an EWF image
* For writing files should contain the base of the filename, extentions like .e01 will be automatically added
* Returns a pointer to the new instance of handle, NULL on error
*/
LIBEWF_EXTERN int libewf_handle_open_wide(
libewf_handle_t *handle,
wchar_t * const filenames[],
int amount_of_filenames,
uint8_t flags,
libewf_error_t **error );
#endif
#if defined( LIBEWF_HAVE_BFIO )
/* Opens a set of EWF file(s) using a Basic File IO (bfio) pool
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_open_file_io_pool(
libewf_handle_t *handle,
libbfio_pool_t *file_io_pool,
uint8_t flags,
libewf_error_t **error );
#endif
/* Closes the EWF handle and frees memory used within the handle
* Returns 0 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_close(
libewf_handle_t *handle,
libewf_error_t **error );
/* Seeks a certain offset of the media data within the EWF file(s)
* It will set the related file offset to the specific chunk offset
* Returns the offset if seek is successful or -1 on error
*/
LIBEWF_EXTERN off64_t libewf_handle_seek_offset(
libewf_handle_t *handle,
off64_t offset,
int whence,
libewf_error_t **error );
/* Retrieves the current offset of the media data within the EWF file(s)
* Returns the offset if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_offset(
libewf_handle_t *handle,
off64_t *offset,
libewf_error_t **error );
/* Prepares chunk data after reading it according to the handle settings
* This function should be used after libewf_handle_read_chunk
* The chunk buffer size should contain the actual chunk size
* Returns the resulting chunk size or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_prepare_read_chunk(
libewf_handle_t *handle,
void *chunk_buffer,
size_t chunk_buffer_size,
void *uncompressed_buffer,
size_t *uncompressed_buffer_size,
int8_t is_compressed,
uint32_t chunk_crc,
int8_t read_crc,
libewf_error_t **error );
/* Reads a chunk from the curent offset into a buffer
* size contains the size of the chunk buffer
* The function sets the chunk crc, is compressed and read crc values
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_read_chunk(
libewf_handle_t *handle,
void *chunk_buffer,
size_t chunk_buffer_size,
int8_t *is_compressed,
void *crc_buffer,
uint32_t *chunk_crc,
int8_t *read_crc,
libewf_error_t **error );
/* Reads data from the curent offset into a buffer
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_read_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
libewf_error_t **error );
/* Reads media data from an offset into a buffer
* Returns the amount of bytes read or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_read_random(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
off64_t offset,
libewf_error_t **error );
/* Prepares a buffer with chunk data before writing according to the handle settings
* This function should be used before libewf_handle_write_chunk
* The chunk buffer size should contain the actual chunk size
* The function sets the chunk crc, is compressed and write crc values
* Returns the resulting chunk size or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_prepare_write_chunk(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
void *compressed_buffer,
size_t *compressed_buffer_size,
int8_t *is_compressed,
uint32_t *chunk_crc,
int8_t *write_crc,
libewf_error_t **error );
/* Writes a chunk in EWF format from a buffer at the current offset
* the necessary settings of the write values must have been made
* size contains the size of the data within the buffer while
* data size contains the size of the actual input data
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_write_chunk(
libewf_handle_t *handle,
void *chunk_buffer,
size_t chunk_buffer_size,
size_t data_size,
int8_t is_compressed,
void *crc_buffer,
uint32_t chunk_crc,
int8_t write_crc,
libewf_error_t **error );
/* Writes data in EWF format from a buffer at the current offset
* the necessary settings of the write values must have been made
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_write_buffer(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
libewf_error_t **error );
/* Writes data in EWF format from a buffer at an specific offset,
* the necessary settings of the write values must have been made
* Will initialize write if necessary
* Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_write_random(
libewf_handle_t *handle,
void *buffer,
size_t buffer_size,
off64_t offset,
libewf_error_t **error );
/* Finalizes the write by correcting the EWF the meta data in the segment files
* This function is required after writing from stream
* Returns the amount of input bytes written or -1 on error
*/
LIBEWF_EXTERN ssize_t libewf_handle_write_finalize(
libewf_handle_t *handle,
libewf_error_t **error );
/* Retrieves the segment filename size
* The filename size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_segment_filename_size(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_segment_filename(
libewf_handle_t *handle,
char *filename,
size_t filename_size,
libewf_error_t **error );
/* Sets the segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_segment_filename(
libewf_handle_t *handle,
const char *filename,
size_t filename_length,
libewf_error_t **error );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Retrieves the segment filename size
* The filename size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_segment_filename_size_wide(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_segment_filename_wide(
libewf_handle_t *handle,
wchar_t *filename,
size_t filename_size,
libewf_error_t **error );
/* Sets the segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_segment_filename_wide(
libewf_handle_t *handle,
const wchar_t *filename,
size_t filename_length,
libewf_error_t **error );
#endif
/* Retrieves the segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_segment_file_size(
libewf_handle_t *handle,
size64_t *segment_file_size,
libewf_error_t **error );
/* Sets the segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_segment_file_size(
libewf_handle_t *handle,
size64_t segment_file_size,
libewf_error_t **error );
/* Retrieves the delta segment filename size
* The filename size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_delta_segment_filename_size(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the delta segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_delta_segment_filename(
libewf_handle_t *handle,
char *filename,
size_t filename_size,
libewf_error_t **error );
/* Sets the delta segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_delta_segment_filename(
libewf_handle_t *handle,
const char *filename,
size_t filename_length,
libewf_error_t **error );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Retrieves the delta segment filename size
* The filename size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_delta_segment_filename_size_wide(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the delta segment filename
* The filename size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_delta_segment_filename_wide(
libewf_handle_t *handle,
wchar_t *filename,
size_t filename_size,
libewf_error_t **error );
/* Sets the delta segment filename
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_delta_segment_filename_wide(
libewf_handle_t *handle,
const wchar_t *filename,
size_t filename_length,
libewf_error_t **error );
#endif
/* Retrieves the delta segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_delta_segment_file_size(
libewf_handle_t *handle,
size64_t *delta_segment_file_size,
libewf_error_t **error );
/* Sets the delta segment file size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_delta_segment_file_size(
libewf_handle_t *handle,
size64_t delta_segment_file_size,
libewf_error_t **error );
/* Retrieves the filename size of the (delta) segment file of the current chunk
* The filename size includes the end of string character
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_filename_size(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the filename of the (delta) segment file of the current chunk
* The filename size should include the end of string character
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_filename(
libewf_handle_t *handle,
char *filename,
size_t filename_size,
libewf_error_t **error );
#if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE )
/* Retrieves the filename size of the (delta) segment file of the current chunk
* The filename size includes the end of string character
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_filename_size_wide(
libewf_handle_t *handle,
size_t *filename_size,
libewf_error_t **error );
/* Retrieves the filename of the (delta) segment file of the current chunk
* The filename size should include the end of string character
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_filename_wide(
libewf_handle_t *handle,
wchar_t *filename,
size_t filename_size,
libewf_error_t **error );
#endif
#if defined( LIBEWF_HAVE_BFIO )
/* Retrieves the file io handle of the (delta) segment file of the current chunk
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_file_io_handle(
libewf_handle_t *handle,
libbfio_handle_t **file_io_handle,
libewf_error_t **error );
#endif
#endif
/* -------------------------------------------------------------------------
* Meta data functions (APIv1)
* ------------------------------------------------------------------------- */
#if 1 || defined( HAVE_V1_API )
/* Retrieves the amount of sectors per chunk from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_sectors_per_chunk(
libewf_handle_t *handle,
uint32_t *sectors_per_chunk );
/* Sets the amount of sectors per chunk in the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_sectors_per_chunk(
libewf_handle_t *handle,
uint32_t sectors_per_chunk );
/* Retrieves the amount of bytes per sector from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_bytes_per_sector(
libewf_handle_t *handle,
uint32_t *bytes_per_sector );
/* Sets the amount of bytes per sector in the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_bytes_per_sector(
libewf_handle_t *handle,
uint32_t bytes_per_sector );
/* Retrieves the amount of sectors from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_sectors(
libewf_handle_t *handle,
uint32_t *amount_of_sectors );
/* Retrieves the chunk size from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_chunk_size(
libewf_handle_t *handle,
size32_t *chunk_size );
/* Retrieves the error granularity from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_error_granularity(
libewf_handle_t *handle,
uint32_t *error_granularity );
/* Sets the error granularity
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_error_granularity(
libewf_handle_t *handle,
uint32_t error_granularity );
/* Retrieves the compression values
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_compression_values(
libewf_handle_t *handle,
int8_t *compression_level,
uint8_t *compress_empty_block );
/* Sets the compression values
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_compression_values(
libewf_handle_t *handle,
int8_t compression_level,
uint8_t compress_empty_block );
/* Retrieves the size of the contained media data
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_media_size(
libewf_handle_t *handle,
size64_t *media_size );
/* Sets the media size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_media_size(
libewf_handle_t *handle,
size64_t media_size );
/* Retrieves the media type value
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_media_type(
libewf_handle_t *handle,
uint8_t *media_type );
/* Sets the media type
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_media_type(
libewf_handle_t *handle,
uint8_t media_type );
/* Retrieves the media flags
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_media_flags(
libewf_handle_t *handle,
uint8_t *media_flags );
/* Sets the media flags
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_media_flags(
libewf_handle_t *handle,
uint8_t media_flags );
/* Retrieves the volume type value
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_volume_type(
libewf_handle_t *handle,
uint8_t *volume_type );
/* Sets the volume type
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_volume_type(
libewf_handle_t *handle,
uint8_t volume_type );
/* Retrieves the format type value
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_format(
libewf_handle_t *handle,
uint8_t *format );
/* Sets the output format
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_format(
libewf_handle_t *handle,
uint8_t format );
/* Retrieves the GUID
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_guid(
libewf_handle_t *handle,
uint8_t *guid,
size_t size );
/* Sets the GUID
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_guid(
libewf_handle_t *handle,
uint8_t *guid,
size_t size );
/* Retrieves the MD5 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_md5_hash(
libewf_handle_t *handle,
uint8_t *md5_hash,
size_t size );
/* Sets the MD5 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_set_md5_hash(
libewf_handle_t *handle,
uint8_t *md5_hash,
size_t size );
/* Retrieves the SHA1 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_sha1_hash(
libewf_handle_t *handle,
uint8_t *sha1_hash,
size_t size );
/* Sets the SHA1 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_set_sha1_hash(
libewf_handle_t *handle,
uint8_t *sha1_hash,
size_t size );
/* Retrieves the amount of chunks written
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_write_amount_of_chunks(
libewf_handle_t *handle,
uint32_t *amount_of_chunks );
/* Sets the read wipe chunk on error
* The chunk is not wiped if read raw is used
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_read_wipe_chunk_on_error(
libewf_handle_t *handle,
uint8_t wipe_on_error );
/* Copies the media values from the source to the destination handle
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_copy_media_values(
libewf_handle_t *destination_handle,
libewf_handle_t *source_handle );
/* Retrieves the amount of acquiry errors
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_acquiry_errors(
libewf_handle_t *handle,
uint32_t *amount_of_errors );
/* Retrieves the information of an acquiry error
* Returns 1 if successful, 0 if no acquiry error could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_get_acquiry_error(
libewf_handle_t *handle,
uint32_t index,
off64_t *first_sector,
uint32_t *amount_of_sectors );
/* Add an acquiry error
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_add_acquiry_error(
libewf_handle_t *handle,
off64_t first_sector,
uint32_t amount_of_sectors );
/* Retrieves the amount of CRC errors
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_crc_errors(
libewf_handle_t *handle,
uint32_t *amount_of_errors );
/* Retrieves the information of a CRC error
* Returns 1 if successful, 0 if no CRC error could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_get_crc_error(
libewf_handle_t *handle,
uint32_t index,
off64_t *first_sector,
uint32_t *amount_of_sectors );
/* Add a CRC error
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_add_crc_error(
libewf_handle_t *handle,
off64_t first_sector,
uint32_t amount_of_sectors );
/* Retrieves the amount of sessions
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_sessions(
libewf_handle_t *handle,
uint32_t *amount_of_sessions );
/* Retrieves the information of a session
* Returns 1 if successful, 0 if no sessions could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_get_session(
libewf_handle_t *handle,
uint32_t index,
off64_t *first_sector,
uint32_t *amount_of_sectors );
/* Add a session
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_add_session(
libewf_handle_t *handle,
off64_t first_sector,
uint32_t amount_of_sectors );
/* Retrieves the header codepage
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_get_header_codepage(
libewf_handle_t *handle,
int *header_codepage );
/* Sets the header codepage
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_header_codepage(
libewf_handle_t *handle,
int header_codepage );
/* Retrieves the amount of header values
* Returns 1 if successful, 0 if no header values are present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_header_values(
libewf_handle_t *handle,
uint32_t *amount_of_values );
/* Retrieves the header value identifier size specified by its index
* The identifier size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_header_value_identifier_size(
libewf_handle_t *handle,
uint32_t index,
size_t *identifier_size );
/* Retrieves the header value identifier specified by its index
* The strings are encoded in UTF-8
* The identifier size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_header_value_identifier(
libewf_handle_t *handle,
uint32_t index,
char *identifier,
size_t identifier_size );
/* Retrieves the header value size specified by the identifier
* The value size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_header_value_size(
libewf_handle_t *handle,
const char *identifier,
size_t *value_size );
/* Retrieves the header value specified by the identifier
* The strings are encoded in UTF-8
* The value size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_header_value(
libewf_handle_t *handle,
const char *identifier,
char *value,
size_t value_size );
/* Retrieves the header value case number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_case_number( handle, value, value_size ) \
libewf_get_header_value( handle, "case_number", value, value_size )
/* Retrieves the header value description
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_description( handle, value, value_size ) \
libewf_get_header_value( handle, "description", value, value_size )
/* Retrieves the header value examiner name
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_examiner_name( handle, value, value_size ) \
libewf_get_header_value( handle, "examiner_name", value, value_size )
/* Retrieves the header value evidence number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_evidence_number( handle, value, value_size ) \
libewf_get_header_value( handle, "evidence_number", value, value_size )
/* Retrieves the header value notes
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_notes( handle, value, value_size ) \
libewf_get_header_value( handle, "notes", value, value_size )
/* Retrieves the header value acquiry date
* The string is formatted according to the date format
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_acquiry_date( handle, value, value_size ) \
libewf_get_header_value( handle, "acquiry_date", value, value_size )
/* Retrieves the header value system date
* The string is formatted according to the date format
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_system_date( handle, value, value_size ) \
libewf_get_header_value( handle, "system_date", value, value_size )
/* Retrieves the header value acquiry operating system
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_acquiry_operating_system( handle, value, value_size ) \
libewf_get_header_value( handle, "acquiry_operating_system", value, value_size )
/* Retrieves the header value acquiry software version
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_acquiry_software_version( handle, value, value_size ) \
libewf_get_header_value( handle, "acquiry_software_version", value, value_size )
/* Retrieves the header value password
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_password( handle, value, value_size ) \
libewf_get_header_value( handle, "password", value, value_size )
/* Retrieves the header value compression type
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_compression_type( handle, value, value_size ) \
libewf_get_header_value( handle, "compression_type", value, value_size )
/* Retrieves the header value model
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_model( handle, value, value_size ) \
libewf_get_header_value( handle, "model", value, value_size )
/* Retrieves the header value serial number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_header_value_serial_number( handle, value, value_size ) \
libewf_get_header_value( handle, "serial_number", value, value_size )
/* Sets the header value specified by the identifier
* The strings are encoded in UTF-8
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_header_value(
libewf_handle_t *handle,
const char *identifier,
const char *value,
size_t value_length );
/* Sets the header value case number
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_case_number( handle, value, value_length ) \
libewf_set_header_value( handle, "case_number", value, value_length )
/* Sets the header value description
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_description( handle, value, value_length ) \
libewf_set_header_value( handle, "description", value, value_length )
/* Sets the header value examiner name
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_examiner_name( handle, value, value_length ) \
libewf_set_header_value( handle, "examiner_name", value, value_length )
/* Sets the header value evidence number
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_evidence_number( handle, value, value_length ) \
libewf_set_header_value( handle, "evidence_number", value, value_length )
/* Sets the header value notes
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_notes( handle, value, value_length ) \
libewf_set_header_value( handle, "notes", value, value_length )
/* Sets the header value acquiry date
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_acquiry_date( handle, value, value_length ) \
libewf_set_header_value( handle, "acquiry_date", value, value_length )
/* Sets the header value system date
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_system_date( handle, value, value_length ) \
libewf_set_header_value( handle, "system_date", value, value_length )
/* Sets the header value acquiry operating system
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_acquiry_operating_system( handle, value, value_length ) \
libewf_set_header_value( handle, "acquiry_operating_system", value, value_length )
/* Sets the header value acquiry software version
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_acquiry_software_version( handle, value, value_length ) \
libewf_set_header_value( handle, "acquiry_software_version", value, value_length )
/* Sets the header value password
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_password( handle, value, value_length ) \
libewf_set_header_value( handle, "password", value, value_length )
/* Sets the header value compression type
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_compression_type( handle, value, value_length ) \
libewf_set_header_value( handle, "compression_type", value, value_length )
/* Sets the header value model
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_model( handle, value, value_length ) \
libewf_set_header_value( handle, "model", value, value_length )
/* Sets the header value serial number
* Returns 1 if successful or -1 on error
*/
#define libewf_set_header_value_serial_number( handle, value, value_length ) \
libewf_set_header_value( handle, "serial_number", value, value_length )
/* Parses the header values from the xheader, header2 or header section
* Will parse the first available header in order mentioned above
* Returns 1 if successful, 0 if already parsed or -1 on error
*/
LIBEWF_EXTERN int libewf_parse_header_values(
libewf_handle_t *handle,
uint8_t date_format );
/* Copies the header values from the source to the destination handle
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_copy_header_values(
libewf_handle_t *destination_handle,
libewf_handle_t *source_handle );
/* Retrieves the amount of hash values
* Returns 1 if successful, 0 if no hash values are present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_amount_of_hash_values(
libewf_handle_t *handle,
uint32_t *amount_of_values );
/* Retrieves the hash value identifier size specified by its index
* The identifier size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_hash_value_identifier_size(
libewf_handle_t *handle,
uint32_t index,
size_t *identifier_size );
/* Retrieves the hash value identifier specified by its index
* The strings are encoded in UTF-8
* The identifier size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_hash_value_identifier(
libewf_handle_t *handle,
uint32_t index,
char *identifier,
size_t identifier_size );
/* Retrieves the hash value size specified by the identifier
* The value size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_hash_value_size(
libewf_handle_t *handle,
const char *identifier,
size_t *value_size );
/* Retrieves the hash value specified by the identifier
* The strings are encoded in UTF-8
* The value size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_get_hash_value(
libewf_handle_t *handle,
const char *identifier,
char *value,
size_t value_size );
/* Retrieves the hash value MD5
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_hash_value_md5( handle, value, value_size ) \
libewf_get_hash_value( handle, "MD5", value, value_size )
/* Retrieves the hash value SHA1
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_get_hash_value_sha1( handle, value, value_size ) \
libewf_get_hash_value( handle, "SHA1", value, value_size )
/* Sets the hash value specified by the identifier
* The strings are encoded in UTF-8
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_set_hash_value(
libewf_handle_t *handle,
const char *identifier,
const char *value,
size_t value_length );
/* Sets the hash value MD5
* Returns 1 if successful or -1 on error
*/
#define libewf_set_hash_value_md5( handle, value, value_length ) \
libewf_set_hash_value( handle, "MD5", value, value_length )
/* Sets the hash value SHA1
* Returns 1 if successful or -1 on error
*/
#define libewf_set_hash_value_sha1( handle, value, value_length ) \
libewf_set_hash_value( handle, "SHA1", value, value_length )
/* Parses the hash values from the xhash section
* Returns 1 if successful, 0 if already parsed or -1 on error
*/
LIBEWF_EXTERN int libewf_parse_hash_values(
libewf_handle_t *handle );
#endif
/* -------------------------------------------------------------------------
* Meta data functions (APIv2)
* ------------------------------------------------------------------------- */
#if 0 || defined( HAVE_V2_API )
/* Retrieves the amount of sectors per chunk from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_sectors_per_chunk(
libewf_handle_t *handle,
uint32_t *sectors_per_chunk,
libewf_error_t **error );
/* Sets the amount of sectors per chunk in the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_sectors_per_chunk(
libewf_handle_t *handle,
uint32_t sectors_per_chunk,
libewf_error_t **error );
/* Retrieves the amount of bytes per sector from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_bytes_per_sector(
libewf_handle_t *handle,
uint32_t *bytes_per_sector,
libewf_error_t **error );
/* Sets the amount of bytes per sector in the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_bytes_per_sector(
libewf_handle_t *handle,
uint32_t bytes_per_sector,
libewf_error_t **error );
/* Retrieves the amount of sectors from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_sectors(
libewf_handle_t *handle,
uint64_t *amount_of_sectors,
libewf_error_t **error );
/* Retrieves the chunk size from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_chunk_size(
libewf_handle_t *handle,
size32_t *chunk_size,
libewf_error_t **error );
/* Retrieves the error granularity from the media information
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_error_granularity(
libewf_handle_t *handle,
uint32_t *error_granularity,
libewf_error_t **error );
/* Sets the error granularity
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_error_granularity(
libewf_handle_t *handle,
uint32_t error_granularity,
libewf_error_t **error );
/* Retrieves the compression values
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_compression_values(
libewf_handle_t *handle,
int8_t *compression_level,
uint8_t *compression_flags,
libewf_error_t **error );
/* Sets the compression values
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_compression_values(
libewf_handle_t *handle,
int8_t compression_level,
uint8_t compression_flags,
libewf_error_t **error );
/* Retrieves the size of the contained media data
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_media_size(
libewf_handle_t *handle,
size64_t *media_size,
libewf_error_t **error );
/* Sets the media size
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_media_size(
libewf_handle_t *handle,
size64_t media_size,
libewf_error_t **error );
/* Retrieves the media type value
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_media_type(
libewf_handle_t *handle,
uint8_t *media_type,
libewf_error_t **error );
/* Sets the media type
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_media_type(
libewf_handle_t *handle,
uint8_t media_type,
libewf_error_t **error );
/* Retrieves the media flags
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_media_flags(
libewf_handle_t *handle,
uint8_t *media_flags,
libewf_error_t **error );
/* Sets the media flags
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_media_flags(
libewf_handle_t *handle,
uint8_t media_flags,
libewf_error_t **error );
/* Retrieves the format type value
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_format(
libewf_handle_t *handle,
uint8_t *format,
libewf_error_t **error );
/* Sets the output format
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_format(
libewf_handle_t *handle,
uint8_t format,
libewf_error_t **error );
/* Retrieves the GUID
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_guid(
libewf_handle_t *handle,
uint8_t *guid,
size_t size,
libewf_error_t **error );
/* Sets the GUID
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_guid(
libewf_handle_t *handle,
uint8_t *guid,
size_t size,
libewf_error_t **error );
/* Retrieves the MD5 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_md5_hash(
libewf_handle_t *handle,
uint8_t *md5_hash,
size_t size,
libewf_error_t **error );
/* Sets the MD5 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_md5_hash(
libewf_handle_t *handle,
uint8_t *md5_hash,
size_t size,
libewf_error_t **error );
/* Retrieves the SHA1 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_sha1_hash(
libewf_handle_t *handle,
uint8_t *sha1_hash,
size_t size,
libewf_error_t **error );
/* Sets the SHA1 hash
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_sha1_hash(
libewf_handle_t *handle,
uint8_t *sha1_hash,
size_t size,
libewf_error_t **error );
/* Retrieves the amount of chunks written
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_write_amount_of_chunks(
libewf_handle_t *handle,
uint32_t *amount_of_chunks,
libewf_error_t **error );
/* Sets the read wipe chunk on error
* The chunk is not wiped if read raw is used
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_read_wipe_chunk_on_error(
libewf_handle_t *handle,
uint8_t wipe_on_error,
libewf_error_t **error );
/* Copies the media values from the source to the destination handle
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_copy_media_values(
libewf_handle_t *destination_handle,
libewf_handle_t *source_handle,
libewf_error_t **error );
/* Retrieves the amount of acquiry errors
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_acquiry_errors(
libewf_handle_t *handle,
uint32_t *amount_of_errors,
libewf_error_t **error );
/* Retrieves the information of an acquiry error
* Returns 1 if successful, 0 if no acquiry error could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_acquiry_error(
libewf_handle_t *handle,
uint32_t index,
uint64_t *first_sector,
uint64_t *amount_of_sectors,
libewf_error_t **error );
/* Add an acquiry error
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_add_acquiry_error(
libewf_handle_t *handle,
uint64_t first_sector,
uint64_t amount_of_sectors,
libewf_error_t **error );
/* Retrieves the amount of CRC errors
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_crc_errors(
libewf_handle_t *handle,
uint32_t *amount_of_errors,
libewf_error_t **error );
/* Retrieves the information of a CRC error
* Returns 1 if successful, 0 if no CRC error could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_crc_error(
libewf_handle_t *handle,
uint32_t index,
uint64_t *first_sector,
uint64_t *amount_of_sectors,
libewf_error_t **error );
/* Add a CRC error
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_add_crc_error(
libewf_handle_t *handle,
uint64_t first_sector,
uint64_t amount_of_sectors,
libewf_error_t **error );
/* Retrieves the amount of sessions
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_sessions(
libewf_handle_t *handle,
uint32_t *amount_of_sessions,
libewf_error_t **error );
/* Retrieves the information of a session
* Returns 1 if successful, 0 if no sessions could be found or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_session(
libewf_handle_t *handle,
uint32_t index,
uint64_t *first_sector,
uint64_t *amount_of_sectors,
libewf_error_t **error );
/* Add a session
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_add_session(
libewf_handle_t *handle,
uint64_t first_sector,
uint64_t amount_of_sectors,
libewf_error_t **error );
/* Retrieves the header codepage
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_codepage(
libewf_handle_t *handle,
int *header_codepage,
libewf_error_t **error );
/* Sets the header codepage
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_header_codepage(
libewf_handle_t *handle,
int header_codepage,
libewf_error_t **error );
/* Retrieves the header values date format
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_values_date_format(
libewf_handle_t *handle,
int *date_format,
libewf_error_t **error );
/* Sets the header values date format
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_header_values_date_format(
libewf_handle_t *handle,
int date_format,
libewf_error_t **error );
/* Retrieves the amount of header values
* Returns 1 if successful, 0 if no header values are present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_header_values(
libewf_handle_t *handle,
uint32_t *amount_of_values,
libewf_error_t **error );
/* Retrieves the header value identifier size specified by its index
* The identifier size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_value_identifier_size(
libewf_handle_t *handle,
uint32_t index,
size_t *identifier_size,
libewf_error_t **error );
/* Retrieves the header value identifier specified by its index
* The strings are encoded in UTF-8
* The identifier size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_value_identifier(
libewf_handle_t *handle,
uint32_t index,
uint8_t *identifier,
size_t identifier_size,
libewf_error_t **error );
/* Retrieves the header value size specified by the identifier
* The value size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_value_size(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
size_t *value_size,
libewf_error_t **error );
/* Retrieves the header value specified by the identifier
* The strings are encoded in UTF-8
* The value size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_header_value(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
uint8_t *value,
size_t value_size,
libewf_error_t **error );
/* Retrieves the header value case number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_case_number( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error )
/* Retrieves the header value description
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_description( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "description", 11, value, value_size, error )
/* Retrieves the header value examiner name
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_examiner_name( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error )
/* Retrieves the header value evidence number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_evidence_number( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error )
/* Retrieves the header value notes
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_notes( handle, value, lengt, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error )
/* Retrieves the header value acquiry date
* The string is formatted according to the date format
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_acquiry_date( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error )
/* Retrieves the header value system date
* The string is formatted according to the date format
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_system_date( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error )
/* Retrieves the header value acquiry operating system
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_acquiry_operating_system( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error )
/* Retrieves the header value acquiry software version
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_acquiry_software_version( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error )
/* Retrieves the header value password
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_password( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "password", 8, value, value_size, error )
/* Retrieves the header value compression type
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_compression_type( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error )
/* Retrieves the header value model
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_model( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "model", 5, value, value_size, error )
/* Retrieves the header value serial number
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_header_value_serial_number( handle, value, value_size, error ) \
libewf_handle_get_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error )
/* Sets the header value specified by the identifier
* The strings are encoded in UTF-8
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_header_value(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
const uint8_t *value,
size_t value_length,
libewf_error_t **error );
/* Sets the header value case number
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_case_number( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error )
/* Sets the header value description
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_description( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "description", 11, value, value_length, error )
/* Sets the header value examiner name
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_examiner_name( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error )
/* Sets the header value evidence number
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_evidence_number( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error )
/* Sets the header value notes
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_notes( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error )
/* Sets the header value acquiry date
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_acquiry_date( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error )
/* Sets the header value system date
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_system_date( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error )
/* Sets the header value acquiry operating system
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_acquiry_operating_system( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error )
/* Sets the header value acquiry software version
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_acquiry_software_version( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error )
/* Sets the header value password
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_password( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "password", 8, value, value_length, error )
/* Sets the header value compression type
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_compression_type( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error )
/* Sets the header value model
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_model( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "model", 5, value, value_length, error )
/* Sets the header value serial number
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_header_value_serial_number( handle, value, value_length, error ) \
libewf_handle_set_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error )
/* Copies the header values from the source to the destination handle
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_copy_header_values(
libewf_handle_t *destination_handle,
libewf_handle_t *source_handle,
libewf_error_t **error );
/* Retrieves the amount of hash values
* Returns 1 if successful, 0 if no hash values are present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_amount_of_hash_values(
libewf_handle_t *handle,
uint32_t *amount_of_values,
libewf_error_t **error );
/* Retrieves the hash value identifier size specified by its index
* The identifier size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_hash_value_identifier_size(
libewf_handle_t *handle,
uint32_t index,
size_t *identifier_size,
libewf_error_t **error );
/* Retrieves the hash value identifier specified by its index
* The strings are encoded in UTF-8
* The identifier size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_hash_value_identifier(
libewf_handle_t *handle,
uint32_t index,
uint8_t *identifier,
size_t identifier_size,
libewf_error_t **error );
/* Retrieves the hash value size specified by the identifier
* The value size includes the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_hash_value_size(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
size_t *value_size,
libewf_error_t **error );
/* Retrieves the hash value specified by the identifier
* The strings are encoded in UTF-8
* The value size should include the end of string character
* Returns 1 if successful, 0 if value not present or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_get_hash_value(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
uint8_t *value,
size_t value_size,
libewf_error_t **error );
/* Retrieves the hash value MD5
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_hash_value_md5( handle, value, value_size, error ) \
libewf_handle_get_hash_value( handle, "MD5", 3, value, value_size, error )
/* Retrieves the hash value SHA1
* Returns 1 if successful, 0 if value not present or -1 on error
*/
#define libewf_handle_get_hash_value_sha1( handle, value, value_size, error ) \
libewf_handle_get_hash_value( handle, "SHA1", 4, value, value_size, error )
/* Sets the hash value specified by the identifier
* The strings are encoded in UTF-8
* Returns 1 if successful or -1 on error
*/
LIBEWF_EXTERN int libewf_handle_set_hash_value(
libewf_handle_t *handle,
const uint8_t *identifier,
size_t identifier_length,
const uint8_t *value,
size_t value_length,
libewf_error_t **error );
/* Sets the hash value MD5
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_hash_value_md5( handle, value, value_length, error ) \
libewf_handle_set_hash_value( handle, "MD5", 3, value, value_length, error )
/* Sets the hash value SHA1
* Returns 1 if successful or -1 on error
*/
#define libewf_handle_set_hash_value_sha1( handle, value, value_length, error ) \
libewf_handle_set_hash_value( handle, "SHA1", 4, value, value_length, error )
#endif
#ifdef __cplusplus
}
#endif
#endif
|