1 /* 2 * Library to access the Expert Witness Compression Format (EWF) 3 * 4 * Copyright (c) 2006-2014, Joachim Metz <joachim.metz@gmail.com> 5 * 6 * Refer to AUTHORS for acknowledgements. 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU Lesser General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU Lesser General Public License 19 * along with this program. If not, see <https://www.gnu.org/licenses/>. 20 */ 21 22 #if !defined( _LIBEWF_H ) 23 #define _LIBEWF_H 24 25 #include <libewf/codepage.h> 26 #include <libewf/definitions.h> 27 #include <libewf/error.h> 28 #include <libewf/extern.h> 29 #include <libewf/features.h> 30 #include <libewf/types.h> 31 32 #include <stdio.h> 33 34 #if defined( LIBEWF_HAVE_BFIO ) 35 #include <libbfio.h> 36 #endif 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 41 42 /* ------------------------------------------------------------------------- 43 * Support functions 44 * ------------------------------------------------------------------------- */ 45 46 /* Returns the library version 47 */ 48 LIBEWF_EXTERN \ 49 const char *libewf_get_version( 50 void ); 51 52 /* Returns the access flags for reading 53 */ 54 LIBEWF_EXTERN \ 55 int libewf_get_access_flags_read( 56 void ); 57 58 /* Returns the access flags for reading and writing 59 */ 60 LIBEWF_EXTERN \ 61 int libewf_get_access_flags_read_write( 62 void ); 63 64 /* Returns the access flags for writing 65 */ 66 LIBEWF_EXTERN \ 67 int libewf_get_access_flags_write( 68 void ); 69 70 /* Returns the access flags for resume writing 71 */ 72 LIBEWF_EXTERN \ 73 int libewf_get_access_flags_write_resume( 74 void ); 75 76 /* Retrieves the narrow system string codepage 77 * A value of 0 represents no codepage, UTF-8 encoding is used instead 78 * Returns 1 if successful or -1 on error 79 */ 80 LIBEWF_EXTERN \ 81 int libewf_get_codepage( 82 int *codepage, 83 libewf_error_t **error ); 84 85 /* Sets the narrow system string codepage 86 * A value of 0 represents no codepage, UTF-8 encoding is used instead 87 * Returns 1 if successful or -1 on error 88 */ 89 LIBEWF_EXTERN \ 90 int libewf_set_codepage( 91 int codepage, 92 libewf_error_t **error ); 93 94 /* Determines if a file is an EWF file (check for the EWF file signature) 95 * Returns 1 if true, 0 if not or -1 on error 96 */ 97 LIBEWF_EXTERN \ 98 int libewf_check_file_signature( 99 const char *filename, 100 libewf_error_t **error ); 101 102 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 103 /* Determines if a file is an EWF file (check for the EWF file signature) 104 * Returns 1 if true, 0 if not or -1 on error 105 */ 106 LIBEWF_EXTERN \ 107 int libewf_check_file_signature_wide( 108 const wchar_t *filename, 109 libewf_error_t **error ); 110 #endif 111 112 #if defined( LIBEWF_HAVE_BFIO ) 113 /* Determines if a file is an EWF file (check for the EWF file signature) using a Basic File IO (bfio) handle 114 * Returns 1 if true, 0 if not or -1 on error 115 */ 116 LIBEWF_EXTERN \ 117 int libewf_check_file_signature_file_io_handle( 118 libbfio_handle_t *file_io_handle, 119 libewf_error_t **error ); 120 #endif 121 122 /* Globs the segment files according to the EWF naming schema 123 * if the format is known the filename should contain the base of the filename 124 * otherwise the function will try to determine the format based on the extension 125 * Returns 1 if successful or -1 on error 126 */ 127 LIBEWF_EXTERN \ 128 int libewf_glob( 129 const char *filename, 130 size_t filename_length, 131 uint8_t format, 132 char **filenames[], 133 int *number_of_filenames, 134 libewf_error_t **error ); 135 136 /* Frees the globbed filenames 137 * Returns 1 if successful or -1 on error 138 */ 139 LIBEWF_EXTERN \ 140 int libewf_glob_free( 141 char *filenames[], 142 int number_of_filenames, 143 libewf_error_t **error ); 144 145 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 146 /* Globs the segment files according to the EWF naming schema 147 * if the format is known the filename should contain the base of the filename 148 * otherwise the function will try to determine the format based on the extension 149 * Returns 1 if successful or -1 on error 150 */ 151 LIBEWF_EXTERN \ 152 int libewf_glob_wide( 153 const wchar_t *filename, 154 size_t filename_length, 155 uint8_t format, 156 wchar_t **filenames[], 157 int *number_of_filenames, 158 libewf_error_t **error ); 159 160 /* Frees the globbed wide filenames 161 * Returns 1 if successful or -1 on error 162 */ 163 LIBEWF_EXTERN \ 164 int libewf_glob_wide_free( 165 wchar_t *filenames[], 166 int number_of_filenames, 167 libewf_error_t **error ); 168 #endif 169 170 /* ------------------------------------------------------------------------- 171 * Support functions - deprecated 172 * ------------------------------------------------------------------------- */ 173 174 /* Returns the flags for reading 175 * 176 * This function deprecated use libewf_get_access_flags_read instead 177 */ 178 LIBEWF_DEPRECATED \ 179 LIBEWF_EXTERN \ 180 uint8_t libewf_get_flags_read( 181 void ); 182 183 /* Returns the flags for reading and writing 184 * 185 * This function deprecated use libewf_get_access_flags_read_write instead 186 */ 187 LIBEWF_DEPRECATED \ 188 LIBEWF_EXTERN \ 189 uint8_t libewf_get_flags_read_write( 190 void ); 191 192 /* Returns the flags for writing 193 * 194 * This function deprecated use libewf_get_access_flags_write instead 195 */ 196 LIBEWF_DEPRECATED \ 197 LIBEWF_EXTERN \ 198 uint8_t libewf_get_flags_write( 199 void ); 200 201 /* Returns the flags for resume writing 202 * 203 * This function deprecated use libewf_get_access_flags_write_resume instead 204 */ 205 LIBEWF_DEPRECATED \ 206 LIBEWF_EXTERN \ 207 uint8_t libewf_get_flags_write_resume( 208 void ); 209 210 /* ------------------------------------------------------------------------- 211 * Notify functions 212 * ------------------------------------------------------------------------- */ 213 214 /* Sets the verbose notification 215 */ 216 LIBEWF_EXTERN \ 217 void libewf_notify_set_verbose( 218 int verbose ); 219 220 /* Sets the notification stream 221 * Returns 1 if successful or -1 on error 222 */ 223 LIBEWF_EXTERN \ 224 int libewf_notify_set_stream( 225 FILE *stream, 226 libewf_error_t **error ); 227 228 /* Opens the notification stream using a filename 229 * The stream is opened in append mode 230 * Returns 1 if successful or -1 on error 231 */ 232 LIBEWF_EXTERN \ 233 int libewf_notify_stream_open( 234 const char *filename, 235 libewf_error_t **error ); 236 237 /* Closes the notification stream if opened using a filename 238 * Returns 0 if successful or -1 on error 239 */ 240 LIBEWF_EXTERN \ 241 int libewf_notify_stream_close( 242 libewf_error_t **error ); 243 244 /* ------------------------------------------------------------------------- 245 * Error functions 246 * ------------------------------------------------------------------------- */ 247 248 /* Frees the error including elements 249 */ 250 LIBEWF_EXTERN \ 251 void libewf_error_free( 252 libewf_error_t **error ); 253 254 /* Prints a descriptive string of the error to the stream 255 * Returns the number of printed characters if successful or -1 on error 256 */ 257 LIBEWF_EXTERN \ 258 int libewf_error_fprint( 259 libewf_error_t *error, 260 FILE *stream ); 261 262 /* Prints a descriptive string of the error to the string 263 * The end-of-string character is not included in the return value 264 * Returns the number of printed characters if successful or -1 on error 265 */ 266 LIBEWF_EXTERN \ 267 int libewf_error_sprint( 268 libewf_error_t *error, 269 char *string, 270 size_t size ); 271 272 /* Prints a backtrace of the error to the stream 273 * Returns the number of printed characters if successful or -1 on error 274 */ 275 LIBEWF_EXTERN \ 276 int libewf_error_backtrace_fprint( 277 libewf_error_t *error, 278 FILE *stream ); 279 280 /* Prints a backtrace of the error to the string 281 * The end-of-string character is not included in the return value 282 * Returns the number of printed characters if successful or -1 on error 283 */ 284 LIBEWF_EXTERN \ 285 int libewf_error_backtrace_sprint( 286 libewf_error_t *error, 287 char *string, 288 size_t size ); 289 290 /* ------------------------------------------------------------------------- 291 * File/Handle functions 292 * ------------------------------------------------------------------------- */ 293 294 /* Initialize the handle 295 * The handle must point to a NULL pointer to be allocated 296 * Returns 1 if successful or -1 on error 297 */ 298 LIBEWF_EXTERN \ 299 int libewf_handle_initialize( 300 libewf_handle_t **handle, 301 libewf_error_t **error ); 302 303 /* Frees the handle including elements 304 * Returns 1 if successful or -1 on error 305 */ 306 LIBEWF_EXTERN \ 307 int libewf_handle_free( 308 libewf_handle_t **handle, 309 libewf_error_t **error ); 310 311 /* Clones the handle including elements 312 * Returns 1 if successful or -1 on error 313 */ 314 LIBEWF_EXTERN \ 315 int libewf_handle_clone( 316 libewf_handle_t **destination_handle, 317 libewf_handle_t *source_handle, 318 libewf_error_t **error ); 319 320 /* Signals the handle to abort its current activity 321 * Returns 1 if successful or -1 on error 322 */ 323 LIBEWF_EXTERN \ 324 int libewf_handle_signal_abort( 325 libewf_handle_t *handle, 326 libewf_error_t **error ); 327 328 /* Opens a set of EWF file(s) 329 * For reading files should contain all filenames that make up an EWF image 330 * For writing files should contain the base of the filename, extentions like .e01 will be automatically added 331 * Returns 1 if successful or -1 on error 332 */ 333 LIBEWF_EXTERN \ 334 int libewf_handle_open( 335 libewf_handle_t *handle, 336 char * const filenames[], 337 int number_of_filenames, 338 int access_flags, 339 libewf_error_t **error ); 340 341 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 342 /* Opens a set of EWF file(s) 343 * For reading files should contain all filenames that make up an EWF image 344 * For writing files should contain the base of the filename, extentions like .e01 will be automatically added 345 * Returns 1 if successful or -1 on error 346 */ 347 LIBEWF_EXTERN \ 348 int libewf_handle_open_wide( 349 libewf_handle_t *handle, 350 wchar_t * const filenames[], 351 int number_of_filenames, 352 int access_flags, 353 libewf_error_t **error ); 354 #endif 355 356 #if defined( LIBEWF_HAVE_BFIO ) 357 /* Opens a set of EWF file(s) using a Basic File IO (bfio) pool 358 * Returns 1 if successful or -1 on error 359 */ 360 LIBEWF_EXTERN \ 361 int libewf_handle_open_file_io_pool( 362 libewf_handle_t *handle, 363 libbfio_pool_t *file_io_pool, 364 int access_flags, 365 libewf_error_t **error ); 366 #endif 367 368 /* Closes the EWF handle 369 * Returns 0 if successful or -1 on error 370 */ 371 LIBEWF_EXTERN \ 372 int libewf_handle_close( 373 libewf_handle_t *handle, 374 libewf_error_t **error ); 375 376 /* Prepares chunk of (media) data after reading it according to the handle settings 377 * It applies decompression if necessary and validates the chunk checksum 378 * This function should be used after libewf_handle_read_chunk 379 * The value chunk_buffer_size contains the size of the chunk 380 * Returns the resulting chunk size or -1 on error 381 */ 382 LIBEWF_EXTERN \ 383 ssize_t libewf_handle_prepare_read_chunk( 384 libewf_handle_t *handle, 385 void *chunk_buffer, 386 size_t chunk_buffer_size, 387 void *uncompressed_chunk_buffer, 388 size_t *uncompressed_chunk_buffer_size, 389 int8_t is_compressed, 390 uint32_t chunk_checksum, 391 int8_t read_checksum, 392 libewf_error_t **error ); 393 394 /* Reads a chunk of (media) data from the current offset into a buffer 395 * Will read until the requested size is filled or the entire chunk is read 396 * The values read_checksum and chunk_checksum are used for uncompressed chunks only 397 * The value chunk_checksum is set to a runtime version of the value in the checksum_buffer 398 * The value read_checksum is set if the checksum has been read into checksum_buffer 399 * The value chunk_buffer_size contains the size of the chunk buffer 400 * Returns the number of bytes read or -1 on error 401 */ 402 LIBEWF_EXTERN \ 403 ssize_t libewf_handle_read_chunk( 404 libewf_handle_t *handle, 405 void *chunk_buffer, 406 size_t chunk_buffer_size, 407 int8_t *is_compressed, 408 void *checksum_buffer, 409 uint32_t *chunk_checksum, 410 int8_t *read_checksum, 411 libewf_error_t **error ); 412 413 /* Reads (media) data at the current offset into a buffer 414 * Returns the number of bytes read or -1 on error 415 */ 416 LIBEWF_EXTERN \ 417 ssize_t libewf_handle_read_buffer( 418 libewf_handle_t *handle, 419 void *buffer, 420 size_t buffer_size, 421 libewf_error_t **error ); 422 423 /* Reads (media) data at a specific offset 424 * Returns the number of bytes read or -1 on error 425 */ 426 LIBEWF_EXTERN \ 427 ssize_t libewf_handle_read_random( 428 libewf_handle_t *handle, 429 void *buffer, 430 size_t buffer_size, 431 off64_t offset, 432 libewf_error_t **error ); 433 434 /* Prepares a chunk of (media) data before writing according to the handle settings 435 * This function should be used before libewf_handle_write_chunk 436 * The chunk_buffer_size should contain the actual chunk size 437 * The function sets the chunk checksum, is compressed and write checksum values 438 * Returns the resulting chunk size or -1 on error 439 */ 440 LIBEWF_EXTERN \ 441 ssize_t libewf_handle_prepare_write_chunk( 442 libewf_handle_t *handle, 443 void *buffer, 444 size_t buffer_size, 445 void *compressed_chunk_buffer, 446 size_t *compressed_chunk_buffer_size, 447 int8_t *is_compressed, 448 uint32_t *chunk_checksum, 449 int8_t *write_checksum, 450 libewf_error_t **error ); 451 452 /* Writes a chunk of (media) data in EWF format at the current offset 453 * the necessary settings of the write values must have been made 454 * chunk_buffer_size contains the size of the data within the buffer while 455 * data_size contains the size of the actual input data 456 * Will initialize write if necessary 457 * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error 458 */ 459 LIBEWF_EXTERN \ 460 ssize_t libewf_handle_write_chunk( 461 libewf_handle_t *handle, 462 const void *chunk_buffer, 463 size_t chunk_buffer_size, 464 size_t data_size, 465 int8_t is_compressed, 466 void *checksum_buffer, 467 uint32_t chunk_checksum, 468 int8_t write_checksum, 469 libewf_error_t **error ); 470 471 /* Writes (media) data at the current offset 472 * the necessary settings of the write values must have been made 473 * Will initialize write if necessary 474 * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error 475 */ 476 LIBEWF_EXTERN \ 477 ssize_t libewf_handle_write_buffer( 478 libewf_handle_t *handle, 479 const void *buffer, 480 size_t buffer_size, 481 libewf_error_t **error ); 482 483 /* Writes (media) data at a specific offset, 484 * the necessary settings of the write values must have been made 485 * Will initialize write if necessary 486 * Returns the number of input bytes written, 0 when no longer bytes can be written or -1 on error 487 */ 488 LIBEWF_EXTERN \ 489 ssize_t libewf_handle_write_random( 490 libewf_handle_t *handle, 491 const void *buffer, 492 size_t buffer_size, 493 off64_t offset, 494 libewf_error_t **error ); 495 496 /* Finalizes the write by correcting the EWF the meta data in the segment files 497 * This function is required after writing from stream 498 * Returns the number of input bytes written or -1 on error 499 */ 500 LIBEWF_EXTERN \ 501 ssize_t libewf_handle_write_finalize( 502 libewf_handle_t *handle, 503 libewf_error_t **error ); 504 505 /* Seeks a certain offset of the (media) data 506 * Returns the offset if seek is successful or -1 on error 507 */ 508 LIBEWF_EXTERN \ 509 off64_t libewf_handle_seek_offset( 510 libewf_handle_t *handle, 511 off64_t offset, 512 int whence, 513 libewf_error_t **error ); 514 515 /* Retrieves the current offset of the (media) data 516 * Returns the offset if successful or -1 on error 517 */ 518 LIBEWF_EXTERN \ 519 int libewf_handle_get_offset( 520 libewf_handle_t *handle, 521 off64_t *offset, 522 libewf_error_t **error ); 523 524 /* Sets the maximum number of (concurrent) open file handles 525 * Returns 1 if successful or -1 on error 526 */ 527 LIBEWF_EXTERN \ 528 int libewf_handle_set_maximum_number_of_open_handles( 529 libewf_handle_t *handle, 530 int maximum_number_of_open_handles, 531 libewf_error_t **error ); 532 533 /* Retrieves the segment filename size 534 * The filename size includes the end of string character 535 * Returns 1 if successful, 0 if value not present or -1 on error 536 */ 537 LIBEWF_EXTERN \ 538 int libewf_handle_get_segment_filename_size( 539 libewf_handle_t *handle, 540 size_t *filename_size, 541 libewf_error_t **error ); 542 543 /* Retrieves the segment filename 544 * The filename size should include the end of string character 545 * Returns 1 if successful, 0 if value not present or -1 on error 546 */ 547 LIBEWF_EXTERN \ 548 int libewf_handle_get_segment_filename( 549 libewf_handle_t *handle, 550 char *filename, 551 size_t filename_size, 552 libewf_error_t **error ); 553 554 /* Sets the segment filename 555 * Returns 1 if successful or -1 on error 556 */ 557 LIBEWF_EXTERN \ 558 int libewf_handle_set_segment_filename( 559 libewf_handle_t *handle, 560 const char *filename, 561 size_t filename_length, 562 libewf_error_t **error ); 563 564 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 565 /* Retrieves the segment filename size 566 * The filename size includes the end of string character 567 * Returns 1 if successful, 0 if value not present or -1 on error 568 */ 569 LIBEWF_EXTERN \ 570 int libewf_handle_get_segment_filename_size_wide( 571 libewf_handle_t *handle, 572 size_t *filename_size, 573 libewf_error_t **error ); 574 575 /* Retrieves the segment filename 576 * The filename size should include the end of string character 577 * Returns 1 if successful, 0 if value not present or -1 on error 578 */ 579 LIBEWF_EXTERN \ 580 int libewf_handle_get_segment_filename_wide( 581 libewf_handle_t *handle, 582 wchar_t *filename, 583 size_t filename_size, 584 libewf_error_t **error ); 585 586 /* Sets the segment filename 587 * Returns 1 if successful or -1 on error 588 */ 589 LIBEWF_EXTERN \ 590 int libewf_handle_set_segment_filename_wide( 591 libewf_handle_t *handle, 592 const wchar_t *filename, 593 size_t filename_length, 594 libewf_error_t **error ); 595 #endif 596 597 /* Retrieves the maximum segment file size 598 * Returns 1 if successful or -1 on error 599 */ 600 LIBEWF_EXTERN \ 601 int libewf_handle_get_maximum_segment_size( 602 libewf_handle_t *handle, 603 size64_t *maximum_segment_size, 604 libewf_error_t **error ); 605 606 /* Sets the maximum segment file size 607 * A maximum segment file size of 0 represents the maximum possible size for the format 608 * If the maximum segment file size is smaller than the size needed to store a single chunk 609 * the size off the latter is enforced and not the maximum segment file size 610 * Returns 1 if successful or -1 on error 611 */ 612 LIBEWF_EXTERN \ 613 int libewf_handle_set_maximum_segment_size( 614 libewf_handle_t *handle, 615 size64_t maximum_segment_size, 616 libewf_error_t **error ); 617 618 /* Retrieves the delta segment filename size 619 * The filename size includes the end of string character 620 * Returns 1 if successful, 0 if value not present or -1 on error 621 */ 622 LIBEWF_EXTERN \ 623 int libewf_handle_get_delta_segment_filename_size( 624 libewf_handle_t *handle, 625 size_t *filename_size, 626 libewf_error_t **error ); 627 628 /* Retrieves the delta segment filename 629 * The filename size should include the end of string character 630 * Returns 1 if successful, 0 if value not present or -1 on error 631 */ 632 LIBEWF_EXTERN \ 633 int libewf_handle_get_delta_segment_filename( 634 libewf_handle_t *handle, 635 char *filename, 636 size_t filename_size, 637 libewf_error_t **error ); 638 639 /* Sets the delta segment filename 640 * Returns 1 if successful or -1 on error 641 */ 642 LIBEWF_EXTERN \ 643 int libewf_handle_set_delta_segment_filename( 644 libewf_handle_t *handle, 645 const char *filename, 646 size_t filename_length, 647 libewf_error_t **error ); 648 649 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 650 /* Retrieves the delta segment filename size 651 * The filename size includes the end of string character 652 * Returns 1 if successful, 0 if value not present or -1 on error 653 */ 654 LIBEWF_EXTERN \ 655 int libewf_handle_get_delta_segment_filename_size_wide( 656 libewf_handle_t *handle, 657 size_t *filename_size, 658 libewf_error_t **error ); 659 660 /* Retrieves the delta segment filename 661 * The filename size should include the end of string character 662 * Returns 1 if successful, 0 if value not present or -1 on error 663 */ 664 LIBEWF_EXTERN \ 665 int libewf_handle_get_delta_segment_filename_wide( 666 libewf_handle_t *handle, 667 wchar_t *filename, 668 size_t filename_size, 669 libewf_error_t **error ); 670 671 /* Sets the delta segment filename 672 * Returns 1 if successful or -1 on error 673 */ 674 LIBEWF_EXTERN \ 675 int libewf_handle_set_delta_segment_filename_wide( 676 libewf_handle_t *handle, 677 const wchar_t *filename, 678 size_t filename_length, 679 libewf_error_t **error ); 680 #endif 681 682 /* Retrieves the maximum delta segment file size 683 * Returns 1 if successful or -1 on error 684 */ 685 LIBEWF_EXTERN \ 686 int libewf_handle_get_maximum_delta_segment_size( 687 libewf_handle_t *handle, 688 size64_t *maximum_delta_segment_size, 689 libewf_error_t **error ); 690 691 /* Sets the maximum delta segment file size 692 * Returns 1 if successful or -1 on error 693 */ 694 LIBEWF_EXTERN \ 695 int libewf_handle_set_maximum_delta_segment_size( 696 libewf_handle_t *handle, 697 size64_t maximum_delta_segment_size, 698 libewf_error_t **error ); 699 700 /* Determine if the segment files are corrupted 701 * Returns 1 if corrupted, 0 if not or -1 on error 702 */ 703 LIBEWF_EXTERN \ 704 int libewf_handle_segment_files_corrupted( 705 libewf_handle_t *handle, 706 libewf_error_t **error ); 707 708 /* Retrieves the filename size of the (delta) segment file of the current chunk 709 * The filename size includes the end of string character 710 * Returns 1 if successful, 0 if no such filename or -1 on error 711 */ 712 LIBEWF_EXTERN \ 713 int libewf_handle_get_filename_size( 714 libewf_handle_t *handle, 715 size_t *filename_size, 716 libewf_error_t **error ); 717 718 /* Retrieves the filename of the (delta) segment file of the current chunk 719 * The filename size should include the end of string character 720 * Returns 1 if successful, 0 if no such filename or -1 on error 721 */ 722 LIBEWF_EXTERN \ 723 int libewf_handle_get_filename( 724 libewf_handle_t *handle, 725 char *filename, 726 size_t filename_size, 727 libewf_error_t **error ); 728 729 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 730 /* Retrieves the filename size of the (delta) segment file of the current chunk 731 * The filename size includes the end of string character 732 * Returns 1 if successful, 0 if no such filename or -1 on error 733 */ 734 LIBEWF_EXTERN \ 735 int libewf_handle_get_filename_size_wide( 736 libewf_handle_t *handle, 737 size_t *filename_size, 738 libewf_error_t **error ); 739 740 /* Retrieves the filename of the (delta) segment file of the current chunk 741 * The filename size should include the end of string character 742 * Returns 1 if successful, 0 if no such filename or -1 on error 743 */ 744 LIBEWF_EXTERN \ 745 int libewf_handle_get_filename_wide( 746 libewf_handle_t *handle, 747 wchar_t *filename, 748 size_t filename_size, 749 libewf_error_t **error ); 750 #endif 751 752 #if defined( LIBEWF_HAVE_BFIO ) 753 /* Retrieves the file IO handle of the (delta) segment file of the current chunk 754 * Returns 1 if successful, 0 if no such file IO handle or -1 on error 755 */ 756 LIBEWF_EXTERN \ 757 int libewf_handle_get_file_io_handle( 758 libewf_handle_t *handle, 759 libbfio_handle_t **file_io_handle, 760 libewf_error_t **error ); 761 #endif 762 763 /* ------------------------------------------------------------------------- 764 * File/Handle functions - deprecated 765 * ------------------------------------------------------------------------- */ 766 767 /* Sets the maximum amount of (concurrent) open file handles 768 * Returns 1 if successful or -1 on error 769 * 770 * This function deprecated use libewf_handle_set_maximum_number_of_open_handles instead 771 */ 772 LIBEWF_DEPRECATED \ 773 LIBEWF_EXTERN \ 774 int libewf_handle_set_maximum_amount_of_open_handles( 775 libewf_handle_t *handle, 776 int maximum_amount_of_open_handles, 777 libewf_error_t **error ); 778 779 /* Retrieves the amount of sectors 780 * Returns 1 if successful or -1 on error 781 * 782 * This function deprecated use libewf_handle_get_number_of_sectors instead 783 */ 784 LIBEWF_DEPRECATED \ 785 LIBEWF_EXTERN \ 786 int libewf_handle_get_amount_of_sectors( 787 libewf_handle_t *handle, 788 uint64_t *amount_of_sectors, 789 libewf_error_t **error ); 790 791 /* Retrieves the amount of chunks written 792 * Returns 1 if successful or -1 on error 793 * 794 * This function deprecated use libewf_handle_get_number_of_chunks_written instead 795 */ 796 LIBEWF_DEPRECATED \ 797 LIBEWF_EXTERN \ 798 int libewf_handle_get_write_amount_of_chunks( 799 libewf_handle_t *handle, 800 uint32_t *amount_of_chunks, 801 libewf_error_t **error ); 802 803 /* Retrieves the segment file size 804 * Returns 1 if successful or -1 on error 805 * 806 * This function deprecated use libewf_handle_get_maximum_segment_size instead 807 */ 808 LIBEWF_DEPRECATED \ 809 LIBEWF_EXTERN \ 810 int libewf_handle_get_segment_file_size( 811 libewf_handle_t *handle, 812 size64_t *segment_file_size, 813 libewf_error_t **error ); 814 815 /* Sets the segment file size 816 * Returns 1 if successful or -1 on error 817 * 818 * This function deprecated use libewf_handle_set_maximum_segment_size instead 819 */ 820 LIBEWF_DEPRECATED \ 821 LIBEWF_EXTERN \ 822 int libewf_handle_set_segment_file_size( 823 libewf_handle_t *handle, 824 size64_t segment_file_size, 825 libewf_error_t **error ); 826 827 /* Retrieves the delta segment file size 828 * Returns 1 if successful or -1 on error 829 * 830 * This function deprecated use libewf_handle_get_maximum_delta_segment_size instead 831 */ 832 LIBEWF_DEPRECATED \ 833 LIBEWF_EXTERN \ 834 int libewf_handle_get_delta_segment_file_size( 835 libewf_handle_t *handle, 836 size64_t *delta_segment_file_size, 837 libewf_error_t **error ); 838 839 /* Sets the delta segment file size 840 * Returns 1 if successful or -1 on error 841 * 842 * This function deprecated use libewf_handle_set_maximum_delta_segment_size instead 843 */ 844 LIBEWF_DEPRECATED \ 845 LIBEWF_EXTERN \ 846 int libewf_handle_set_delta_segment_file_size( 847 libewf_handle_t *handle, 848 size64_t delta_segment_file_size, 849 libewf_error_t **error ); 850 851 /* ------------------------------------------------------------------------- 852 * Meta data functions 853 * ------------------------------------------------------------------------- */ 854 855 /* Retrieves the number of sectors per chunk 856 * Returns 1 if successful or -1 on error 857 */ 858 LIBEWF_EXTERN \ 859 int libewf_handle_get_sectors_per_chunk( 860 libewf_handle_t *handle, 861 uint32_t *sectors_per_chunk, 862 libewf_error_t **error ); 863 864 /* Sets the number of sectors per chunk 865 * Returns 1 if successful or -1 on error 866 */ 867 LIBEWF_EXTERN \ 868 int libewf_handle_set_sectors_per_chunk( 869 libewf_handle_t *handle, 870 uint32_t sectors_per_chunk, 871 libewf_error_t **error ); 872 873 /* Retrieves the number of bytes per sector 874 * Returns 1 if successful or -1 on error 875 */ 876 LIBEWF_EXTERN \ 877 int libewf_handle_get_bytes_per_sector( 878 libewf_handle_t *handle, 879 uint32_t *bytes_per_sector, 880 libewf_error_t **error ); 881 882 /* Sets the number of bytes per sector 883 * Returns 1 if successful or -1 on error 884 */ 885 LIBEWF_EXTERN \ 886 int libewf_handle_set_bytes_per_sector( 887 libewf_handle_t *handle, 888 uint32_t bytes_per_sector, 889 libewf_error_t **error ); 890 891 /* Retrieves the number of sectors 892 * Returns 1 if successful or -1 on error 893 */ 894 LIBEWF_EXTERN \ 895 int libewf_handle_get_number_of_sectors( 896 libewf_handle_t *handle, 897 uint64_t *number_of_sectors, 898 libewf_error_t **error ); 899 900 /* Retrieves the chunk size 901 * Returns 1 if successful or -1 on error 902 */ 903 LIBEWF_EXTERN \ 904 int libewf_handle_get_chunk_size( 905 libewf_handle_t *handle, 906 size32_t *chunk_size, 907 libewf_error_t **error ); 908 909 /* Retrieves the error granularity 910 * Returns 1 if successful or -1 on error 911 */ 912 LIBEWF_EXTERN \ 913 int libewf_handle_get_error_granularity( 914 libewf_handle_t *handle, 915 uint32_t *error_granularity, 916 libewf_error_t **error ); 917 918 /* Sets the error granularity 919 * Returns 1 if successful or -1 on error 920 */ 921 LIBEWF_EXTERN \ 922 int libewf_handle_set_error_granularity( 923 libewf_handle_t *handle, 924 uint32_t error_granularity, 925 libewf_error_t **error ); 926 927 /* Retrieves the compression values 928 * Returns 1 if successful or -1 on error 929 */ 930 LIBEWF_EXTERN \ 931 int libewf_handle_get_compression_values( 932 libewf_handle_t *handle, 933 int8_t *compression_level, 934 uint8_t *compression_flags, 935 libewf_error_t **error ); 936 937 /* Sets the compression values 938 * Returns 1 if successful or -1 on error 939 */ 940 LIBEWF_EXTERN \ 941 int libewf_handle_set_compression_values( 942 libewf_handle_t *handle, 943 int8_t compression_level, 944 uint8_t compression_flags, 945 libewf_error_t **error ); 946 947 /* Retrieves the size of the contained (media) data 948 * This function will compensate for a media_size that is not a multitude of bytes_per_sector 949 * Returns 1 if successful or -1 on error 950 */ 951 LIBEWF_EXTERN \ 952 int libewf_handle_get_media_size( 953 libewf_handle_t *handle, 954 size64_t *media_size, 955 libewf_error_t **error ); 956 957 /* Sets the media size 958 * The media_size is stored as number_of_sectors x bytes_per_sector 959 * Returns 1 if successful or -1 on error 960 */ 961 LIBEWF_EXTERN \ 962 int libewf_handle_set_media_size( 963 libewf_handle_t *handle, 964 size64_t media_size, 965 libewf_error_t **error ); 966 967 /* Retrieves the media type value 968 * Returns 1 if successful or -1 on error 969 */ 970 LIBEWF_EXTERN \ 971 int libewf_handle_get_media_type( 972 libewf_handle_t *handle, 973 uint8_t *media_type, 974 libewf_error_t **error ); 975 976 /* Sets the media type 977 * Returns 1 if successful or -1 on error 978 */ 979 LIBEWF_EXTERN \ 980 int libewf_handle_set_media_type( 981 libewf_handle_t *handle, 982 uint8_t media_type, 983 libewf_error_t **error ); 984 985 /* Retrieves the media flags 986 * Returns 1 if successful or -1 on error 987 */ 988 LIBEWF_EXTERN \ 989 int libewf_handle_get_media_flags( 990 libewf_handle_t *handle, 991 uint8_t *media_flags, 992 libewf_error_t **error ); 993 994 /* Sets the media flags 995 * Returns 1 if successful or -1 on error 996 */ 997 LIBEWF_EXTERN \ 998 int libewf_handle_set_media_flags( 999 libewf_handle_t *handle, 1000 uint8_t media_flags, 1001 libewf_error_t **error ); 1002 1003 /* Retrieves the format type value 1004 * Returns 1 if successful or -1 on error 1005 */ 1006 LIBEWF_EXTERN \ 1007 int libewf_handle_get_format( 1008 libewf_handle_t *handle, 1009 uint8_t *format, 1010 libewf_error_t **error ); 1011 1012 /* Sets the output format 1013 * Returns 1 if successful or -1 on error 1014 */ 1015 LIBEWF_EXTERN \ 1016 int libewf_handle_set_format( 1017 libewf_handle_t *handle, 1018 uint8_t format, 1019 libewf_error_t **error ); 1020 1021 /* Retrieves the segment file set identifier 1022 * The identifier is a GUID and is 16 bytes of size 1023 * Returns 1 if successful or -1 on error 1024 */ 1025 LIBEWF_EXTERN \ 1026 int libewf_handle_get_segment_file_set_identifier( 1027 libewf_handle_t *handle, 1028 uint8_t *set_identifier, 1029 size_t size, 1030 libewf_error_t **error ); 1031 1032 /* Sets the segment file set identifier 1033 * The identifier is a GUID and is 16 bytes of size 1034 * Returns 1 if successful or -1 on error 1035 */ 1036 LIBEWF_EXTERN \ 1037 int libewf_handle_set_segment_file_set_identifier( 1038 libewf_handle_t *handle, 1039 const uint8_t *set_identifier, 1040 size_t size, 1041 libewf_error_t **error ); 1042 1043 /* Retrieves the MD5 hash 1044 * Returns 1 if successful, 0 if value not present or -1 on error 1045 */ 1046 LIBEWF_EXTERN \ 1047 int libewf_handle_get_md5_hash( 1048 libewf_handle_t *handle, 1049 uint8_t *md5_hash, 1050 size_t size, 1051 libewf_error_t **error ); 1052 1053 /* Sets the MD5 hash 1054 * Returns 1 if successful, 0 if value not present or -1 on error 1055 */ 1056 LIBEWF_EXTERN \ 1057 int libewf_handle_set_md5_hash( 1058 libewf_handle_t *handle, 1059 uint8_t *md5_hash, 1060 size_t size, 1061 libewf_error_t **error ); 1062 1063 /* Retrieves the SHA1 hash 1064 * Returns 1 if successful, 0 if value not present or -1 on error 1065 */ 1066 LIBEWF_EXTERN \ 1067 int libewf_handle_get_sha1_hash( 1068 libewf_handle_t *handle, 1069 uint8_t *sha1_hash, 1070 size_t size, 1071 libewf_error_t **error ); 1072 1073 /* Sets the SHA1 hash 1074 * Returns 1 if successful, 0 if value not present or -1 on error 1075 */ 1076 LIBEWF_EXTERN \ 1077 int libewf_handle_set_sha1_hash( 1078 libewf_handle_t *handle, 1079 uint8_t *sha1_hash, 1080 size_t size, 1081 libewf_error_t **error ); 1082 1083 /* Retrieves the number of chunks written 1084 * Returns 1 if successful or -1 on error 1085 */ 1086 LIBEWF_EXTERN \ 1087 int libewf_handle_get_number_of_chunks_written( 1088 libewf_handle_t *handle, 1089 uint32_t *number_of_chunks, 1090 libewf_error_t **error ); 1091 1092 /* Sets the read zero chunk on error 1093 * The chunk is not zeroed if read raw is used 1094 * Returns 1 if successful or -1 on error 1095 */ 1096 LIBEWF_EXTERN \ 1097 int libewf_handle_set_read_zero_chunk_on_error( 1098 libewf_handle_t *handle, 1099 uint8_t zero_on_error, 1100 libewf_error_t **error ); 1101 1102 /* Copies the media values from the source to the destination handle 1103 * Returns 1 if successful or -1 on error 1104 */ 1105 LIBEWF_EXTERN \ 1106 int libewf_handle_copy_media_values( 1107 libewf_handle_t *destination_handle, 1108 libewf_handle_t *source_handle, 1109 libewf_error_t **error ); 1110 1111 /* Retrieves the number of acquiry errors 1112 * Returns 1 if successful or -1 on error 1113 */ 1114 LIBEWF_EXTERN \ 1115 int libewf_handle_get_number_of_acquiry_errors( 1116 libewf_handle_t *handle, 1117 uint32_t *number_of_errors, 1118 libewf_error_t **error ); 1119 1120 /* Retrieves an acquiry error 1121 * Returns 1 if successful or -1 on error 1122 */ 1123 LIBEWF_EXTERN \ 1124 int libewf_handle_get_acquiry_error( 1125 libewf_handle_t *handle, 1126 uint32_t index, 1127 uint64_t *start_sector, 1128 uint64_t *number_of_sectors, 1129 libewf_error_t **error ); 1130 1131 /* Appends an acquiry error 1132 * Returns 1 if successful or -1 on error 1133 */ 1134 LIBEWF_EXTERN \ 1135 int libewf_handle_append_acquiry_error( 1136 libewf_handle_t *handle, 1137 uint64_t start_sector, 1138 uint64_t number_of_sectors, 1139 libewf_error_t **error ); 1140 1141 /* Retrieves the number of checksum errors 1142 * Returns 1 if successful or -1 on error 1143 */ 1144 LIBEWF_EXTERN \ 1145 int libewf_handle_get_number_of_checksum_errors( 1146 libewf_handle_t *handle, 1147 uint32_t *number_of_errors, 1148 libewf_error_t **error ); 1149 1150 /* Retrieves a checksum error 1151 * Returns 1 if successful or -1 on error 1152 */ 1153 LIBEWF_EXTERN \ 1154 int libewf_handle_get_checksum_error( 1155 libewf_handle_t *handle, 1156 uint32_t index, 1157 uint64_t *start_sector, 1158 uint64_t *number_of_sectors, 1159 libewf_error_t **error ); 1160 1161 /* Appends a checksum error 1162 * Returns 1 if successful or -1 on error 1163 */ 1164 LIBEWF_EXTERN \ 1165 int libewf_handle_append_checksum_error( 1166 libewf_handle_t *handle, 1167 uint64_t start_sector, 1168 uint64_t number_of_sectors, 1169 libewf_error_t **error ); 1170 1171 /* Retrieves the number of sessions 1172 * Returns 1 if successful or -1 on error 1173 */ 1174 LIBEWF_EXTERN \ 1175 int libewf_handle_get_number_of_sessions( 1176 libewf_handle_t *handle, 1177 uint32_t *number_of_sessions, 1178 libewf_error_t **error ); 1179 1180 /* Retrieves a session 1181 * Returns 1 if successful or -1 on error 1182 */ 1183 LIBEWF_EXTERN \ 1184 int libewf_handle_get_session( 1185 libewf_handle_t *handle, 1186 uint32_t index, 1187 uint64_t *start_sector, 1188 uint64_t *number_of_sectors, 1189 libewf_error_t **error ); 1190 1191 /* Appends a session 1192 * Returns 1 if successful or -1 on error 1193 */ 1194 LIBEWF_EXTERN \ 1195 int libewf_handle_append_session( 1196 libewf_handle_t *handle, 1197 uint64_t start_sector, 1198 uint64_t number_of_sectors, 1199 libewf_error_t **error ); 1200 1201 /* Retrieves the number of tracks 1202 * Returns 1 if successful or -1 on error 1203 */ 1204 LIBEWF_EXTERN \ 1205 int libewf_handle_get_number_of_tracks( 1206 libewf_handle_t *handle, 1207 uint32_t *number_of_tracks, 1208 libewf_error_t **error ); 1209 1210 /* Retrieves a track 1211 * Returns 1 if successful or -1 on error 1212 */ 1213 LIBEWF_EXTERN \ 1214 int libewf_handle_get_track( 1215 libewf_handle_t *handle, 1216 uint32_t index, 1217 uint64_t *start_sector, 1218 uint64_t *number_of_sectors, 1219 libewf_error_t **error ); 1220 1221 /* Appends a track 1222 * Returns 1 if successful or -1 on error 1223 */ 1224 LIBEWF_EXTERN \ 1225 int libewf_handle_append_track( 1226 libewf_handle_t *handle, 1227 uint64_t start_sector, 1228 uint64_t number_of_sectors, 1229 libewf_error_t **error ); 1230 1231 /* Retrieves the header codepage 1232 * Returns 1 if successful or -1 on error 1233 */ 1234 LIBEWF_EXTERN \ 1235 int libewf_handle_get_header_codepage( 1236 libewf_handle_t *handle, 1237 int *header_codepage, 1238 libewf_error_t **error ); 1239 1240 /* Sets the header codepage 1241 * Returns 1 if successful or -1 on error 1242 */ 1243 LIBEWF_EXTERN \ 1244 int libewf_handle_set_header_codepage( 1245 libewf_handle_t *handle, 1246 int header_codepage, 1247 libewf_error_t **error ); 1248 1249 /* Retrieves the header values date format 1250 * Returns 1 if successful or -1 on error 1251 */ 1252 LIBEWF_EXTERN \ 1253 int libewf_handle_get_header_values_date_format( 1254 libewf_handle_t *handle, 1255 int *date_format, 1256 libewf_error_t **error ); 1257 1258 /* Sets the header values date format 1259 * Returns 1 if successful or -1 on error 1260 */ 1261 LIBEWF_EXTERN \ 1262 int libewf_handle_set_header_values_date_format( 1263 libewf_handle_t *handle, 1264 int date_format, 1265 libewf_error_t **error ); 1266 1267 /* Retrieves the number of header values 1268 * Returns 1 if successful, 0 if no header values are present or -1 on error 1269 */ 1270 LIBEWF_EXTERN \ 1271 int libewf_handle_get_number_of_header_values( 1272 libewf_handle_t *handle, 1273 uint32_t *number_of_values, 1274 libewf_error_t **error ); 1275 1276 /* Retrieves the size of the header value identifier of a specific index 1277 * The identifier size includes the end of string character 1278 * Returns 1 if successful, 0 if no header values are present or -1 on error 1279 */ 1280 LIBEWF_EXTERN \ 1281 int libewf_handle_get_header_value_identifier_size( 1282 libewf_handle_t *handle, 1283 uint32_t index, 1284 size_t *identifier_size, 1285 libewf_error_t **error ); 1286 1287 /* Retrieves the header value identifier of a specific index 1288 * The identifier size should include the end of string character 1289 * Returns 1 if successful, 0 if no header values are present or -1 on error 1290 */ 1291 LIBEWF_EXTERN \ 1292 int libewf_handle_get_header_value_identifier( 1293 libewf_handle_t *handle, 1294 uint32_t index, 1295 uint8_t *identifier, 1296 size_t identifier_size, 1297 libewf_error_t **error ); 1298 1299 /* Retrieves the size of the UTF-8 encoded header value of an identifier 1300 * The string size includes the end of string character 1301 * Returns 1 if successful, 0 if value not present or -1 on error 1302 */ 1303 LIBEWF_EXTERN \ 1304 int libewf_handle_get_utf8_header_value_size( 1305 libewf_handle_t *handle, 1306 const uint8_t *identifier, 1307 size_t identifier_length, 1308 size_t *utf8_string_size, 1309 libewf_error_t **error ); 1310 1311 /* Retrieves the UTF-8 encoded header value of an identifier 1312 * The string size should include the end of string character 1313 * Returns 1 if successful, 0 if value not present or -1 on error 1314 */ 1315 LIBEWF_EXTERN \ 1316 int libewf_handle_get_utf8_header_value( 1317 libewf_handle_t *handle, 1318 const uint8_t *identifier, 1319 size_t identifier_length, 1320 uint8_t *utf8_string, 1321 size_t utf8_string_size, 1322 libewf_error_t **error ); 1323 1324 /* Retrieves the header value case number 1325 * Returns 1 if successful, 0 if value not present or -1 on error 1326 */ 1327 #define libewf_handle_get_utf8_header_value_case_number( handle, value, value_size, error ) \ 1328 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) 1329 1330 /* Retrieves the header value description 1331 * Returns 1 if successful, 0 if value not present or -1 on error 1332 */ 1333 #define libewf_handle_get_utf8_header_value_description( handle, value, value_size, error ) \ 1334 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) 1335 1336 /* Retrieves the header value examiner name 1337 * Returns 1 if successful, 0 if value not present or -1 on error 1338 */ 1339 #define libewf_handle_get_utf8_header_value_examiner_name( handle, value, value_size, error ) \ 1340 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) 1341 1342 /* Retrieves the header value evidence number 1343 * Returns 1 if successful, 0 if value not present or -1 on error 1344 */ 1345 #define libewf_handle_get_utf8_header_value_evidence_number( handle, value, value_size, error ) \ 1346 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) 1347 1348 /* Retrieves the header value notes 1349 * Returns 1 if successful, 0 if value not present or -1 on error 1350 */ 1351 #define libewf_handle_get_utf8_header_value_notes( handle, value, value_size, error ) \ 1352 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) 1353 1354 /* Retrieves the header value acquiry date 1355 * The string is encoded according to the date format 1356 * Returns 1 if successful, 0 if value not present or -1 on error 1357 */ 1358 #define libewf_handle_get_utf8_header_value_acquiry_date( handle, value, value_size, error ) \ 1359 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) 1360 1361 /* Retrieves the header value system date 1362 * The string is encoded according to the date format 1363 * Returns 1 if successful, 0 if value not present or -1 on error 1364 */ 1365 #define libewf_handle_get_utf8_header_value_system_date( handle, value, value_size, error ) \ 1366 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) 1367 1368 /* Retrieves the header value acquiry operating system 1369 * Returns 1 if successful, 0 if value not present or -1 on error 1370 */ 1371 #define libewf_handle_get_utf8_header_value_acquiry_operating_system( handle, value, value_size, error ) \ 1372 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) 1373 1374 /* Retrieves the header value acquiry software version 1375 * Returns 1 if successful, 0 if value not present or -1 on error 1376 */ 1377 #define libewf_handle_get_utf8_header_value_acquiry_software_version( handle, value, value_size, error ) \ 1378 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) 1379 1380 /* Retrieves the header value password 1381 * Returns 1 if successful, 0 if value not present or -1 on error 1382 */ 1383 #define libewf_handle_get_utf8_header_value_password( handle, value, value_size, error ) \ 1384 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) 1385 1386 /* Retrieves the header value compression level 1387 * Returns 1 if successful, 0 if value not present or -1 on error 1388 */ 1389 #define libewf_handle_get_utf8_header_value_compression_level( handle, value, value_size, error ) \ 1390 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_size, error ) 1391 1392 /* Retrieves the header value model 1393 * Returns 1 if successful, 0 if value not present or -1 on error 1394 */ 1395 #define libewf_handle_get_utf8_header_value_model( handle, value, value_size, error ) \ 1396 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) 1397 1398 /* Retrieves the header value serial number 1399 * Returns 1 if successful, 0 if value not present or -1 on error 1400 */ 1401 #define libewf_handle_get_utf8_header_value_serial_number( handle, value, value_size, error ) \ 1402 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) 1403 1404 /* Sets the UTF-8 encoded header value specified by the identifier 1405 * Returns 1 if successful or -1 on error 1406 */ 1407 LIBEWF_EXTERN \ 1408 int libewf_handle_set_utf8_header_value( 1409 libewf_handle_t *handle, 1410 const uint8_t *identifier, 1411 size_t identifier_length, 1412 const uint8_t *utf8_string, 1413 size_t utf8_string_length, 1414 libewf_error_t **error ); 1415 1416 /* Sets the header value case number 1417 * Returns 1 if successful or -1 on error 1418 */ 1419 #define libewf_handle_set_utf8_header_value_case_number( handle, value, value_length, error ) \ 1420 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) 1421 1422 /* Sets the header value description 1423 * Returns 1 if successful or -1 on error 1424 */ 1425 #define libewf_handle_set_utf8_header_value_description( handle, value, value_length, error ) \ 1426 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) 1427 1428 /* Sets the header value examiner name 1429 * Returns 1 if successful or -1 on error 1430 */ 1431 #define libewf_handle_set_utf8_header_value_examiner_name( handle, value, value_length, error ) \ 1432 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) 1433 1434 /* Sets the header value evidence number 1435 * Returns 1 if successful or -1 on error 1436 */ 1437 #define libewf_handle_set_utf8_header_value_evidence_number( handle, value, value_length, error ) \ 1438 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) 1439 1440 /* Sets the header value notes 1441 * Returns 1 if successful or -1 on error 1442 */ 1443 #define libewf_handle_set_utf8_header_value_notes( handle, value, value_length, error ) \ 1444 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) 1445 1446 /* Sets the header value acquiry date 1447 * Returns 1 if successful or -1 on error 1448 */ 1449 #define libewf_handle_set_utf8_header_value_acquiry_date( handle, value, value_length, error ) \ 1450 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) 1451 1452 /* Sets the header value system date 1453 * Returns 1 if successful or -1 on error 1454 */ 1455 #define libewf_handle_set_utf8_header_value_system_date( handle, value, value_length, error ) \ 1456 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) 1457 1458 /* Sets the header value acquiry operating system 1459 * Returns 1 if successful or -1 on error 1460 */ 1461 #define libewf_handle_set_utf8_header_value_acquiry_operating_system( handle, value, value_length, error ) \ 1462 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) 1463 1464 /* Sets the header value acquiry software version 1465 * Returns 1 if successful or -1 on error 1466 */ 1467 #define libewf_handle_set_utf8_header_value_acquiry_software_version( handle, value, value_length, error ) \ 1468 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) 1469 1470 /* Sets the header value password 1471 * Returns 1 if successful or -1 on error 1472 */ 1473 #define libewf_handle_set_utf8_header_value_password( handle, value, value_length, error ) \ 1474 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) 1475 1476 /* Sets the header value compression level 1477 * Returns 1 if successful or -1 on error 1478 */ 1479 #define libewf_handle_set_utf8_header_value_compression_level( handle, value, value_length, error ) \ 1480 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_level", 17, value, value_length, error ) 1481 1482 /* Sets the header value model 1483 * Returns 1 if successful or -1 on error 1484 */ 1485 #define libewf_handle_set_utf8_header_value_model( handle, value, value_length, error ) \ 1486 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) 1487 1488 /* Sets the header value serial number 1489 * Returns 1 if successful or -1 on error 1490 */ 1491 #define libewf_handle_set_utf8_header_value_serial_number( handle, value, value_length, error ) \ 1492 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) 1493 1494 /* Retrieves the size of the UTF-16 encoded header value of an identifier 1495 * The string size includes the end of string character 1496 * Returns 1 if successful, 0 if value not present or -1 on error 1497 */ 1498 LIBEWF_EXTERN \ 1499 int libewf_handle_get_utf16_header_value_size( 1500 libewf_handle_t *handle, 1501 const uint8_t *identifier, 1502 size_t identifier_length, 1503 size_t *utf16_string_size, 1504 libewf_error_t **error ); 1505 1506 /* Retrieves the UTF-16 encoded header value of an identifier 1507 * The string size should include the end of string character 1508 * Returns 1 if successful, 0 if value not present or -1 on error 1509 */ 1510 LIBEWF_EXTERN \ 1511 int libewf_handle_get_utf16_header_value( 1512 libewf_handle_t *handle, 1513 const uint8_t *identifier, 1514 size_t identifier_length, 1515 uint16_t *utf16_string, 1516 size_t utf16_string_size, 1517 libewf_error_t **error ); 1518 1519 /* Sets the UTF-16 encoded header value specified by the identifier 1520 * Returns 1 if successful or -1 on error 1521 */ 1522 LIBEWF_EXTERN \ 1523 int libewf_handle_set_utf16_header_value( 1524 libewf_handle_t *handle, 1525 const uint8_t *identifier, 1526 size_t identifier_length, 1527 const uint16_t *utf16_string, 1528 size_t utf16_string_length, 1529 libewf_error_t **error ); 1530 1531 /* Copies the header values from the source to the destination handle 1532 * Returns 1 if successful or -1 on error 1533 */ 1534 LIBEWF_EXTERN \ 1535 int libewf_handle_copy_header_values( 1536 libewf_handle_t *destination_handle, 1537 libewf_handle_t *source_handle, 1538 libewf_error_t **error ); 1539 1540 /* Retrieves the number of hash values 1541 * Returns 1 if successful, 0 if no hash values are present or -1 on error 1542 */ 1543 LIBEWF_EXTERN \ 1544 int libewf_handle_get_number_of_hash_values( 1545 libewf_handle_t *handle, 1546 uint32_t *number_of_values, 1547 libewf_error_t **error ); 1548 1549 /* Retrieves the size of the hash value identifier of a specific index 1550 * The identifier size includes the end of string character 1551 * Returns 1 if successful, 0 if no hash values are present or -1 on error 1552 */ 1553 LIBEWF_EXTERN \ 1554 int libewf_handle_get_hash_value_identifier_size( 1555 libewf_handle_t *handle, 1556 uint32_t index, 1557 size_t *identifier_size, 1558 libewf_error_t **error ); 1559 1560 /* Retrieves the hash value identifier of a specific index 1561 * The identifier size should include the end of string character 1562 * Returns 1 if successful, 0 if no hash values are present or -1 on error 1563 */ 1564 LIBEWF_EXTERN \ 1565 int libewf_handle_get_hash_value_identifier( 1566 libewf_handle_t *handle, 1567 uint32_t index, 1568 uint8_t *identifier, 1569 size_t identifier_size, 1570 libewf_error_t **error ); 1571 1572 /* Retrieves the size of the UTF-8 encoded hash value of an identifier 1573 * The string size includes the end of string character 1574 * Returns 1 if successful, 0 if value not present or -1 on error 1575 */ 1576 LIBEWF_EXTERN \ 1577 int libewf_handle_get_utf8_hash_value_size( 1578 libewf_handle_t *handle, 1579 const uint8_t *identifier, 1580 size_t identifier_length, 1581 size_t *utf8_string_size, 1582 libewf_error_t **error ); 1583 1584 /* Retrieves the UTF-8 encoded hash value of an identifier 1585 * The string size should include the end of string character 1586 * Returns 1 if successful, 0 if value not present or -1 on error 1587 */ 1588 LIBEWF_EXTERN \ 1589 int libewf_handle_get_utf8_hash_value( 1590 libewf_handle_t *handle, 1591 const uint8_t *identifier, 1592 size_t identifier_length, 1593 uint8_t *utf8_string, 1594 size_t utf8_string_size, 1595 libewf_error_t **error ); 1596 1597 /* Retrieves the hash value MD5 1598 * Returns 1 if successful, 0 if value not present or -1 on error 1599 */ 1600 #define libewf_handle_get_utf8_hash_value_md5( handle, value, value_size, error ) \ 1601 libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_size, error ) 1602 1603 /* Retrieves the hash value SHA1 1604 * Returns 1 if successful, 0 if value not present or -1 on error 1605 */ 1606 #define libewf_handle_get_utf8_hash_value_sha1( handle, value, value_size, error ) \ 1607 libewf_handle_get_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_size, error ) 1608 1609 /* Sets the UTF-8 hash value specified by the identifier 1610 * Returns 1 if successful or -1 on error 1611 */ 1612 LIBEWF_EXTERN \ 1613 int libewf_handle_set_utf8_hash_value( 1614 libewf_handle_t *handle, 1615 const uint8_t *identifier, 1616 size_t identifier_length, 1617 const uint8_t *utf8_string, 1618 size_t utf8_string_length, 1619 libewf_error_t **error ); 1620 1621 /* Sets the hash value MD5 1622 * Returns 1 if successful or -1 on error 1623 */ 1624 #define libewf_handle_set_utf8_hash_value_md5( handle, value, value_length, error ) \ 1625 libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "MD5", 3, value, value_length, error ) 1626 1627 /* Sets the hash value SHA1 1628 * Returns 1 if successful or -1 on error 1629 */ 1630 #define libewf_handle_set_utf8_hash_value_sha1( handle, value, value_length, error ) \ 1631 libewf_handle_set_utf8_hash_value( handle, (uint8_t *) "SHA1", 4, value, value_length, error ) 1632 1633 /* Retrieves the size of the UTF-16 encoded hash value of an identifier 1634 * The string size includes the end of string character 1635 * Returns 1 if successful, 0 if value not present or -1 on error 1636 */ 1637 LIBEWF_EXTERN \ 1638 int libewf_handle_get_utf16_hash_value_size( 1639 libewf_handle_t *handle, 1640 const uint8_t *identifier, 1641 size_t identifier_length, 1642 size_t *utf16_string_size, 1643 libewf_error_t **error ); 1644 1645 /* Retrieves the UTF-16 encoded hash value of an identifier 1646 * The string size should include the end of string character 1647 * Returns 1 if successful, 0 if value not present or -1 on error 1648 */ 1649 LIBEWF_EXTERN \ 1650 int libewf_handle_get_utf16_hash_value( 1651 libewf_handle_t *handle, 1652 const uint8_t *identifier, 1653 size_t identifier_length, 1654 uint16_t *utf16_string, 1655 size_t utf16_string_size, 1656 libewf_error_t **error ); 1657 1658 /* Sets the UTF-16 hash value specified by the identifier 1659 * Returns 1 if successful or -1 on error 1660 */ 1661 LIBEWF_EXTERN \ 1662 int libewf_handle_set_utf16_hash_value( 1663 libewf_handle_t *handle, 1664 const uint8_t *identifier, 1665 size_t identifier_length, 1666 const uint16_t *utf16_string, 1667 size_t utf16_string_length, 1668 libewf_error_t **error ); 1669 1670 /* Retrieves the root (single) file entry 1671 * Returns 1 if successful, 0 if no file entries are present or -1 on error 1672 */ 1673 LIBEWF_EXTERN \ 1674 int libewf_handle_get_root_file_entry( 1675 libewf_handle_t *handle, 1676 libewf_file_entry_t **root_file_entry, 1677 libewf_error_t **error ); 1678 1679 /* Retrieves the (single) file entry for the specific UTF-8 encoded path 1680 * The path separator is the \ character 1681 * Returns 1 if successful, 0 if no such file entry or -1 on error 1682 */ 1683 LIBEWF_EXTERN \ 1684 int libewf_file_get_file_entry_by_utf8_path( 1685 libewf_handle_t *handle, 1686 const uint8_t *utf8_string, 1687 size_t utf8_string_length, 1688 libewf_file_entry_t **file_entry, 1689 libewf_error_t **error ); 1690 1691 /* Retrieves the (single) file entry for the specific UTF-16 encoded path 1692 * The path separator is the \ character 1693 * Returns 1 if successful, 0 if no such file entry or -1 on error 1694 */ 1695 LIBEWF_EXTERN \ 1696 int libewf_file_get_file_entry_by_utf16_path( 1697 libewf_handle_t *handle, 1698 const uint16_t *utf16_string, 1699 size_t utf16_string_length, 1700 libewf_file_entry_t **file_entry, 1701 libewf_error_t **error ); 1702 1703 /* ------------------------------------------------------------------------- 1704 * Meta data functions - deprecated 1705 * ------------------------------------------------------------------------- */ 1706 1707 /* Sets the read wipe chunk on error 1708 * The chunk is not wiped if read raw is used 1709 * Returns 1 if successful or -1 on error 1710 * 1711 * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead 1712 */ 1713 LIBEWF_DEPRECATED \ 1714 LIBEWF_EXTERN \ 1715 int libewf_handle_set_read_wipe_chunk_on_error( 1716 libewf_handle_t *handle, 1717 uint8_t wipe_on_error, 1718 libewf_error_t **error ); 1719 1720 /* Retrieves the amount of acquiry errors 1721 * Returns 1 if successful or -1 on error 1722 * 1723 * This function deprecated use libewf_handle_get_number_of_acquiry_errors instead 1724 */ 1725 LIBEWF_DEPRECATED \ 1726 LIBEWF_EXTERN \ 1727 int libewf_handle_get_amount_of_acquiry_errors( 1728 libewf_handle_t *handle, 1729 uint32_t *amount_of_errors, 1730 libewf_error_t **error ); 1731 1732 /* Add an acquiry error 1733 * Returns 1 if successful or -1 on error 1734 * 1735 * This function deprecated use libewf_handle_append_acquiry_error instead 1736 */ 1737 LIBEWF_DEPRECATED \ 1738 LIBEWF_EXTERN \ 1739 int libewf_handle_add_acquiry_error( 1740 libewf_handle_t *handle, 1741 uint64_t start_sector, 1742 uint64_t number_of_sectors, 1743 libewf_error_t **error ); 1744 1745 /* Retrieves the number of checksum errors 1746 * Returns 1 if successful or -1 on error 1747 * 1748 * This function deprecated use libewf_handle_get_number_of_checksum_errors instead 1749 */ 1750 LIBEWF_DEPRECATED \ 1751 LIBEWF_EXTERN \ 1752 int libewf_handle_get_number_of_crc_errors( 1753 libewf_handle_t *handle, 1754 uint32_t *number_of_errors, 1755 libewf_error_t **error ); 1756 1757 /* Retrieves the amount of checksum errors 1758 * Returns 1 if successful or -1 on error 1759 * 1760 * This function deprecated use libewf_handle_get_number_of_checksum_errors instead 1761 */ 1762 LIBEWF_DEPRECATED \ 1763 LIBEWF_EXTERN \ 1764 int libewf_handle_get_amount_of_crc_errors( 1765 libewf_handle_t *handle, 1766 uint32_t *amount_of_errors, 1767 libewf_error_t **error ); 1768 1769 /* Retrieves a checksum error 1770 * Returns 1 if successful or -1 on error 1771 * 1772 * This function deprecated use libewf_handle_get_checksum_error instead 1773 */ 1774 LIBEWF_DEPRECATED \ 1775 LIBEWF_EXTERN \ 1776 int libewf_handle_get_crc_error( 1777 libewf_handle_t *handle, 1778 uint32_t index, 1779 uint64_t *start_sector, 1780 uint64_t *number_of_sectors, 1781 libewf_error_t **error ); 1782 1783 /* Add a checksum error 1784 * Returns 1 if successful or -1 on error 1785 * 1786 * This function deprecated use libewf_handle_append_checksum_error instead 1787 */ 1788 LIBEWF_DEPRECATED \ 1789 LIBEWF_EXTERN \ 1790 int libewf_handle_add_crc_error( 1791 libewf_handle_t *handle, 1792 uint64_t start_sector, 1793 uint64_t number_of_sectors, 1794 libewf_error_t **error ); 1795 1796 /* Retrieves the amount of sessions 1797 * Returns 1 if successful or -1 on error 1798 * 1799 * This function deprecated use libewf_handle_get_number_of_sessions instead 1800 */ 1801 LIBEWF_DEPRECATED \ 1802 LIBEWF_EXTERN \ 1803 int libewf_handle_get_amount_of_sessions( 1804 libewf_handle_t *handle, 1805 uint32_t *amount_of_sessions, 1806 libewf_error_t **error ); 1807 1808 /* Add a session 1809 * Returns 1 if successful or -1 on error 1810 * 1811 * This function deprecated use libewf_handle_append_session instead 1812 */ 1813 LIBEWF_DEPRECATED \ 1814 LIBEWF_EXTERN \ 1815 int libewf_handle_add_session( 1816 libewf_handle_t *handle, 1817 uint64_t start_sector, 1818 uint64_t number_of_sectors, 1819 libewf_error_t **error ); 1820 1821 /* Retrieves the amount of header values 1822 * Returns 1 if successful, 0 if no header values are present or -1 on error 1823 * 1824 * This function deprecated use libewf_handle_get_number_of_header_values instead 1825 */ 1826 LIBEWF_DEPRECATED \ 1827 LIBEWF_EXTERN \ 1828 int libewf_handle_get_amount_of_header_values( 1829 libewf_handle_t *handle, 1830 uint32_t *amount_of_values, 1831 libewf_error_t **error ); 1832 1833 /* Retrieves the size of the UTF-8 encoded header value of an identifier 1834 * The value size includes the end of string character 1835 * Returns 1 if successful, 0 if value not present or -1 on error 1836 * 1837 * This function deprecated use libewf_handle_get_utf8_header_value_size instead 1838 */ 1839 LIBEWF_DEPRECATED \ 1840 LIBEWF_EXTERN \ 1841 int libewf_handle_get_header_value_size( 1842 libewf_handle_t *handle, 1843 const uint8_t *identifier, 1844 size_t identifier_length, 1845 size_t *value_size, 1846 libewf_error_t **error ); 1847 1848 /* Retrieves the UTF-8 encoded header value of an identifier 1849 * The value size should include the end of string character 1850 * Returns 1 if successful, 0 if value not present or -1 on error 1851 * 1852 * This function deprecated use libewf_handle_get_utf8_header_value instead 1853 */ 1854 LIBEWF_DEPRECATED \ 1855 LIBEWF_EXTERN \ 1856 int libewf_handle_get_header_value( 1857 libewf_handle_t *handle, 1858 const uint8_t *identifier, 1859 size_t identifier_length, 1860 uint8_t *value, 1861 size_t value_size, 1862 libewf_error_t **error ); 1863 1864 /* Retrieves the header value case number 1865 * Returns 1 if successful, 0 if value not present or -1 on error 1866 */ 1867 #define libewf_handle_get_header_value_case_number( handle, value, value_size, error ) \ 1868 libewf_handle_get_header_value( handle, (uint8_t *) "case_number", 11, value, value_size, error ) 1869 1870 /* Retrieves the header value description 1871 * Returns 1 if successful, 0 if value not present or -1 on error 1872 */ 1873 #define libewf_handle_get_header_value_description( handle, value, value_size, error ) \ 1874 libewf_handle_get_header_value( handle, (uint8_t *) "description", 11, value, value_size, error ) 1875 1876 /* Retrieves the header value examiner name 1877 * Returns 1 if successful, 0 if value not present or -1 on error 1878 */ 1879 #define libewf_handle_get_header_value_examiner_name( handle, value, value_size, error ) \ 1880 libewf_handle_get_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_size, error ) 1881 1882 /* Retrieves the header value evidence number 1883 * Returns 1 if successful, 0 if value not present or -1 on error 1884 */ 1885 #define libewf_handle_get_header_value_evidence_number( handle, value, value_size, error ) \ 1886 libewf_handle_get_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_size, error ) 1887 1888 /* Retrieves the header value notes 1889 * Returns 1 if successful, 0 if value not present or -1 on error 1890 */ 1891 #define libewf_handle_get_header_value_notes( handle, value, value_size, error ) \ 1892 libewf_handle_get_header_value( handle, (uint8_t *) "notes", 5, value, value_size, error ) 1893 1894 /* Retrieves the header value acquiry date 1895 * The string is encoded according to the date format 1896 * Returns 1 if successful, 0 if value not present or -1 on error 1897 */ 1898 #define libewf_handle_get_header_value_acquiry_date( handle, value, value_size, error ) \ 1899 libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_size, error ) 1900 1901 /* Retrieves the header value system date 1902 * The string is encoded according to the date format 1903 * Returns 1 if successful, 0 if value not present or -1 on error 1904 */ 1905 #define libewf_handle_get_header_value_system_date( handle, value, value_size, error ) \ 1906 libewf_handle_get_header_value( handle, (uint8_t *) "system_date", 11, value, value_size, error ) 1907 1908 /* Retrieves the header value acquiry operating system 1909 * Returns 1 if successful, 0 if value not present or -1 on error 1910 */ 1911 #define libewf_handle_get_header_value_acquiry_operating_system( handle, value, value_size, error ) \ 1912 libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_size, error ) 1913 1914 /* Retrieves the header value acquiry software version 1915 * Returns 1 if successful, 0 if value not present or -1 on error 1916 */ 1917 #define libewf_handle_get_header_value_acquiry_software_version( handle, value, value_size, error ) \ 1918 libewf_handle_get_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_size, error ) 1919 1920 /* Retrieves the header value password 1921 * Returns 1 if successful, 0 if value not present or -1 on error 1922 */ 1923 #define libewf_handle_get_header_value_password( handle, value, value_size, error ) \ 1924 libewf_handle_get_header_value( handle, (uint8_t *) "password", 8, value, value_size, error ) 1925 1926 /* Retrieves the header value compression type 1927 * Returns 1 if successful, 0 if value not present or -1 on error 1928 */ 1929 #define libewf_handle_get_header_value_compression_type( handle, value, value_size, error ) \ 1930 libewf_handle_get_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) 1931 1932 /* Retrieves the header value model 1933 * Returns 1 if successful, 0 if value not present or -1 on error 1934 */ 1935 #define libewf_handle_get_header_value_model( handle, value, value_size, error ) \ 1936 libewf_handle_get_header_value( handle, (uint8_t *) "model", 5, value, value_size, error ) 1937 1938 /* Retrieves the header value serial number 1939 * Returns 1 if successful, 0 if value not present or -1 on error 1940 */ 1941 #define libewf_handle_get_header_value_serial_number( handle, value, value_size, error ) \ 1942 libewf_handle_get_header_value( handle, (uint8_t *) "serial_number", 13, value, value_size, error ) 1943 1944 /* Retrieves the header value compression type 1945 * Returns 1 if successful, 0 if value not present or -1 on error 1946 * 1947 * This function deprecated use libewf_handle_get_utf8_header_value_compression_level instead 1948 */ 1949 #define libewf_handle_get_utf8_header_value_compression_type( handle, value, value_size, error ) \ 1950 libewf_handle_get_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_size, error ) 1951 1952 /* Sets the UTF-8 encoded header value specified by the identifier 1953 * Returns 1 if successful or -1 on error 1954 * 1955 * This function deprecated use libewf_handle_set_utf8_header_value instead 1956 */ 1957 LIBEWF_DEPRECATED \ 1958 LIBEWF_EXTERN \ 1959 int libewf_handle_set_header_value( 1960 libewf_handle_t *handle, 1961 const uint8_t *identifier, 1962 size_t identifier_length, 1963 const uint8_t *value, 1964 size_t value_length, 1965 libewf_error_t **error ); 1966 1967 /* Sets the header value case number 1968 * Returns 1 if successful or -1 on error 1969 */ 1970 #define libewf_handle_set_header_value_case_number( handle, value, value_length, error ) \ 1971 libewf_handle_set_header_value( handle, (uint8_t *) "case_number", 11, value, value_length, error ) 1972 1973 /* Sets the header value description 1974 * Returns 1 if successful or -1 on error 1975 */ 1976 #define libewf_handle_set_header_value_description( handle, value, value_length, error ) \ 1977 libewf_handle_set_header_value( handle, (uint8_t *) "description", 11, value, value_length, error ) 1978 1979 /* Sets the header value examiner name 1980 * Returns 1 if successful or -1 on error 1981 */ 1982 #define libewf_handle_set_header_value_examiner_name( handle, value, value_length, error ) \ 1983 libewf_handle_set_header_value( handle, (uint8_t *) "examiner_name", 13, value, value_length, error ) 1984 1985 /* Sets the header value evidence number 1986 * Returns 1 if successful or -1 on error 1987 */ 1988 #define libewf_handle_set_header_value_evidence_number( handle, value, value_length, error ) \ 1989 libewf_handle_set_header_value( handle, (uint8_t *) "evidence_number", 15, value, value_length, error ) 1990 1991 /* Sets the header value notes 1992 * Returns 1 if successful or -1 on error 1993 */ 1994 #define libewf_handle_set_header_value_notes( handle, value, value_length, error ) \ 1995 libewf_handle_set_header_value( handle, (uint8_t *) "notes", 5, value, value_length, error ) 1996 1997 /* Sets the header value acquiry date 1998 * Returns 1 if successful or -1 on error 1999 */ 2000 #define libewf_handle_set_header_value_acquiry_date( handle, value, value_length, error ) \ 2001 libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_date", 12, value, value_length, error ) 2002 2003 /* Sets the header value system date 2004 * Returns 1 if successful or -1 on error 2005 */ 2006 #define libewf_handle_set_header_value_system_date( handle, value, value_length, error ) \ 2007 libewf_handle_set_header_value( handle, (uint8_t *) "system_date", 11, value, value_length, error ) 2008 2009 /* Sets the header value acquiry operating system 2010 * Returns 1 if successful or -1 on error 2011 */ 2012 #define libewf_handle_set_header_value_acquiry_operating_system( handle, value, value_length, error ) \ 2013 libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_operating_system", 24, value, value_length, error ) 2014 2015 /* Sets the header value acquiry software version 2016 * Returns 1 if successful or -1 on error 2017 */ 2018 #define libewf_handle_set_header_value_acquiry_software_version( handle, value, value_length, error ) \ 2019 libewf_handle_set_header_value( handle, (uint8_t *) "acquiry_software_version", 24, value, value_length, error ) 2020 2021 /* Sets the header value password 2022 * Returns 1 if successful or -1 on error 2023 */ 2024 #define libewf_handle_set_header_value_password( handle, value, value_length, error ) \ 2025 libewf_handle_set_header_value( handle, (uint8_t *) "password", 8, value, value_length, error ) 2026 2027 /* Sets the header value compression type 2028 * Returns 1 if successful or -1 on error 2029 */ 2030 #define libewf_handle_set_header_value_compression_type( handle, value, value_length, error ) \ 2031 libewf_handle_set_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) 2032 2033 /* Sets the header value model 2034 * Returns 1 if successful or -1 on error 2035 */ 2036 #define libewf_handle_set_header_value_model( handle, value, value_length, error ) \ 2037 libewf_handle_set_header_value( handle, (uint8_t *) "model", 5, value, value_length, error ) 2038 2039 /* Sets the header value serial number 2040 * Returns 1 if successful or -1 on error 2041 */ 2042 #define libewf_handle_set_header_value_serial_number( handle, value, value_length, error ) \ 2043 libewf_handle_set_header_value( handle, (uint8_t *) "serial_number", 13, value, value_length, error ) 2044 2045 /* Sets the header value compression type 2046 * Returns 1 if successful or -1 on error 2047 * 2048 * This function deprecated use libewf_handle_set_utf8_header_value_compression_level instead 2049 */ 2050 #define libewf_handle_set_utf8_header_value_compression_type( handle, value, value_length, error ) \ 2051 libewf_handle_set_utf8_header_value( handle, (uint8_t *) "compression_type", 16, value, value_length, error ) 2052 2053 /* Retrieves the amount of hash values 2054 * Returns 1 if successful, 0 if no hash values are present or -1 on error 2055 * 2056 * This function deprecated use libewf_handle_get_number_of_hash_values instead 2057 */ 2058 LIBEWF_DEPRECATED \ 2059 LIBEWF_EXTERN \ 2060 int libewf_handle_get_amount_of_hash_values( 2061 libewf_handle_t *handle, 2062 uint32_t *amount_of_values, 2063 libewf_error_t **error ); 2064 2065 /* Retrieves the size of the UTF-8 encoded hash value of an identifier 2066 * The value size includes the end of string character 2067 * Returns 1 if successful, 0 if value not present or -1 on error 2068 * 2069 * This function deprecated use libewf_handle_get_utf8_hash_value_size instead 2070 */ 2071 LIBEWF_DEPRECATED \ 2072 LIBEWF_EXTERN \ 2073 int libewf_handle_get_hash_value_size( 2074 libewf_handle_t *handle, 2075 const uint8_t *identifier, 2076 size_t identifier_length, 2077 size_t *value_size, 2078 libewf_error_t **error ); 2079 2080 /* Retrieves the UTF-8 encoded hash value of an identifier 2081 * The value size should include the end of string character 2082 * Returns 1 if successful, 0 if value not present or -1 on error 2083 * 2084 * This function deprecated use libewf_handle_get_utf8_hash_value instead 2085 */ 2086 LIBEWF_DEPRECATED \ 2087 LIBEWF_EXTERN \ 2088 int libewf_handle_get_hash_value( 2089 libewf_handle_t *handle, 2090 const uint8_t *identifier, 2091 size_t identifier_length, 2092 uint8_t *value, 2093 size_t value_size, 2094 libewf_error_t **error ); 2095 2096 /* Retrieves the hash value MD5 2097 * Returns 1 if successful, 0 if value not present or -1 on error 2098 */ 2099 #define libewf_handle_get_hash_value_md5( handle, value, value_size, error ) \ 2100 libewf_handle_get_hash_value( handle, "MD5", 3, value, value_size, error ) 2101 2102 /* Retrieves the hash value SHA1 2103 * Returns 1 if successful, 0 if value not present or -1 on error 2104 */ 2105 #define libewf_handle_get_hash_value_sha1( handle, value, value_size, error ) \ 2106 libewf_handle_get_hash_value( handle, "SHA1", 4, value, value_size, error ) 2107 2108 /* Sets the UTF-8 hash value specified by the identifier 2109 * Returns 1 if successful or -1 on error 2110 * 2111 * This function deprecated use libewf_handle_set_utf8_hash_value instead 2112 */ 2113 LIBEWF_DEPRECATED \ 2114 LIBEWF_EXTERN \ 2115 int libewf_handle_set_hash_value( 2116 libewf_handle_t *handle, 2117 const uint8_t *identifier, 2118 size_t identifier_length, 2119 const uint8_t *value, 2120 size_t value_length, 2121 libewf_error_t **error ); 2122 2123 /* Sets the hash value MD5 2124 * Returns 1 if successful or -1 on error 2125 */ 2126 #define libewf_handle_set_hash_value_md5( handle, value, value_length, error ) \ 2127 libewf_handle_set_hash_value( handle, "MD5", 3, value, value_length, error ) 2128 2129 /* Sets the hash value SHA1 2130 * Returns 1 if successful or -1 on error 2131 */ 2132 #define libewf_handle_set_hash_value_sha1( handle, value, value_length, error ) \ 2133 libewf_handle_set_hash_value( handle, "SHA1", 4, value, value_length, error ) 2134 2135 /* ------------------------------------------------------------------------- 2136 * Single file entry functions 2137 * ------------------------------------------------------------------------- */ 2138 2139 /* Frees a file entry 2140 * REturns 1 if successful or -1 on error 2141 */ 2142 LIBEWF_EXTERN \ 2143 int libewf_file_entry_free( 2144 libewf_file_entry_t **file_entry, 2145 libewf_error_t **error ); 2146 2147 /* Retrieves the type 2148 * Returns 1 if successful or -1 on error 2149 */ 2150 LIBEWF_EXTERN \ 2151 int libewf_file_entry_get_type( 2152 libewf_file_entry_t *file_entry, 2153 uint8_t *type, 2154 libewf_error_t **error ); 2155 2156 /* Retrieves the flags 2157 * Returns 1 if successful or -1 on error 2158 */ 2159 LIBEWF_EXTERN \ 2160 int libewf_file_entry_get_flags( 2161 libewf_file_entry_t *file_entry, 2162 uint32_t *flags, 2163 libewf_error_t **error ); 2164 2165 /* Retrieves the media data offset 2166 * Returns 1 if successful or -1 on error 2167 */ 2168 LIBEWF_EXTERN \ 2169 int libewf_file_entry_get_media_data_offset( 2170 libewf_file_entry_t *file_entry, 2171 off64_t *media_data_offset, 2172 libewf_error_t **error ); 2173 2174 /* Retrieves the media data size 2175 * Returns 1 if successful or -1 on error 2176 */ 2177 LIBEWF_EXTERN \ 2178 int libewf_file_entry_get_media_data_size( 2179 libewf_file_entry_t *file_entry, 2180 size64_t *media_data_size, 2181 libewf_error_t **error ); 2182 2183 /* Retrieves the duplicate media data offset 2184 * Returns 1 if successful or -1 on error 2185 */ 2186 LIBEWF_EXTERN \ 2187 int libewf_file_entry_get_duplicate_media_data_offset( 2188 libewf_file_entry_t *file_entry, 2189 off64_t *duplicate_media_data_offset, 2190 libewf_error_t **error ); 2191 2192 /* Retrieves the size of the UTF-8 encoded name 2193 * The returned size includes the end of string character 2194 * Returns 1 if successful or -1 on error 2195 */ 2196 LIBEWF_EXTERN \ 2197 int libewf_file_entry_get_utf8_name_size( 2198 libewf_file_entry_t *file_entry, 2199 size_t *utf8_string_size, 2200 libewf_error_t **error ); 2201 2202 /* Retrieves the UTF-8 encoded name value 2203 * The size should include the end of string character 2204 * Returns 1 if successful or -1 on error 2205 */ 2206 LIBEWF_EXTERN \ 2207 int libewf_file_entry_get_utf8_name( 2208 libewf_file_entry_t *file_entry, 2209 uint8_t *utf8_string, 2210 size_t utf8_string_size, 2211 libewf_error_t **error ); 2212 2213 /* Retrieves the size of the UTF-16 encoded name 2214 * The returned size includes the end of string character 2215 * Returns 1 if successful or -1 on error 2216 */ 2217 LIBEWF_EXTERN \ 2218 int libewf_file_entry_get_utf16_name_size( 2219 libewf_file_entry_t *file_entry, 2220 size_t *utf16_string_size, 2221 libewf_error_t **error ); 2222 2223 /* Retrieves the UTF-16 encoded name value 2224 * The size should include the end of string character 2225 * Returns 1 if successful or -1 on error 2226 */ 2227 LIBEWF_EXTERN \ 2228 int libewf_file_entry_get_utf16_name( 2229 libewf_file_entry_t *file_entry, 2230 uint16_t *utf16_string, 2231 size_t utf16_string_size, 2232 libewf_error_t **error ); 2233 2234 /* Retrieves the size 2235 * Returns 1 if successful or -1 on error 2236 */ 2237 LIBEWF_EXTERN \ 2238 int libewf_file_entry_get_size( 2239 libewf_file_entry_t *file_entry, 2240 size64_t *size, 2241 libewf_error_t **error ); 2242 2243 /* Retrieves the creation date and time 2244 * The date and time is formatted as a POSIX timestamp 2245 * Returns 1 if successful or -1 on error 2246 */ 2247 LIBEWF_EXTERN \ 2248 int libewf_file_entry_get_creation_time( 2249 libewf_file_entry_t *file_entry, 2250 uint32_t *creation_time, 2251 libewf_error_t **error ); 2252 2253 /* Retrieves the modification date and time 2254 * The date and time is formatted as a POSIX timestamp 2255 * Returns 1 if successful or -1 on error 2256 */ 2257 LIBEWF_EXTERN \ 2258 int libewf_file_entry_get_modification_time( 2259 libewf_file_entry_t *file_entry, 2260 uint32_t *modification_time, 2261 libewf_error_t **error ); 2262 2263 /* Retrieves the access date and time 2264 * The date and time is formatted as a POSIX timestamp 2265 * Returns 1 if successful or -1 on error 2266 */ 2267 LIBEWF_EXTERN \ 2268 int libewf_file_entry_get_access_time( 2269 libewf_file_entry_t *file_entry, 2270 uint32_t *access_time, 2271 libewf_error_t **error ); 2272 2273 /* Retrieves the entry modification date and time 2274 * The date and time is formatted as a POSIX timestamp 2275 * Returns 1 if successful or -1 on error 2276 */ 2277 LIBEWF_EXTERN \ 2278 int libewf_file_entry_get_entry_modification_time( 2279 libewf_file_entry_t *file_entry, 2280 uint32_t *entry_modification_time, 2281 libewf_error_t **error ); 2282 2283 /* Retrieves the UTF-8 encoded MD5 hash value 2284 * Returns 1 if successful, 0 if value not present or -1 on error 2285 */ 2286 LIBEWF_EXTERN \ 2287 int libewf_file_entry_get_utf8_hash_value_md5( 2288 libewf_file_entry_t *file_entry, 2289 uint8_t *utf8_string, 2290 size_t utf8_string_size, 2291 libewf_error_t **error ); 2292 2293 /* Retrieves the UTF-16 encoded MD5 hash value 2294 * Returns 1 if successful, 0 if value not present or -1 on error 2295 */ 2296 LIBEWF_EXTERN \ 2297 int libewf_file_entry_get_utf16_hash_value_md5( 2298 libewf_file_entry_t *file_entry, 2299 uint16_t *utf16_string, 2300 size_t utf16_string_size, 2301 libewf_error_t **error ); 2302 2303 /* Reads data at the current offset 2304 * Returns the number of bytes read or -1 on error 2305 */ 2306 LIBEWF_EXTERN \ 2307 ssize_t libewf_file_entry_read_buffer( 2308 libewf_file_entry_t *file_entry, 2309 void *buffer, 2310 size_t buffer_size, 2311 libewf_error_t **error ); 2312 2313 /* Reads data at a specific offset 2314 * Returns the number of bytes read or -1 on error 2315 */ 2316 LIBEWF_EXTERN \ 2317 ssize_t libewf_file_entry_read_random( 2318 libewf_file_entry_t *file_entry, 2319 void *buffer, 2320 size_t buffer_size, 2321 off64_t offset, 2322 libewf_error_t **error ); 2323 2324 /* Seeks a certain offset of the data 2325 * Returns the offset if seek is successful or -1 on error 2326 */ 2327 LIBEWF_EXTERN \ 2328 off64_t libewf_file_entry_seek_offset( 2329 libewf_file_entry_t *file_entry, 2330 off64_t offset, 2331 int whence, 2332 libewf_error_t **error ); 2333 2334 /* Retrieves the current offset of the data 2335 * Returns the offset if successful or -1 on error 2336 */ 2337 LIBEWF_EXTERN \ 2338 int libewf_file_entry_get_offset( 2339 libewf_file_entry_t *file_entry, 2340 off64_t *offset, 2341 libewf_error_t **error ); 2342 2343 /* Retrieves the number of sub file entries 2344 * Returns 1 if successful or -1 on error 2345 */ 2346 LIBEWF_EXTERN \ 2347 int libewf_file_entry_get_number_of_sub_file_entries( 2348 libewf_file_entry_t *file_entry, 2349 int *number_of_sub_file_entries, 2350 libewf_error_t **error ); 2351 2352 /* Retrieves the sub file entry for the specific index 2353 * Returns 1 if successful or -1 on error 2354 */ 2355 LIBEWF_EXTERN \ 2356 int libewf_file_entry_get_sub_file_entry( 2357 libewf_file_entry_t *file_entry, 2358 int sub_file_entry_index, 2359 libewf_file_entry_t **sub_file_entry, 2360 libewf_error_t **error ); 2361 2362 /* Retrieves the sub file entry for the specific UTF-8 encoded name 2363 * Returns 1 if successful, 0 if no such sub file entry or -1 on error 2364 */ 2365 LIBEWF_EXTERN \ 2366 int libewf_file_entry_get_sub_file_entry_by_utf8_name( 2367 libewf_file_entry_t *file_entry, 2368 const uint8_t *utf8_string, 2369 size_t utf8_string_length, 2370 libewf_file_entry_t **sub_file_entry, 2371 libewf_error_t **error ); 2372 2373 /* Retrieves the sub file entry for the specific UTF-8 encoded path 2374 * The path separator is the \ character 2375 * Returns 1 if successful, 0 if no such sub file entry or -1 on error 2376 */ 2377 LIBEWF_EXTERN \ 2378 int libewf_file_entry_get_sub_file_entry_by_utf8_path( 2379 libewf_file_entry_t *file_entry, 2380 const uint8_t *utf8_string, 2381 size_t utf8_string_length, 2382 libewf_file_entry_t **sub_file_entry, 2383 libewf_error_t **error ); 2384 2385 /* Retrieves the sub file entry for the specific UTF-16 encoded name 2386 * Returns 1 if successful, 0 if no such sub file entry or -1 on error 2387 */ 2388 LIBEWF_EXTERN \ 2389 int libewf_file_entry_get_sub_file_entry_by_utf16_name( 2390 libewf_file_entry_t *file_entry, 2391 const uint16_t *utf16_string, 2392 size_t utf16_string_length, 2393 libewf_file_entry_t **sub_file_entry, 2394 libewf_error_t **error ); 2395 2396 /* Retrieves the sub file entry for the specific UTF-16 encoded path 2397 * The path separator is the \ character 2398 * Returns 1 if successful, 0 if no such sub file entry or -1 on error 2399 */ 2400 LIBEWF_EXTERN \ 2401 int libewf_file_entry_get_sub_file_entry_by_utf16_path( 2402 libewf_file_entry_t *file_entry, 2403 const uint16_t *utf16_string, 2404 size_t utf16_string_length, 2405 libewf_file_entry_t **sub_file_entry, 2406 libewf_error_t **error ); 2407 2408 /* ------------------------------------------------------------------------- 2409 * Single file entry functions - deprecated 2410 * ------------------------------------------------------------------------- */ 2411 2412 /* Retrieves the size of the UTF-8 encoded name 2413 * The returned size includes the end of string character 2414 * Returns 1 if successful or -1 on error 2415 * 2416 * This function deprecated use libewf_file_entry_get_utf8_name_size instead 2417 */ 2418 LIBEWF_DEPRECATED \ 2419 LIBEWF_EXTERN \ 2420 int libewf_file_entry_get_name_size( 2421 libewf_file_entry_t *file_entry, 2422 size_t *name_size, 2423 libewf_error_t **error ); 2424 2425 /* Retrieves the UTF-8 encoded name value 2426 * The size should include the end of string character 2427 * Returns 1 if successful or -1 on error 2428 * 2429 * This function deprecated use libewf_file_entry_get_utf8_name instead 2430 */ 2431 LIBEWF_DEPRECATED \ 2432 LIBEWF_EXTERN \ 2433 int libewf_file_entry_get_name( 2434 libewf_file_entry_t *file_entry, 2435 uint8_t *name, 2436 size_t name_size, 2437 libewf_error_t **error ); 2438 2439 /* Retrieves the amount of sub file entries 2440 * Returns 1 if successful or -1 on error 2441 * 2442 * This function deprecated use libewf_file_entry_get_number_of_sub_file_entries instead 2443 */ 2444 LIBEWF_DEPRECATED \ 2445 LIBEWF_EXTERN \ 2446 int libewf_file_entry_get_amount_of_sub_file_entries( 2447 libewf_file_entry_t *file_entry, 2448 int *amount_of_sub_file_entries, 2449 libewf_error_t **error ); 2450 2451 /* ------------------------------------------------------------------------- 2452 * APIv1 functions - deprecated 2453 * ------------------------------------------------------------------------- */ 2454 2455 #if 0 || defined( HAVE_V1_API ) 2456 2457 /* ------------------------------------------------------------------------- 2458 * Notify functions 2459 * ------------------------------------------------------------------------- */ 2460 2461 /* Sets the notify values 2462 * 2463 * This function is deprecated use libewf_notify_set_verbose and libewf_notify_set_stream instead 2464 */ 2465 LIBEWF_DEPRECATED \ 2466 LIBEWF_EXTERN void libewf_set_notify_values( 2467 FILE *stream, 2468 uint8_t verbose ); 2469 2470 /* ------------------------------------------------------------------------- 2471 * File/Handle functions 2472 * ------------------------------------------------------------------------- */ 2473 2474 /* Signals the libewf handle to abort its current activity 2475 * Returns 1 if successful or -1 on error 2476 * 2477 * This function deprecated use libewf_handle_signal_abort instead 2478 */ 2479 LIBEWF_DEPRECATED \ 2480 LIBEWF_EXTERN int libewf_signal_abort( 2481 libewf_handle_t *handle ); 2482 2483 /* Opens a set of EWF file(s) 2484 * For reading files should contain all filenames that make up an EWF image 2485 * For writing files should contain the base of the filename, extentions like .e01 will be automatically added 2486 * Returns a pointer to the new instance of handle, NULL on error 2487 * 2488 * This function deprecated use libewf_handle_open instead 2489 */ 2490 LIBEWF_DEPRECATED \ 2491 LIBEWF_EXTERN libewf_handle_t *libewf_open( 2492 char * const filenames[], 2493 int amount_of_filenames, 2494 uint8_t flags ); 2495 2496 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 2497 /* Opens a set of EWF file(s) 2498 * For reading files should contain all filenames that make up an EWF image 2499 * For writing files should contain the base of the filename, extentions like .e01 will be automatically added 2500 * Returns a pointer to the new instance of handle, NULL on error 2501 * 2502 * This function deprecated use libewf_handle_open_wide instead 2503 */ 2504 LIBEWF_DEPRECATED \ 2505 LIBEWF_EXTERN libewf_handle_t *libewf_open_wide( 2506 wchar_t * const filenames[], 2507 int amount_of_filenames, 2508 uint8_t flags ); 2509 #endif 2510 2511 /* Closes the EWF handle and frees memory used within the handle 2512 * Returns 0 if successful or -1 on error 2513 * 2514 * This function deprecated use libewf_handle_close instead 2515 */ 2516 LIBEWF_DEPRECATED \ 2517 LIBEWF_EXTERN int libewf_close( 2518 libewf_handle_t *handle ); 2519 2520 /* Seeks a certain offset of the (media) data 2521 * Returns the offset if seek is successful or -1 on error 2522 * 2523 * This function is deprecated use libewf_handle_seek_offset instead 2524 */ 2525 LIBEWF_DEPRECATED \ 2526 LIBEWF_EXTERN off64_t libewf_seek_offset( 2527 libewf_handle_t *handle, 2528 off64_t offset ); 2529 2530 /* Retrieves the current offset of the (media) data 2531 * Returns the offset if successful or -1 on error 2532 * 2533 * This function is deprecated use libewf_handle_get_offset instead 2534 */ 2535 LIBEWF_DEPRECATED \ 2536 LIBEWF_EXTERN off64_t libewf_get_offset( 2537 libewf_handle_t *handle ); 2538 2539 /* Prepares a buffer with chunk data after reading it according to the handle settings 2540 * intended for raw read 2541 * The buffer size cannot be larger than the chunk size 2542 * Returns the resulting chunk size or -1 on error 2543 * 2544 * This function is deprecated use libewf_handle_prepare_read_chunk instead 2545 */ 2546 LIBEWF_DEPRECATED \ 2547 LIBEWF_EXTERN ssize_t libewf_raw_read_prepare_buffer( 2548 libewf_handle_t *handle, 2549 void *buffer, 2550 size_t buffer_size, 2551 void *uncompressed_buffer, 2552 size_t *uncompressed_buffer_size, 2553 int8_t is_compressed, 2554 uint32_t chunk_checksum, 2555 int8_t read_checksum ); 2556 2557 /* Reads 'raw' data from the current offset into a buffer 2558 * size contains the size of the buffer 2559 * The function sets the chunk checksum, is compressed and read checksum values 2560 * Returns the amount of bytes read or -1 on error 2561 * 2562 * This function is deprecated use libewf_handle_read_chunk instead 2563 */ 2564 LIBEWF_DEPRECATED \ 2565 LIBEWF_EXTERN ssize_t libewf_raw_read_buffer( 2566 libewf_handle_t *handle, 2567 void *buffer, 2568 size_t buffer_size, 2569 int8_t *is_compressed, 2570 uint32_t *chunk_checksum, 2571 int8_t *read_checksum ); 2572 2573 /* Reads data from the current offset into a buffer 2574 * Returns the amount of bytes read or -1 on error 2575 * 2576 * This function is deprecated use libewf_handle_read_buffer instead 2577 */ 2578 LIBEWF_DEPRECATED \ 2579 LIBEWF_EXTERN ssize_t libewf_read_buffer( 2580 libewf_handle_t *handle, 2581 void *buffer, 2582 size_t buffer_size ); 2583 2584 /* Reads (media) data at a specific offset 2585 * Returns the amount of bytes read or -1 on error 2586 * 2587 * This function is deprecated use libewf_handle_read_random instead 2588 */ 2589 LIBEWF_DEPRECATED \ 2590 LIBEWF_EXTERN ssize_t libewf_read_random( 2591 libewf_handle_t *handle, 2592 void *buffer, 2593 size_t buffer_size, 2594 off64_t offset ); 2595 2596 /* Prepares a buffer with chunk data before writing according to the handle settings 2597 * intended for raw write 2598 * The buffer size cannot be larger than the chunk size 2599 * The function sets the chunk checksum, is compressed and write checksum values 2600 * Returns the resulting chunk size or -1 on error 2601 * 2602 * This function is deprecated use libewf_handle_prepare_write_chunk instead 2603 */ 2604 LIBEWF_DEPRECATED \ 2605 LIBEWF_EXTERN ssize_t libewf_raw_write_prepare_buffer( 2606 libewf_handle_t *handle, 2607 void *buffer, 2608 size_t buffer_size, 2609 void *compressed_buffer, 2610 size_t *compressed_buffer_size, 2611 int8_t *is_compressed, 2612 uint32_t *chunk_checksum, 2613 int8_t *write_checksum ); 2614 2615 /* Writes 'raw' data in EWF format at the current offset 2616 * the necessary settings of the write values must have been made 2617 * size contains the size of the data within the buffer while 2618 * data size contains the size of the actual input data 2619 * Will initialize write if necessary 2620 * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error 2621 * 2622 * This function is deprecated use libewf_handle_write_chunk instead 2623 */ 2624 LIBEWF_DEPRECATED \ 2625 LIBEWF_EXTERN ssize_t libewf_raw_write_buffer( 2626 libewf_handle_t *handle, 2627 void *buffer, 2628 size_t buffer_size, 2629 size_t data_size, 2630 int8_t is_compressed, 2631 uint32_t chunk_checksum, 2632 int8_t write_checksum ); 2633 2634 /* Writes data in EWF format at the current offset 2635 * the necessary settings of the write values must have been made 2636 * Will initialize write if necessary 2637 * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error 2638 * 2639 * This function is deprecated use libewf_handle_write_buffer instead 2640 */ 2641 LIBEWF_DEPRECATED \ 2642 LIBEWF_EXTERN ssize_t libewf_write_buffer( 2643 libewf_handle_t *handle, 2644 void *buffer, 2645 size_t buffer_size ); 2646 2647 /* Writes data in EWF format at a specific offset, 2648 * the necessary settings of the write values must have been made 2649 * Will initialize write if necessary 2650 * Returns the amount of input bytes written, 0 when no longer bytes can be written or -1 on error 2651 * 2652 * This function is deprecated use libewf_handle_write_random instead 2653 */ 2654 LIBEWF_DEPRECATED \ 2655 LIBEWF_EXTERN ssize_t libewf_write_random( 2656 libewf_handle_t *handle, 2657 void *buffer, 2658 size_t buffer_size, 2659 off64_t offset ); 2660 2661 /* Finalizes the write by correcting the EWF the meta data in the segment files 2662 * This function is required after writing from stream 2663 * Returns the amount of input bytes written or -1 on error 2664 * 2665 * This function is deprecated use libewf_handle_write_finalize instead 2666 */ 2667 LIBEWF_DEPRECATED \ 2668 LIBEWF_EXTERN ssize_t libewf_write_finalize( 2669 libewf_handle_t *handle ); 2670 2671 /* Retrieves the segment filename 2672 * The filename size should include the end of string character 2673 * Returns 1 if successful, 0 if value not present or -1 on error 2674 * 2675 * This function is deprecated use libewf_handle_get_segment_filename instead 2676 */ 2677 LIBEWF_DEPRECATED \ 2678 LIBEWF_EXTERN int libewf_get_segment_filename( 2679 libewf_handle_t *handle, 2680 char *filename, 2681 size_t filename_size ); 2682 2683 /* Sets the segment filename 2684 * Returns 1 if successful or -1 on error 2685 * 2686 * This function is deprecated use libewf_handle_set_segment_filename instead 2687 */ 2688 LIBEWF_DEPRECATED \ 2689 LIBEWF_EXTERN int libewf_set_segment_filename( 2690 libewf_handle_t *handle, 2691 const char *filename, 2692 size_t filename_length ); 2693 2694 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 2695 /* Retrieves the segment filename 2696 * The filename size should include the end of string character 2697 * Returns 1 if successful, 0 if value not present or -1 on error 2698 * 2699 * This function is deprecated use libewf_handle_get_segment_filename_wide instead 2700 */ 2701 LIBEWF_DEPRECATED \ 2702 LIBEWF_EXTERN int libewf_get_segment_filename_wide( 2703 libewf_handle_t *handle, 2704 wchar_t *filename, 2705 size_t filename_size ); 2706 2707 /* Sets the segment filename 2708 * Returns 1 if successful or -1 on error 2709 * 2710 * This function is deprecated use libewf_handle_set_segment_filename_wide instead 2711 */ 2712 LIBEWF_DEPRECATED \ 2713 LIBEWF_EXTERN int libewf_set_segment_filename_wide( 2714 libewf_handle_t *handle, 2715 const wchar_t *filename, 2716 size_t filename_length ); 2717 #endif 2718 2719 /* Retrieves the segment file size 2720 * Returns 1 if successful or -1 on error 2721 * 2722 * This function is deprecated use libewf_handle_get_maximum_segment_size instead 2723 */ 2724 LIBEWF_DEPRECATED \ 2725 LIBEWF_EXTERN int libewf_get_segment_file_size( 2726 libewf_handle_t *handle, 2727 size64_t *segment_file_size ); 2728 2729 /* Sets the segment file size 2730 * Returns 1 if successful or -1 on error 2731 * 2732 * This function is deprecated use libewf_handle_set_maximum_segment_size instead 2733 */ 2734 LIBEWF_DEPRECATED \ 2735 LIBEWF_EXTERN int libewf_set_segment_file_size( 2736 libewf_handle_t *handle, 2737 size64_t segment_file_size ); 2738 2739 /* Retrieves the delta segment filename 2740 * The filename size should include the end of string character 2741 * Returns 1 if successful, 0 if value not present or -1 on error 2742 * 2743 * This function is deprecated use libewf_handle_get_delta_segment_filename instead 2744 */ 2745 LIBEWF_DEPRECATED \ 2746 LIBEWF_EXTERN int libewf_get_delta_segment_filename( 2747 libewf_handle_t *handle, 2748 char *filename, 2749 size_t filename_size ); 2750 2751 /* Sets the delta segment filename 2752 * Returns 1 if successful or -1 on error 2753 * 2754 * This function is deprecated use libewf_handle_set_delta_segment_filename instead 2755 */ 2756 LIBEWF_DEPRECATED \ 2757 LIBEWF_EXTERN int libewf_set_delta_segment_filename( 2758 libewf_handle_t *handle, 2759 const char *filename, 2760 size_t filename_length ); 2761 2762 #if defined( LIBEWF_HAVE_WIDE_CHARACTER_TYPE ) 2763 /* Retrieves the delta segment filename 2764 * The filename size should include the end of string character 2765 * Returns 1 if successful, 0 if value not present or -1 on error 2766 * 2767 * This function is deprecated use libewf_handle_get_delta_segment_filename_wide instead 2768 */ 2769 LIBEWF_DEPRECATED \ 2770 LIBEWF_EXTERN int libewf_get_delta_segment_filename_wide( 2771 libewf_handle_t *handle, 2772 wchar_t *filename, 2773 size_t filename_size ); 2774 2775 /* Sets the delta segment filename 2776 * Returns 1 if successful or -1 on error 2777 * 2778 * This function is deprecated use libewf_handle_set_delta_segment_filename_wide instead 2779 */ 2780 LIBEWF_DEPRECATED \ 2781 LIBEWF_EXTERN int libewf_set_delta_segment_filename_wide( 2782 libewf_handle_t *handle, 2783 const wchar_t *filename, 2784 size_t filename_length ); 2785 #endif 2786 2787 /* Retrieves the delta segment file size 2788 * Returns 1 if successful or -1 on error 2789 * 2790 * This function is deprecated use libewf_handle_get_maximum_delta_segment_size instead 2791 */ 2792 LIBEWF_DEPRECATED \ 2793 LIBEWF_EXTERN int libewf_get_delta_segment_file_size( 2794 libewf_handle_t *handle, 2795 size64_t *delta_segment_file_size ); 2796 2797 /* Sets the delta segment file size 2798 * Returns 1 if successful or -1 on error 2799 * 2800 * This function is deprecated use libewf_handle_set_maximum_delta_segment_size instead 2801 */ 2802 LIBEWF_DEPRECATED \ 2803 LIBEWF_EXTERN int libewf_set_delta_segment_file_size( 2804 libewf_handle_t *handle, 2805 size64_t delta_segment_file_size ); 2806 2807 /* ------------------------------------------------------------------------- 2808 * Meta data functions 2809 * ------------------------------------------------------------------------- */ 2810 2811 /* Retrieves the amount of sectors per chunk 2812 * Returns 1 if successful or -1 on error 2813 * 2814 * This function is deprecated use libewf_handle_get_sectors_per_chunk instead 2815 */ 2816 LIBEWF_DEPRECATED \ 2817 LIBEWF_EXTERN int libewf_get_sectors_per_chunk( 2818 libewf_handle_t *handle, 2819 uint32_t *sectors_per_chunk ); 2820 2821 /* Sets the amount of sectors per chunk 2822 * Returns 1 if successful or -1 on error 2823 * 2824 * This function is deprecated use libewf_handle_set_sectors_per_chunk instead 2825 */ 2826 LIBEWF_DEPRECATED \ 2827 LIBEWF_EXTERN int libewf_set_sectors_per_chunk( 2828 libewf_handle_t *handle, 2829 uint32_t sectors_per_chunk ); 2830 2831 /* Retrieves the amount of bytes per sector 2832 * Returns 1 if successful or -1 on error 2833 * 2834 * This function is deprecated use libewf_handle_get_bytes_per_sector instead 2835 */ 2836 LIBEWF_DEPRECATED \ 2837 LIBEWF_EXTERN int libewf_get_bytes_per_sector( 2838 libewf_handle_t *handle, 2839 uint32_t *bytes_per_sector ); 2840 2841 /* Sets the amount of bytes per sector 2842 * Returns 1 if successful or -1 on error 2843 * 2844 * This function is deprecated use libewf_handle_set_bytes_per_sector instead 2845 */ 2846 LIBEWF_DEPRECATED \ 2847 LIBEWF_EXTERN int libewf_set_bytes_per_sector( 2848 libewf_handle_t *handle, 2849 uint32_t bytes_per_sector ); 2850 2851 /* Retrieves the amount of sectors 2852 * Returns 1 if successful or -1 on error 2853 * 2854 * This function is deprecated use libewf_handle_get_number_of_sectors instead 2855 */ 2856 LIBEWF_DEPRECATED \ 2857 LIBEWF_EXTERN int libewf_get_amount_of_sectors( 2858 libewf_handle_t *handle, 2859 uint32_t *amount_of_sectors ); 2860 2861 /* Retrieves the chunk size 2862 * Returns 1 if successful or -1 on error 2863 * 2864 * This function is deprecated use libewf_handle_get_chunk_size instead 2865 */ 2866 LIBEWF_DEPRECATED \ 2867 LIBEWF_EXTERN int libewf_get_chunk_size( 2868 libewf_handle_t *handle, 2869 size32_t *chunk_size ); 2870 2871 /* Retrieves the error granularity 2872 * Returns 1 if successful or -1 on error 2873 * 2874 * This function is deprecated use libewf_handle_get_error_granularity instead 2875 */ 2876 LIBEWF_DEPRECATED \ 2877 LIBEWF_EXTERN int libewf_get_error_granularity( 2878 libewf_handle_t *handle, 2879 uint32_t *error_granularity ); 2880 2881 /* Sets the error granularity 2882 * Returns 1 if successful or -1 on error 2883 * 2884 * This function is deprecated use libewf_handle_set_error_granularity instead 2885 */ 2886 LIBEWF_DEPRECATED \ 2887 LIBEWF_EXTERN int libewf_set_error_granularity( 2888 libewf_handle_t *handle, 2889 uint32_t error_granularity ); 2890 2891 /* Retrieves the compression values 2892 * Returns 1 if successful or -1 on error 2893 * 2894 * This function is deprecated use libewf_handle_get_compression_values instead 2895 */ 2896 LIBEWF_DEPRECATED \ 2897 LIBEWF_EXTERN int libewf_get_compression_values( 2898 libewf_handle_t *handle, 2899 int8_t *compression_level, 2900 uint8_t *compress_empty_block ); 2901 2902 /* Sets the compression values 2903 * Returns 1 if successful or -1 on error 2904 * 2905 * This function is deprecated use libewf_handle_set_compression_values instead 2906 */ 2907 LIBEWF_DEPRECATED \ 2908 LIBEWF_EXTERN int libewf_set_compression_values( 2909 libewf_handle_t *handle, 2910 int8_t compression_level, 2911 uint8_t compress_empty_block ); 2912 2913 /* Retrieves the size of the contained (media) data 2914 * Returns 1 if successful or -1 on error 2915 * 2916 * This function is deprecated use libewf_handle_get_media_size instead 2917 */ 2918 LIBEWF_DEPRECATED \ 2919 LIBEWF_EXTERN int libewf_get_media_size( 2920 libewf_handle_t *handle, 2921 size64_t *media_size ); 2922 2923 /* Sets the media size 2924 * Returns 1 if successful or -1 on error 2925 * 2926 * This function is deprecated use libewf_handle_set_media_size instead 2927 */ 2928 LIBEWF_DEPRECATED \ 2929 LIBEWF_EXTERN int libewf_set_media_size( 2930 libewf_handle_t *handle, 2931 size64_t media_size ); 2932 2933 /* Retrieves the media type value 2934 * Returns 1 if successful or -1 on error 2935 * 2936 * This function is deprecated use libewf_handle_get_media_type instead 2937 */ 2938 LIBEWF_DEPRECATED \ 2939 LIBEWF_EXTERN int libewf_get_media_type( 2940 libewf_handle_t *handle, 2941 uint8_t *media_type ); 2942 2943 /* Sets the media type 2944 * Returns 1 if successful or -1 on error 2945 * 2946 * This function is deprecated use libewf_handle_set_media_type instead 2947 */ 2948 LIBEWF_DEPRECATED \ 2949 LIBEWF_EXTERN int libewf_set_media_type( 2950 libewf_handle_t *handle, 2951 uint8_t media_type ); 2952 2953 /* Retrieves the media flags 2954 * Returns 1 if successful or -1 on error 2955 * 2956 * This function is deprecated use libewf_handle_get_media_flags instead 2957 */ 2958 LIBEWF_DEPRECATED \ 2959 LIBEWF_EXTERN int libewf_get_media_flags( 2960 libewf_handle_t *handle, 2961 uint8_t *media_flags ); 2962 2963 /* Sets the media flags 2964 * Returns 1 if successful or -1 on error 2965 * 2966 * This function is deprecated use libewf_handle_set_media_flags instead 2967 */ 2968 LIBEWF_DEPRECATED \ 2969 LIBEWF_EXTERN int libewf_set_media_flags( 2970 libewf_handle_t *handle, 2971 uint8_t media_flags ); 2972 2973 /* Retrieves the volume type value 2974 * Returns 1 if successful or -1 on error 2975 * 2976 * This function is deprecated use libewf_handle_get_media_flags instead 2977 */ 2978 LIBEWF_DEPRECATED \ 2979 LIBEWF_EXTERN int libewf_get_volume_type( 2980 libewf_handle_t *handle, 2981 uint8_t *volume_type ); 2982 2983 /* Sets the volume type 2984 * Returns 1 if successful or -1 on error 2985 * 2986 * This function is deprecated use libewf_handle_set_media_flags instead 2987 */ 2988 LIBEWF_DEPRECATED \ 2989 LIBEWF_EXTERN int libewf_set_volume_type( 2990 libewf_handle_t *handle, 2991 uint8_t volume_type ); 2992 2993 /* Retrieves the format type value 2994 * Returns 1 if successful or -1 on error 2995 * 2996 * This function is deprecated use libewf_handle_get_format instead 2997 */ 2998 LIBEWF_DEPRECATED \ 2999 LIBEWF_EXTERN int libewf_get_format( 3000 libewf_handle_t *handle, 3001 uint8_t *format ); 3002 3003 /* Sets the output format 3004 * Returns 1 if successful or -1 on error 3005 * 3006 * This function is deprecated use libewf_handle_set_format instead 3007 */ 3008 LIBEWF_DEPRECATED \ 3009 LIBEWF_EXTERN int libewf_set_format( 3010 libewf_handle_t *handle, 3011 uint8_t format ); 3012 3013 /* Retrieves the GUID 3014 * Returns 1 if successful or -1 on error 3015 * 3016 * This function is deprecated use libewf_handle_get_guid instead 3017 */ 3018 LIBEWF_DEPRECATED \ 3019 LIBEWF_EXTERN int libewf_get_guid( 3020 libewf_handle_t *handle, 3021 uint8_t *guid, 3022 size_t size ); 3023 3024 /* Sets the GUID 3025 * Returns 1 if successful or -1 on error 3026 * 3027 * This function is deprecated use libewf_handle_set_guid instead 3028 */ 3029 LIBEWF_DEPRECATED \ 3030 LIBEWF_EXTERN int libewf_set_guid( 3031 libewf_handle_t *handle, 3032 uint8_t *guid, 3033 size_t size ); 3034 3035 /* Retrieves the GUID 3036 * Returns 1 if successful or -1 on error 3037 * 3038 * This function is deprecated use libewf_handle_get_segment_file_set_identifier instead 3039 */ 3040 LIBEWF_DEPRECATED \ 3041 LIBEWF_EXTERN \ 3042 int libewf_handle_get_guid( 3043 libewf_handle_t *handle, 3044 uint8_t *guid, 3045 size_t size, 3046 libewf_error_t **error ); 3047 3048 /* Sets the GUID 3049 * Returns 1 if successful or -1 on error 3050 * 3051 * This function is deprecated use libewf_handle_set_segment_file_set_identifier instead 3052 */ 3053 LIBEWF_DEPRECATED \ 3054 LIBEWF_EXTERN \ 3055 int libewf_handle_set_guid( 3056 libewf_handle_t *handle, 3057 uint8_t *guid, 3058 size_t size, 3059 libewf_error_t **error ); 3060 3061 /* Retrieves the MD5 hash 3062 * Returns 1 if successful, 0 if value not present or -1 on error 3063 * 3064 * This function is deprecated use libewf_handle_get_md5_hash instead 3065 */ 3066 LIBEWF_DEPRECATED \ 3067 LIBEWF_EXTERN int libewf_get_md5_hash( 3068 libewf_handle_t *handle, 3069 uint8_t *md5_hash, 3070 size_t size ); 3071 3072 /* Sets the MD5 hash 3073 * Returns 1 if successful, 0 if value not present or -1 on error 3074 * 3075 * This function is deprecated use libewf_handle_set_md5_hash instead 3076 */ 3077 LIBEWF_DEPRECATED \ 3078 LIBEWF_EXTERN int libewf_set_md5_hash( 3079 libewf_handle_t *handle, 3080 uint8_t *md5_hash, 3081 size_t size ); 3082 3083 /* Retrieves the SHA1 hash 3084 * Returns 1 if successful, 0 if value not present or -1 on error 3085 * 3086 * This function is deprecated use libewf_handle_get_sha1_hash instead 3087 */ 3088 LIBEWF_DEPRECATED \ 3089 LIBEWF_EXTERN int libewf_get_sha1_hash( 3090 libewf_handle_t *handle, 3091 uint8_t *sha1_hash, 3092 size_t size ); 3093 3094 /* Sets the SHA1 hash 3095 * Returns 1 if successful, 0 if value not present or -1 on error 3096 * 3097 * This function is deprecated use libewf_handle_set_sha1_hash instead 3098 */ 3099 LIBEWF_DEPRECATED \ 3100 LIBEWF_EXTERN int libewf_set_sha1_hash( 3101 libewf_handle_t *handle, 3102 uint8_t *sha1_hash, 3103 size_t size ); 3104 3105 /* Retrieves the amount of chunks written 3106 * Returns 1 if successful or -1 on error 3107 * 3108 * This function is deprecated use libewf_handle_get_write_amount_of_chunks instead 3109 */ 3110 LIBEWF_DEPRECATED \ 3111 LIBEWF_EXTERN int libewf_get_write_amount_of_chunks( 3112 libewf_handle_t *handle, 3113 uint32_t *amount_of_chunks ); 3114 3115 /* Sets the read wipe chunk on error 3116 * The chunk is not wiped if read raw is used 3117 * Returns 1 if successful or -1 on error 3118 * 3119 * This function is deprecated use libewf_handle_set_read_zero_chunk_on_error instead 3120 */ 3121 LIBEWF_DEPRECATED \ 3122 LIBEWF_EXTERN int libewf_set_read_wipe_chunk_on_error( 3123 libewf_handle_t *handle, 3124 uint8_t wipe_on_error ); 3125 3126 /* Copies the media values from the source to the destination handle 3127 * Returns 1 if successful or -1 on error 3128 * 3129 * This function is deprecated use libewf_handle_copy_media_values instead 3130 */ 3131 LIBEWF_DEPRECATED \ 3132 LIBEWF_EXTERN int libewf_copy_media_values( 3133 libewf_handle_t *destination_handle, 3134 libewf_handle_t *source_handle ); 3135 3136 /* Retrieves the amount of acquiry errors 3137 * Returns 1 if successful or -1 on error 3138 * 3139 * This function is deprecated use libewf_handle_get_number_of_acquiry_errors instead 3140 */ 3141 LIBEWF_DEPRECATED \ 3142 LIBEWF_EXTERN int libewf_get_amount_of_acquiry_errors( 3143 libewf_handle_t *handle, 3144 uint32_t *amount_of_errors ); 3145 3146 /* Retrieves an acquiry error 3147 * Returns 1 if successful or -1 on error 3148 * 3149 * This function is deprecated use libewf_handle_get_acquiry_error instead 3150 */ 3151 LIBEWF_DEPRECATED \ 3152 LIBEWF_EXTERN int libewf_get_acquiry_error( 3153 libewf_handle_t *handle, 3154 uint32_t index, 3155 off64_t *start_sector, 3156 uint32_t *amount_of_sectors ); 3157 3158 /* Add an acquiry error 3159 * Returns 1 if successful or -1 on error 3160 * 3161 * This function is deprecated use libewf_handle_append_acquiry_error instead 3162 */ 3163 LIBEWF_DEPRECATED \ 3164 LIBEWF_EXTERN int libewf_add_acquiry_error( 3165 libewf_handle_t *handle, 3166 off64_t start_sector, 3167 uint32_t amount_of_sectors ); 3168 3169 /* Retrieves the amount of checksum errors 3170 * Returns 1 if successful or -1 on error 3171 * 3172 * This function is deprecated use libewf_handle_get_number_of_checksum_errors instead 3173 */ 3174 LIBEWF_DEPRECATED \ 3175 LIBEWF_EXTERN int libewf_get_amount_of_crc_errors( 3176 libewf_handle_t *handle, 3177 uint32_t *amount_of_errors ); 3178 3179 /* Retrieves a checksum error 3180 * Returns 1 if successful or -1 on error 3181 * 3182 * This function is deprecated use libewf_handle_get_checksum_error instead 3183 */ 3184 LIBEWF_DEPRECATED \ 3185 LIBEWF_EXTERN int libewf_get_crc_error( 3186 libewf_handle_t *handle, 3187 uint32_t index, 3188 off64_t *start_sector, 3189 uint32_t *amount_of_sectors ); 3190 3191 /* Add a checksum error 3192 * Returns 1 if successful or -1 on error 3193 * 3194 * This function is deprecated use libewf_handle_append_checksum_error instead 3195 */ 3196 LIBEWF_DEPRECATED \ 3197 LIBEWF_EXTERN int libewf_add_crc_error( 3198 libewf_handle_t *handle, 3199 off64_t start_sector, 3200 uint32_t amount_of_sectors ); 3201 3202 /* Retrieves the amount of sessions 3203 * Returns 1 if successful or -1 on error 3204 * 3205 * This function is deprecated use libewf_handle_get_number_of_sessions instead 3206 */ 3207 LIBEWF_DEPRECATED \ 3208 LIBEWF_EXTERN int libewf_get_amount_of_sessions( 3209 libewf_handle_t *handle, 3210 uint32_t *amount_of_sessions ); 3211 3212 /* Retrieves a session 3213 * Returns 1 if successful or -1 on error 3214 * 3215 * This function is deprecated use libewf_handle_get_session instead 3216 */ 3217 LIBEWF_DEPRECATED \ 3218 LIBEWF_EXTERN int libewf_get_session( 3219 libewf_handle_t *handle, 3220 uint32_t index, 3221 off64_t *start_sector, 3222 uint32_t *amount_of_sectors ); 3223 3224 /* Add a session 3225 * Returns 1 if successful or -1 on error 3226 * 3227 * This function is deprecated use libewf_handle_append_session instead 3228 */ 3229 LIBEWF_DEPRECATED \ 3230 LIBEWF_EXTERN int libewf_add_session( 3231 libewf_handle_t *handle, 3232 off64_t start_sector, 3233 uint32_t amount_of_sectors ); 3234 3235 /* Retrieves the header codepage 3236 * Returns 1 if successful or -1 on error 3237 * 3238 * This function is deprecated use libewf_handle_get_header_codepage instead 3239 */ 3240 LIBEWF_DEPRECATED \ 3241 LIBEWF_EXTERN int libewf_get_header_codepage( 3242 libewf_handle_t *handle, 3243 int *header_codepage ); 3244 3245 /* Sets the header codepage 3246 * Returns 1 if successful or -1 on error 3247 * 3248 * This function is deprecated use libewf_handle_set_header_codepage instead 3249 */ 3250 LIBEWF_DEPRECATED \ 3251 LIBEWF_EXTERN int libewf_set_header_codepage( 3252 libewf_handle_t *handle, 3253 int header_codepage ); 3254 3255 /* Retrieves the amount of header values 3256 * Returns 1 if successful, 0 if no header values are present or -1 on error 3257 * 3258 * This function is deprecated use libewf_handle_get_number_of_header_values instead 3259 */ 3260 LIBEWF_DEPRECATED \ 3261 LIBEWF_EXTERN int libewf_get_amount_of_header_values( 3262 libewf_handle_t *handle, 3263 uint32_t *amount_of_values ); 3264 3265 /* Retrieves the header value identifier size specified by its index 3266 * The identifier size includes the end of string character 3267 * Returns 1 if successful, 0 if value not present or -1 on error 3268 * 3269 * This function is deprecated use libewf_handle_get_header_value_identifier_size instead 3270 */ 3271 LIBEWF_DEPRECATED \ 3272 LIBEWF_EXTERN int libewf_get_header_value_identifier_size( 3273 libewf_handle_t *handle, 3274 uint32_t index, 3275 size_t *identifier_size ); 3276 3277 /* Retrieves the header value identifier specified by its index 3278 * The strings are encoded in UTF-8 3279 * The identifier size should include the end of string character 3280 * Returns 1 if successful, 0 if value not present or -1 on error 3281 * 3282 * This function is deprecated use libewf_handle_get_header_value_identifier instead 3283 */ 3284 LIBEWF_DEPRECATED \ 3285 LIBEWF_EXTERN int libewf_get_header_value_identifier( 3286 libewf_handle_t *handle, 3287 uint32_t index, 3288 char *identifier, 3289 size_t identifier_size ); 3290 3291 /* Retrieves the header value size specified by the identifier 3292 * The value size includes the end of string character 3293 * Returns 1 if successful, 0 if value not present or -1 on error 3294 * 3295 * This function is deprecated use libewf_handle_get_header_value_size instead 3296 */ 3297 LIBEWF_DEPRECATED \ 3298 LIBEWF_EXTERN int libewf_get_header_value_size( 3299 libewf_handle_t *handle, 3300 const char *identifier, 3301 size_t *value_size ); 3302 3303 /* Retrieves the header value specified by the identifier 3304 * The strings are encoded in UTF-8 3305 * The value size should include the end of string character 3306 * Returns 1 if successful, 0 if value not present or -1 on error 3307 * 3308 * This function is deprecated use libewf_handle_get_header_value instead 3309 */ 3310 LIBEWF_DEPRECATED \ 3311 LIBEWF_EXTERN int libewf_get_header_value( 3312 libewf_handle_t *handle, 3313 const char *identifier, 3314 char *value, 3315 size_t value_size ); 3316 3317 /* Retrieves the header value case number 3318 * Returns 1 if successful, 0 if value not present or -1 on error 3319 */ 3320 #define libewf_get_header_value_case_number( handle, value, value_size ) \ 3321 libewf_get_header_value( handle, "case_number", value, value_size ) 3322 3323 /* Retrieves the header value description 3324 * Returns 1 if successful, 0 if value not present or -1 on error 3325 */ 3326 #define libewf_get_header_value_description( handle, value, value_size ) \ 3327 libewf_get_header_value( handle, "description", value, value_size ) 3328 3329 /* Retrieves the header value examiner name 3330 * Returns 1 if successful, 0 if value not present or -1 on error 3331 */ 3332 #define libewf_get_header_value_examiner_name( handle, value, value_size ) \ 3333 libewf_get_header_value( handle, "examiner_name", value, value_size ) 3334 3335 /* Retrieves the header value evidence number 3336 * Returns 1 if successful, 0 if value not present or -1 on error 3337 */ 3338 #define libewf_get_header_value_evidence_number( handle, value, value_size ) \ 3339 libewf_get_header_value( handle, "evidence_number", value, value_size ) 3340 3341 /* Retrieves the header value notes 3342 * Returns 1 if successful, 0 if value not present or -1 on error 3343 */ 3344 #define libewf_get_header_value_notes( handle, value, value_size ) \ 3345 libewf_get_header_value( handle, "notes", value, value_size ) 3346 3347 /* Retrieves the header value acquiry date 3348 * The string is encoded according to the date format 3349 * Returns 1 if successful, 0 if value not present or -1 on error 3350 */ 3351 #define libewf_get_header_value_acquiry_date( handle, value, value_size ) \ 3352 libewf_get_header_value( handle, "acquiry_date", value, value_size ) 3353 3354 /* Retrieves the header value system date 3355 * The string is encoded according to the date format 3356 * Returns 1 if successful, 0 if value not present or -1 on error 3357 */ 3358 #define libewf_get_header_value_system_date( handle, value, value_size ) \ 3359 libewf_get_header_value( handle, "system_date", value, value_size ) 3360 3361 /* Retrieves the header value acquiry operating system 3362 * Returns 1 if successful, 0 if value not present or -1 on error 3363 */ 3364 #define libewf_get_header_value_acquiry_operating_system( handle, value, value_size ) \ 3365 libewf_get_header_value( handle, "acquiry_operating_system", value, value_size ) 3366 3367 /* Retrieves the header value acquiry software version 3368 * Returns 1 if successful, 0 if value not present or -1 on error 3369 */ 3370 #define libewf_get_header_value_acquiry_software_version( handle, value, value_size ) \ 3371 libewf_get_header_value( handle, "acquiry_software_version", value, value_size ) 3372 3373 /* Retrieves the header value password 3374 * Returns 1 if successful, 0 if value not present or -1 on error 3375 */ 3376 #define libewf_get_header_value_password( handle, value, value_size ) \ 3377 libewf_get_header_value( handle, "password", value, value_size ) 3378 3379 /* Retrieves the header value compression type 3380 * Returns 1 if successful, 0 if value not present or -1 on error 3381 */ 3382 #define libewf_get_header_value_compression_type( handle, value, value_size ) \ 3383 libewf_get_header_value( handle, "compression_type", value, value_size ) 3384 3385 /* Retrieves the header value model 3386 * Returns 1 if successful, 0 if value not present or -1 on error 3387 */ 3388 #define libewf_get_header_value_model( handle, value, value_size ) \ 3389 libewf_get_header_value( handle, "model", value, value_size ) 3390 3391 /* Retrieves the header value serial number 3392 * Returns 1 if successful, 0 if value not present or -1 on error 3393 */ 3394 #define libewf_get_header_value_serial_number( handle, value, value_size ) \ 3395 libewf_get_header_value( handle, "serial_number", value, value_size ) 3396 3397 /* Sets the header value specified by the identifier 3398 * The strings are encoded in UTF-8 3399 * Returns 1 if successful or -1 on error 3400 * 3401 * This function is deprecated use libewf_handle_set_header_value instead 3402 */ 3403 LIBEWF_DEPRECATED \ 3404 LIBEWF_EXTERN int libewf_set_header_value( 3405 libewf_handle_t *handle, 3406 const char *identifier, 3407 const char *value, 3408 size_t value_length ); 3409 3410 /* Sets the header value case number 3411 * Returns 1 if successful or -1 on error 3412 */ 3413 #define libewf_set_header_value_case_number( handle, value, value_length ) \ 3414 libewf_set_header_value( handle, "case_number", value, value_length ) 3415 3416 /* Sets the header value description 3417 * Returns 1 if successful or -1 on error 3418 */ 3419 #define libewf_set_header_value_description( handle, value, value_length ) \ 3420 libewf_set_header_value( handle, "description", value, value_length ) 3421 3422 /* Sets the header value examiner name 3423 * Returns 1 if successful or -1 on error 3424 */ 3425 #define libewf_set_header_value_examiner_name( handle, value, value_length ) \ 3426 libewf_set_header_value( handle, "examiner_name", value, value_length ) 3427 3428 /* Sets the header value evidence number 3429 * Returns 1 if successful or -1 on error 3430 */ 3431 #define libewf_set_header_value_evidence_number( handle, value, value_length ) \ 3432 libewf_set_header_value( handle, "evidence_number", value, value_length ) 3433 3434 /* Sets the header value notes 3435 * Returns 1 if successful or -1 on error 3436 */ 3437 #define libewf_set_header_value_notes( handle, value, value_length ) \ 3438 libewf_set_header_value( handle, "notes", value, value_length ) 3439 3440 /* Sets the header value acquiry date 3441 * Returns 1 if successful or -1 on error 3442 */ 3443 #define libewf_set_header_value_acquiry_date( handle, value, value_length ) \ 3444 libewf_set_header_value( handle, "acquiry_date", value, value_length ) 3445 3446 /* Sets the header value system date 3447 * Returns 1 if successful or -1 on error 3448 */ 3449 #define libewf_set_header_value_system_date( handle, value, value_length ) \ 3450 libewf_set_header_value( handle, "system_date", value, value_length ) 3451 3452 /* Sets the header value acquiry operating system 3453 * Returns 1 if successful or -1 on error 3454 */ 3455 #define libewf_set_header_value_acquiry_operating_system( handle, value, value_length ) \ 3456 libewf_set_header_value( handle, "acquiry_operating_system", value, value_length ) 3457 3458 /* Sets the header value acquiry software version 3459 * Returns 1 if successful or -1 on error 3460 */ 3461 #define libewf_set_header_value_acquiry_software_version( handle, value, value_length ) \ 3462 libewf_set_header_value( handle, "acquiry_software_version", value, value_length ) 3463 3464 /* Sets the header value password 3465 * Returns 1 if successful or -1 on error 3466 */ 3467 #define libewf_set_header_value_password( handle, value, value_length ) \ 3468 libewf_set_header_value( handle, "password", value, value_length ) 3469 3470 /* Sets the header value compression type 3471 * Returns 1 if successful or -1 on error 3472 */ 3473 #define libewf_set_header_value_compression_type( handle, value, value_length ) \ 3474 libewf_set_header_value( handle, "compression_type", value, value_length ) 3475 3476 /* Sets the header value model 3477 * Returns 1 if successful or -1 on error 3478 */ 3479 #define libewf_set_header_value_model( handle, value, value_length ) \ 3480 libewf_set_header_value( handle, "model", value, value_length ) 3481 3482 /* Sets the header value serial number 3483 * Returns 1 if successful or -1 on error 3484 */ 3485 #define libewf_set_header_value_serial_number( handle, value, value_length ) \ 3486 libewf_set_header_value( handle, "serial_number", value, value_length ) 3487 3488 /* Parses the header values from the xheader, header2 or header section 3489 * Will parse the first available header in order mentioned above 3490 * Returns 1 if successful, 0 if already parsed or -1 on error 3491 * 3492 * This function is deprecated and no longer required 3493 */ 3494 LIBEWF_DEPRECATED \ 3495 LIBEWF_EXTERN int libewf_parse_header_values( 3496 libewf_handle_t *handle, 3497 uint8_t date_format ); 3498 3499 /* Copies the header values from the source to the destination handle 3500 * Returns 1 if successful or -1 on error 3501 * 3502 * This function is deprecated use libewf_handle_copy_header_values instead 3503 */ 3504 LIBEWF_DEPRECATED \ 3505 LIBEWF_EXTERN int libewf_copy_header_values( 3506 libewf_handle_t *destination_handle, 3507 libewf_handle_t *source_handle ); 3508 3509 /* Retrieves the amount of hash values 3510 * Returns 1 if successful, 0 if no hash values are present or -1 on error 3511 * 3512 * This function is deprecated use libewf_handle_get_number_of_hash_values instead 3513 */ 3514 LIBEWF_DEPRECATED \ 3515 LIBEWF_EXTERN int libewf_get_amount_of_hash_values( 3516 libewf_handle_t *handle, 3517 uint32_t *amount_of_values ); 3518 3519 /* Retrieves the hash value identifier size specified by its index 3520 * The identifier size includes the end of string character 3521 * Returns 1 if successful, 0 if value not present or -1 on error 3522 * 3523 * This function is deprecated use libewf_handle_get_hash_value_identifier_size instead 3524 */ 3525 LIBEWF_DEPRECATED \ 3526 LIBEWF_EXTERN int libewf_get_hash_value_identifier_size( 3527 libewf_handle_t *handle, 3528 uint32_t index, 3529 size_t *identifier_size ); 3530 3531 /* Retrieves the hash value identifier specified by its index 3532 * The strings are encoded in UTF-8 3533 * The identifier size should include the end of string character 3534 * Returns 1 if successful, 0 if value not present or -1 on error 3535 * 3536 * This function is deprecated use libewf_handle_get_hash_value_identifier instead 3537 */ 3538 LIBEWF_DEPRECATED \ 3539 LIBEWF_EXTERN int libewf_get_hash_value_identifier( 3540 libewf_handle_t *handle, 3541 uint32_t index, 3542 char *identifier, 3543 size_t identifier_size ); 3544 3545 /* Retrieves the hash value size specified by the identifier 3546 * The value size includes the end of string character 3547 * Returns 1 if successful, 0 if value not present or -1 on error 3548 * 3549 * This function is deprecated use libewf_handle_get_hash_value_size instead 3550 */ 3551 LIBEWF_DEPRECATED \ 3552 LIBEWF_EXTERN int libewf_get_hash_value_size( 3553 libewf_handle_t *handle, 3554 const char *identifier, 3555 size_t *value_size ); 3556 3557 /* Retrieves the hash value specified by the identifier 3558 * The strings are encoded in UTF-8 3559 * The value size should include the end of string character 3560 * Returns 1 if successful, 0 if value not present or -1 on error 3561 * 3562 * This function is deprecated use libewf_handle_get_hash_value instead 3563 */ 3564 LIBEWF_DEPRECATED \ 3565 LIBEWF_EXTERN int libewf_get_hash_value( 3566 libewf_handle_t *handle, 3567 const char *identifier, 3568 char *value, 3569 size_t value_size ); 3570 3571 /* Retrieves the hash value MD5 3572 * Returns 1 if successful, 0 if value not present or -1 on error 3573 */ 3574 #define libewf_get_hash_value_md5( handle, value, value_size ) \ 3575 libewf_get_hash_value( handle, "MD5", value, value_size ) 3576 3577 /* Retrieves the hash value SHA1 3578 * Returns 1 if successful, 0 if value not present or -1 on error 3579 */ 3580 #define libewf_get_hash_value_sha1( handle, value, value_size ) \ 3581 libewf_get_hash_value( handle, "SHA1", value, value_size ) 3582 3583 /* Sets the hash value specified by the identifier 3584 * The strings are encoded in UTF-8 3585 * Returns 1 if successful or -1 on error 3586 * 3587 * This function is deprecated use libewf_handle_set_hash_value instead 3588 */ 3589 LIBEWF_DEPRECATED \ 3590 LIBEWF_EXTERN int libewf_set_hash_value( 3591 libewf_handle_t *handle, 3592 const char *identifier, 3593 const char *value, 3594 size_t value_length ); 3595 3596 /* Sets the hash value MD5 3597 * Returns 1 if successful or -1 on error 3598 */ 3599 #define libewf_set_hash_value_md5( handle, value, value_length ) \ 3600 libewf_set_hash_value( handle, "MD5", value, value_length ) 3601 3602 /* Sets the hash value SHA1 3603 * Returns 1 if successful or -1 on error 3604 */ 3605 #define libewf_set_hash_value_sha1( handle, value, value_length ) \ 3606 libewf_set_hash_value( handle, "SHA1", value, value_length ) 3607 3608 /* Parses the hash values from the xhash section 3609 * Returns 1 if successful, 0 if already parsed or -1 on error 3610 * 3611 * This function is deprecated and no longer required 3612 */ 3613 LIBEWF_DEPRECATED \ 3614 LIBEWF_EXTERN int libewf_parse_hash_values( 3615 libewf_handle_t *handle ); 3616 3617 #endif /* defined( HAVE_V1_API ) */ 3618 3619 #ifdef __cplusplus 3620 } 3621 #endif 3622 3623 #endif /* !defined( _LIBEWF_H ) */ 3624 3625