亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
在线精品观看国产| 久久国产福利国产秒拍| 精品国产乱码久久久久久久| 91福利在线免费观看| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 精品国产精品一区二区夜夜嗨| 欧美日韩国产精品自在自线| 欧美色大人视频| 欧美三级中文字幕在线观看| 欧美日韩日日夜夜| 91精品欧美一区二区三区综合在| 欧美丝袜丝交足nylons| 欧美老女人在线| 日韩一区二区三区三四区视频在线观看 | 日韩国产欧美三级| 美女一区二区久久| 韩国女主播成人在线观看| 激情综合网最新| 国产不卡在线播放| 91亚洲精品久久久蜜桃| 精品视频免费看| 欧美一区二区三区性视频| 精品少妇一区二区三区视频免付费| 欧美成人精品高清在线播放| 国产三级三级三级精品8ⅰ区| 国产精品丝袜在线| 亚洲自拍偷拍麻豆| 精品一区二区三区的国产在线播放| 国产曰批免费观看久久久| 91亚洲精品乱码久久久久久蜜桃| 欧美视频中文一区二区三区在线观看| 欧美一区二区在线免费观看| 久久青草国产手机看片福利盒子 | 国产精品久久久久久久久图文区| 亚洲人成影院在线观看| 秋霞成人午夜伦在线观看| 国产寡妇亲子伦一区二区| 日本道精品一区二区三区| 日韩一区二区三区电影在线观看 | 91精品国产色综合久久不卡电影| 欧美成人精品福利| 亚洲卡通欧美制服中文| 蜜桃视频一区二区三区| 一本色道久久综合亚洲aⅴ蜜桃| 7777精品伊人久久久大香线蕉 | eeuss鲁片一区二区三区| 欧美一区二区网站| 国产精品高清亚洲| 毛片基地黄久久久久久天堂| www.亚洲在线| 久久婷婷成人综合色| 三级一区在线视频先锋| 成人免费的视频| 精品剧情在线观看| 午夜日韩在线观看| 91久久免费观看| 欧美国产一区在线| 黄色资源网久久资源365| 欧美日韩精品一区二区三区蜜桃 | 在线看一区二区| 日本一区二区电影| 精品在线观看免费| 欧美日韩国产大片| 一区二区三区在线不卡| 成人午夜视频在线| 国产日产亚洲精品系列| 久久精品久久精品| 日韩一卡二卡三卡四卡| 免费看日韩a级影片| 欧美精品xxxxbbbb| 五月天中文字幕一区二区| 色老综合老女人久久久| 日韩一区日韩二区| 波多野结衣欧美| 亚洲欧洲国产日韩| 91视视频在线直接观看在线看网页在线看 | 依依成人精品视频| 91视频在线观看免费| 最新成人av在线| 色妹子一区二区| 亚洲黄色片在线观看| 日本高清无吗v一区| 一区二区三区视频在线看| 91国产免费观看| 天堂成人免费av电影一区| 欧美精品久久99久久在免费线 | 亚洲精品视频在线看| 97se亚洲国产综合自在线观| 成人欧美一区二区三区1314| 99精品一区二区三区| 自拍偷拍亚洲综合| 欧美手机在线视频| 免费一级片91| 欧美国产日韩a欧美在线观看| 不卡在线观看av| 亚洲与欧洲av电影| 日韩视频一区二区三区在线播放| 久久av中文字幕片| 国产精品国产自产拍在线| 91福利精品第一导航| 日本不卡中文字幕| 国产精品欧美一级免费| 91搞黄在线观看| 国产一区中文字幕| 综合久久给合久久狠狠狠97色| 欧美网站一区二区| 久久精品国产在热久久| 国产精品青草综合久久久久99| av在线播放一区二区三区| 午夜影视日本亚洲欧洲精品| 精品国产91亚洲一区二区三区婷婷| 国产91丝袜在线播放| 亚洲一区二区三区四区的| 久久免费的精品国产v∧| 91久久精品午夜一区二区| 久久se这里有精品| 亚洲精品国产第一综合99久久| 69堂成人精品免费视频| 国产一区二区精品久久99| 樱花影视一区二区| 久久久国产精品不卡| 欧美日韩在线播放一区| 成人av电影在线网| 精品一区二区成人精品| 一区二区三区精品在线观看| 久久久久久毛片| 欧美一级在线观看| 欧美中文字幕一区二区三区 | 中文字幕精品在线不卡| 在线播放中文一区| 91视视频在线观看入口直接观看www | 国产91精品一区二区麻豆亚洲| 亚洲va国产va欧美va观看| 中文字幕在线一区| 久久精品亚洲精品国产欧美 | 国产日韩欧美电影| 日韩欧美一区二区不卡| 91亚洲大成网污www| 国产成人精品网址| 久久99精品久久久久婷婷| 午夜a成v人精品| 亚洲bt欧美bt精品777| 亚洲最色的网站| 亚洲视频一区二区在线| 国产精品婷婷午夜在线观看| 久久婷婷综合激情| 久久尤物电影视频在线观看| 日韩精品自拍偷拍| 日韩午夜电影在线观看| 91精品国产色综合久久不卡电影| 在线91免费看| 制服丝袜亚洲色图| 欧美一区二区三区在线视频| 91精品国产综合久久精品麻豆| 欧美喷水一区二区| 91精品麻豆日日躁夜夜躁| 欧美日韩国产bt| 欧美高清激情brazzers| 91精品国产美女浴室洗澡无遮挡| 欧美日韩国产中文| 日韩一区国产二区欧美三区| 欧美一区二区三区视频在线观看| 欧美一区二区三区的| 欧美一区午夜视频在线观看| 精品国产凹凸成av人网站| 久久精品亚洲乱码伦伦中文 | 亚洲欧美日韩一区| 亚洲麻豆国产自偷在线| 亚洲国产精品一区二区久久| 五月激情综合婷婷| 精品在线视频一区| 成人免费视频一区| 日本精品免费观看高清观看| 欧美性猛交xxxx黑人交| 日韩一区二区电影| 国产丝袜美腿一区二区三区| 中文字幕一区二区三区av| 一二三四社区欧美黄| 天堂一区二区在线| 国产成人h网站| 欧美性生交片4| 欧美精品一区二区久久婷婷| 国产精品乱人伦| 日韩va亚洲va欧美va久久| 国产福利不卡视频| 在线观看免费一区| www一区二区| 亚洲免费在线视频一区 二区| 欧美aⅴ一区二区三区视频| 成人午夜私人影院| 欧美日韩精品一区二区三区蜜桃| 久久久精品欧美丰满| 亚洲国产cao| 成人一级黄色片| 6080午夜不卡| 樱桃国产成人精品视频| 国产麻豆精品视频| 欧美日韩国产首页在线观看| 中文字幕高清一区| 日本欧美加勒比视频|