亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? libewf_read.c

?? sleuthit-2.09 一個磁盤的工具集
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * libewf file reading * * Copyright (c) 2006-2007, Joachim Metz <forensics@hoffmannbv.nl>, * Hoffmann Investigations. All rights reserved. * * Refer to AUTHORS for acknowledgements. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, *   this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, *   this list of conditions and the following disclaimer in the documentation *   and/or other materials provided with the distribution. * - Neither the name of the creator, related organisations, nor the names of *   its contributors may be used to endorse or promote products derived from *   this software without specific prior written permission. * - All advertising materials mentioning features or use of this software *   must acknowledge the contribution by people stated in the acknowledgements. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER, COMPANY AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */#include "libewf_includes.h"#include <libewf/libewf_definitions.h>#include "libewf_common.h"#include "libewf_endian.h"#include "libewf_notify.h"#include "libewf_file.h"#include "libewf_read.h"#include "libewf_section.h"#include "libewf_segment_table.h"#include "ewf_crc.h"#include "ewf_file_header.h"/* Builds the index (section list and offset table) from the input files * Returns 1 if successful, or -1 on error */int8_t libewf_read_build_index( LIBEWF_INTERNAL_HANDLE *internal_handle ){	EWF_SECTION *last_section = NULL;	uint16_t segment_number   = 0;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: invalid handle.\n" );		return( -1 );	}	if( internal_handle->index_build != 0 )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: index has already been build.\n" );		return( -1 );	}	if( libewf_internal_handle_read_initialize( internal_handle ) != 1 )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: unable to initialize read values in handle.\n" );		return( -1 );	}	for( segment_number = 1; segment_number < internal_handle->segment_table->amount; segment_number++ )	{		if( last_section != NULL )		{			libewf_common_free( last_section );		}		LIBEWF_VERBOSE_PRINT( "libewf_read_build_index: building index for segment number: %" PRIu32 ".\n", segment_number );		last_section = libewf_read_sections_from_segment( internal_handle, segment_number );	}	/* Check to see if the done section has been found	 */	if( last_section == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: invalid last section.\n" );		return( -1 );	}	else if( ewf_section_is_type_done( last_section ) == 0 )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: unable to find the last segment file (done section).\n" );		libewf_common_free( last_section );		return( -1 );	}	libewf_common_free( last_section );	/* Determine the EWF file format	 */	if( libewf_internal_handle_determine_format( internal_handle ) != 1 )	{		LIBEWF_WARNING_PRINT( "libewf_read_build_index: unable to determine file format.\n" );	}	LIBEWF_VERBOSE_PRINT( "libewf_read_build_index: index successful build.\n" );	/* Calculate the media size	 */	internal_handle->media->media_size = (uint64_t) internal_handle->media->amount_of_sectors * (uint64_t) internal_handle->media->bytes_per_sector;	/* Flag that the index was build	 */	internal_handle->index_build = 1;	return( 1 );}/* Reads and processes sections of a segment file * Returns the last section read, or NULL on error */EWF_SECTION *libewf_read_sections_from_segment( LIBEWF_INTERNAL_HANDLE *internal_handle, uint16_t segment_number ){	EWF_SECTION *section = NULL;	int file_descriptor  = 0;	/* The first offset is directly after the file header (13 byte)	 */	off_t previous_offset = (off_t) EWF_FILE_HEADER_SIZE;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_sections_read_segment: invalid handle.\n" );		return( NULL );	}	if( libewf_segment_table_values_is_set( internal_handle->segment_table, segment_number ) == 0 )	{		LIBEWF_WARNING_PRINT( "libewf_sections_read_segment: missing a segment file for segment %" PRIu32 ".\n", segment_number );		return( NULL );	}	file_descriptor = libewf_segment_table_get_file_descriptor( internal_handle->segment_table, segment_number );	if( file_descriptor <= -1 )	{		LIBEWF_WARNING_PRINT( "libewf_sections_read_segment: invalid file descriptor.\n" );		return( NULL );	}	do	{		if( section != NULL )		{			libewf_common_free( section );		}		section = libewf_section_read( internal_handle, file_descriptor, internal_handle->segment_table->section_list[ segment_number ], segment_number, &previous_offset );		if( section == NULL )		{			LIBEWF_WARNING_PRINT( "libewf_sections_read_segment: unable to read section.\n" );			return( NULL );		}		/* The done and next sections point back at themselves		 */		if( ( ewf_section_is_type_next( section ) == 1 ) || ( ewf_section_is_type_done( section ) == 1 ) )		{			break;		}	}	while( section != NULL );	return( section );}/* Reads a certain chunk of data from the segment file(s) * Will read until the requested size is filled or the entire chunk is read * This function swaps byte pairs if specified * Returns the amount of bytes read, 0 if no bytes can be read, or -1 on error */ssize_t libewf_read_chunk( LIBEWF_INTERNAL_HANDLE *internal_handle, uint32_t chunk, uint32_t chunk_offset, void *buffer, size_t size ){	EWF_CHUNK *chunk_data       = NULL;	EWF_CHUNK *chunk_read       = NULL;	EWF_CRC calculated_crc      = 0;	EWF_CRC stored_crc          = 0;#if defined( HAVE_WIDE_CHARACTER_TYPE ) && defined( HAVE_WIDE_CHARACTER_SUPPORT_FUNCTIONS )	wchar_t *filename           = NULL;#else	char *filename              = NULL;#endif	ssize_t chunk_read_count    = 0;	ssize_t crc_read_count      = 0;	size_t chunk_data_size      = 0;	size_t bytes_available      = 0;	size_t md5_hash_size        = 0;	uint16_t segment_number     = 0;	int8_t chunk_cache_used     = 0;	int8_t result               = 0;	uint8_t percentage          = 0;	int file_descriptor         = 0;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid handle.\n" );		return( -1 );	}	if( internal_handle->media == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid handle - missing subhandle media.\n" );		return( -1 );	}	if( internal_handle->read == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid handle - missing subhandle read.\n" );		return( -1 );	}	if( internal_handle->offset_table == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid handle - missing offset table.\n" );		return( -1 );	}	if( internal_handle->segment_table == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid handle - missing segment table.\n" );		return( -1 );	}	if( internal_handle->chunk_cache == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid chunk cache.\n" );		return( -1 );	}	if( internal_handle->index_build == 0 )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: index was not build.\n" );		return( -1 );	}	if( buffer == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid buffer.\n" );		return( -1 );	}	if( buffer == internal_handle->chunk_cache->compressed )	{		LIBEWF_WARNING_PRINT( "libewf_read_chunk: invalid buffer - same as chunk cache compressed.\n" );		return( -1 );	}	/* Check if the chunk is available	 */	if( chunk >= internal_handle->offset_table->amount )	{		return( 0 );	}	/* Check if the chunk is cached	 */	if( ( internal_handle->chunk_cache->chunk != chunk ) || ( internal_handle->chunk_cache->cached == 0 ) )	{		file_descriptor = internal_handle->offset_table->file_descriptor[ chunk ];		segment_number  = internal_handle->offset_table->segment_number[ chunk ];		/* Check if chunk cache passthrough is used		 * if the chunk cache is used as the chunk data buffer		 */		chunk_cache_used = (int8_t) ( buffer == internal_handle->chunk_cache->data );		/* Determine the size of the chunk including the CRC		 */		chunk_data_size = internal_handle->offset_table->size[ chunk ];		/* Make sure the chunk cache is large enough		 */		if( chunk_data_size > internal_handle->chunk_cache->allocated_size )		{			LIBEWF_VERBOSE_PRINT( "libewf_read_chunk: reallocating chunk data size: %zu.\n", chunk_data_size );			if( libewf_internal_handle_chunk_cache_realloc( internal_handle, chunk_data_size ) == NULL )			{				LIBEWF_WARNING_PRINT( "libewf_read_chunk: unable to reallocate chunk cache.\n");				return( -1 );			}			/* Adjust chunk data buffer if necessary			 */			if( ( chunk_cache_used == 1 ) && ( buffer != internal_handle->chunk_cache->data ) )			{				buffer = internal_handle->chunk_cache->data;			}		}		chunk_data = internal_handle->chunk_cache->data;#ifdef HAVE_BUFFER_PASSTHROUGH		/* Determine if the chunk data should be put directly in the buffer		 */		if( ( buffer != internal_handle->chunk_cache->data ) && ( chunk_offset == 0 ) && ( size >= (uint64_t) internal_handle->media->chunk_size ) )		{			chunk_data = (EWF_CHUNK *) buffer;		}#endif		/* Determine if the chunk data should be directly read into chunk data buffer		 * or to use the intermediate storage for a compressed chunk		 */		if( internal_handle->offset_table->compressed[ chunk ] == 1 )		{			chunk_read = internal_handle->chunk_cache->compressed;		}		else		{			chunk_read = chunk_data;		}		/* If buffer passthrough is used the CRC is read seperately		 */		if( ( chunk_read != internal_handle->chunk_cache->compressed ) && ( chunk_read != internal_handle->chunk_cache->data ) )		{			chunk_data_size -= EWF_CRC_SIZE;		}		/* Make sure the file offset is in the right place		 */		if( libewf_seek_chunk( internal_handle, chunk ) <= -1 )		{			LIBEWF_WARNING_PRINT( "libewf_read_chunk: unable to seek chunk.\n");			return( -1 );		}		/* Read the chunk data		 */		chunk_read_count = ewf_chunk_read( chunk_read, file_descriptor, chunk_data_size );		if( chunk_read_count <= -1 )		{			LIBEWF_WARNING_PRINT( "libewf_read_chunk: unable to read chunk.\n");			return( -1 );		}		internal_handle->segment_table->file_offset[ segment_number ] += (off_t) chunk_read_count;		if( ( internal_handle->offset_table->last > 0 ) && ( chunk > 0 ) )		{			percentage = (uint8_t) ( (uint32_t) ( chunk * 100 ) / internal_handle->offset_table->last );		}		/* Determine if the chunk is not compressed		 */		if( internal_handle->offset_table->compressed[ chunk ] == 0 )		{			LIBEWF_VERBOSE_PRINT( "libewf_read_chunk: chunk %" PRIu32 " of %" PRIu32 " (%" PRIu8 "%%) is UNCOMPRESSED.\n", ( chunk + 1 ), internal_handle->offset_table->amount, percentage );			/* If buffer passthrough is used the CRC needs to be read seperately			 */			if( ( chunk_read != internal_handle->chunk_cache->compressed ) && ( chunk_read != internal_handle->chunk_cache->data ) )			{				crc_read_count = ewf_crc_read( &stored_crc, file_descriptor );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
911国产精品| 亚洲一区二区三区四区在线观看| 国产日韩av一区| 亚洲精品日韩一| 国产一区欧美一区| 欧美日韩另类国产亚洲欧美一级| 欧美国产综合色视频| 奇米在线7777在线精品| 色婷婷精品大在线视频| 国产欧美一区二区在线| 日韩不卡手机在线v区| 91免费看片在线观看| 久久综合久久综合久久综合| 亚洲国产cao| 91福利精品视频| 国产欧美日韩视频一区二区| 伦理电影国产精品| 欧美久久久久久久久中文字幕| 国产精品久久久久永久免费观看| 蜜桃视频在线观看一区二区| 一本一道久久a久久精品综合蜜臀| 久久精品这里都是精品| 免费高清在线一区| 911精品国产一区二区在线| 亚洲黄色小说网站| 欧美系列日韩一区| 国产精品丝袜黑色高跟| 大尺度一区二区| 国产清纯白嫩初高生在线观看91| 极品销魂美女一区二区三区| 欧美一区二区高清| 人人狠狠综合久久亚洲| 在线成人免费观看| 天天色综合天天| 欧美一区二区三区在线电影| 日韩成人免费电影| 欧美一区二区美女| 经典三级在线一区| 欧美videossexotv100| 美女脱光内衣内裤视频久久影院| 欧美一区二区三区影视| 蜜臀a∨国产成人精品| 精品久久久久99| 国产精品主播直播| 国产精品久久久久久久久果冻传媒| 国产sm精品调教视频网站| 国产精品色婷婷久久58| 91日韩在线专区| 亚洲电影在线播放| 日韩三级高清在线| 国产精品99久久久久久久女警 | 亚洲男女一区二区三区| 色综合久久99| 日韩国产精品大片| 国产午夜精品久久久久久免费视 | av电影一区二区| 亚洲女同一区二区| 91精品国产综合久久香蕉的特点| 另类中文字幕网| 中文字幕欧美激情| 欧美伊人久久久久久久久影院| 天堂成人免费av电影一区| 精品国产免费久久| 99国产欧美另类久久久精品| 婷婷开心激情综合| 日本一区免费视频| 欧美午夜寂寞影院| 国产一区二区三区在线观看精品| 最新国产成人在线观看| 欧美日韩成人激情| 国产麻豆精品在线| 亚洲一级二级三级| 国产午夜亚洲精品午夜鲁丝片| 在线一区二区三区四区| 韩日av一区二区| 亚洲一区影音先锋| 国产亚洲精品中文字幕| 欧美日韩卡一卡二| 波多野洁衣一区| 激情综合网激情| 亚洲一区二区不卡免费| 国产欧美一区二区精品性色| 欧美日韩一区二区三区在线| 高清成人在线观看| 日韩国产高清在线| 一区二区三区影院| 国产欧美一区二区精品久导航| 欧美伦理影视网| 日本精品免费观看高清观看| 国产精品一区二区三区四区| 三级不卡在线观看| 一区二区三区免费网站| 国产精品天美传媒| 亚洲精品在线免费播放| 欧美日本在线播放| 欧美在线不卡视频| 99综合影院在线| 国产999精品久久| 极品少妇一区二区三区精品视频| 亚洲伊人伊色伊影伊综合网| 国产精品成人一区二区艾草| 久久精品免费在线观看| 精品久久一二三区| 日韩欧美一区电影| 欧美区一区二区三区| 色婷婷久久99综合精品jk白丝| 粉嫩蜜臀av国产精品网站| 精品中文字幕一区二区| 日韩高清不卡一区二区| 亚洲地区一二三色| 亚洲一卡二卡三卡四卡五卡| 一区二区三区欧美日| 亚洲男人的天堂网| 亚洲精品欧美专区| 亚洲一区二区三区四区不卡| 一区二区三区自拍| 亚洲电影第三页| 舔着乳尖日韩一区| 天堂成人免费av电影一区| 婷婷成人综合网| 蜜桃在线一区二区三区| 久久er精品视频| 国产精品主播直播| 成人的网站免费观看| bt欧美亚洲午夜电影天堂| 99精品国产热久久91蜜凸| 91视视频在线直接观看在线看网页在线看| 成人av资源站| 91豆麻精品91久久久久久| 欧美日韩中文字幕一区二区| 欧美日韩精品专区| 欧美刺激午夜性久久久久久久| 精品国产乱码久久久久久牛牛 | 4438x成人网最大色成网站| 在线播放视频一区| 精品精品欲导航| 国产欧美一区二区三区沐欲| 综合久久久久久久| 久色婷婷小香蕉久久| 久久精品99久久久| 高清免费成人av| 欧美午夜精品一区二区三区| 制服丝袜一区二区三区| 久久久亚洲精华液精华液精华液| 国产欧美精品一区二区色综合 | 欧美美女激情18p| 精品国产精品网麻豆系列| 久久久久综合网| 亚洲精品成人少妇| 久久精品国产网站| av在线播放成人| 制服丝袜日韩国产| 欧美激情一区不卡| 午夜国产不卡在线观看视频| 国产乱色国产精品免费视频| 99久久99精品久久久久久| 欧美日韩成人一区二区| 久久久久久久综合狠狠综合| 一区av在线播放| 国产精品一级在线| 欧美日韩色综合| 国产精品丝袜久久久久久app| 亚洲午夜精品17c| 成人国产精品免费网站| 91精品午夜视频| 亚洲三级视频在线观看| 黄页视频在线91| 欧美视频一区二区| 国产精品毛片久久久久久久| 秋霞电影一区二区| 99国产精品99久久久久久| 日韩欧美国产三级| 亚洲国产一区二区三区青草影视| 黑人精品欧美一区二区蜜桃| 欧美色窝79yyyycom| 国产欧美精品一区二区色综合 | 欧美性xxxxx极品少妇| 久久亚洲综合色| 男人的j进女人的j一区| 91麻豆蜜桃一区二区三区| 久久精品视频免费| 精品一区二区国语对白| 在线亚洲高清视频| 亚洲日本青草视频在线怡红院| 国产成人午夜精品5599| 日韩视频在线永久播放| 亚洲高清在线视频| 在线免费观看视频一区| 中文字幕日本不卡| 成人性生交大合| 久久久久国产精品麻豆| 精品一区二区三区欧美| 91精品国产色综合久久ai换脸 | 日韩精品91亚洲二区在线观看| 91福利在线播放| 一区二区三区国产精华| 日本韩国欧美一区二区三区| 亚洲狼人国产精品| 色婷婷狠狠综合| 亚洲国产欧美日韩另类综合|