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

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

?? libewf_write.c

?? sleuthit-2.09 一個磁盤的工具集
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* * libewf file writing * * 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 <errno.h>#ifdef HAVE_STRING_H#include <string.h>#endif#include <libewf/libewf_definitions.h>#include "libewf_char.h"#include "libewf_chunk_cache.h"#include "libewf_common.h"#include "libewf_endian.h"#include "libewf_file.h"#include "libewf_notify.h"#include "libewf_offset_table.h"#include "libewf_read.h"#include "libewf_section.h"#include "libewf_section_list.h"#include "libewf_segment_table.h"#include "libewf_string.h"#include "libewf_write.h"#include "ewf_char.h"#include "ewf_compress.h"#include "ewf_crc.h"#include "ewf_data.h"#include "ewf_definitions.h"#include "ewf_file_header.h"/* Calculates an estimate of the amount of chunks that fit within a segment file * Returns the size or 0 on error */uint32_t libewf_write_calculate_chunks_per_segment( LIBEWF_INTERNAL_HANDLE *internal_handle, uint16_t segment_number ){	int32_t available_segment_file_size = 0;	int32_t maximum_chunks_per_segment  = 0;	int32_t chunks_per_segment          = 0;	int32_t remaining_amount_of_chunks  = 0;	int32_t required_chunk_sections     = 1;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_segment: invalid handle.\n" );		return( 0 );	}	if( internal_handle->media == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_segment: invalid handle - missing subhandle media.\n" );		return( 0 );	}	if( internal_handle->write == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_segment: invalid handle - missing subhandle write.\n" );		return( 0 );	}	if( internal_handle->write->segment_file_size > (uint32_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_segment: invalid segment file size only values below 2^32 are supported.\n" );		return( 0 );	}	if( internal_handle->segment_table->file_offset[ segment_number ] > (off_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_segment: invalid segment file offset only values below 2^32 are supported.\n" );		return( 0 );	}	/* If the amount of chunks already have been determined	 */	if( internal_handle->segment_table->amount_of_chunks[ segment_number ] > 0 )	{		return( internal_handle->segment_table->amount_of_chunks[ segment_number ] );	}	/* Calculate the available segment file size	 */	available_segment_file_size = (int32_t) internal_handle->write->segment_file_size - (int32_t) internal_handle->segment_table->file_offset[ segment_number ];	/* Leave space for the done or next section	 */	available_segment_file_size -= EWF_SECTION_SIZE;	/* Calculate the maximum amount of chunks within this segment file	 */	if( internal_handle->ewf_format == EWF_FORMAT_S01 )	{		/* The EWF-S01 format uses compression this will add 16 bytes on average		 */		maximum_chunks_per_segment = available_segment_file_size / ( internal_handle->media->chunk_size + 16 );	}	else	{		maximum_chunks_per_segment = available_segment_file_size / ( internal_handle->media->chunk_size + EWF_CRC_SIZE );	}	/* Determine the amount of required chunk sections	 */	if( internal_handle->write->unrestrict_offset_amount == 0 )	{		required_chunk_sections = maximum_chunks_per_segment % EWF_MAXIMUM_OFFSETS_IN_TABLE;	}	if( internal_handle->ewf_format == EWF_FORMAT_S01 )	{		/* Leave space for the chunk section starts		 */		available_segment_file_size -= ( required_chunk_sections * EWF_SECTION_SIZE );		/* Leave space for the table offsets		 */		available_segment_file_size -= ( maximum_chunks_per_segment * EWF_TABLE_OFFSET_SIZE );	}	else if( internal_handle->format == LIBEWF_FORMAT_ENCASE1 )	{		/* Leave space for the chunk section starts and the offset table CRC		 */		available_segment_file_size -= ( required_chunk_sections * ( EWF_SECTION_SIZE + EWF_CRC_SIZE ) );		/* Leave space for the table offsets		 */		available_segment_file_size -= ( maximum_chunks_per_segment * EWF_TABLE_OFFSET_SIZE );	}	else	{		/* Leave space for the chunk, table and table2 section starts and the offset table CRC		 */		available_segment_file_size -= ( required_chunk_sections * ( ( 3 * EWF_SECTION_SIZE ) + EWF_CRC_SIZE ) );		/* Leave space for the table and table2 offsets		 */		available_segment_file_size -= 2 * ( maximum_chunks_per_segment * EWF_TABLE_OFFSET_SIZE );	}	/* Calculate the amount of chunks within this segment file	 */	if( internal_handle->ewf_format == EWF_FORMAT_S01 )	{		/* The EWF-S01 format uses compression this will add 16 bytes on average		 */		chunks_per_segment = available_segment_file_size / ( internal_handle->media->chunk_size + 16 );	}	else	{		chunks_per_segment = available_segment_file_size / ( internal_handle->media->chunk_size + EWF_CRC_SIZE );	}	/* If the input size is known	 */	if( internal_handle->write->input_write_size > 0 )	{		/* Calculate the amount of chunks that will remain		 */		remaining_amount_of_chunks = (int32_t) internal_handle->media->amount_of_chunks - (int32_t) internal_handle->write->amount_of_chunks;		/* Check if the less chunks remain than the amount of chunks calculated		 */		if( remaining_amount_of_chunks < chunks_per_segment )		{			chunks_per_segment = remaining_amount_of_chunks;		}	}	/* Make sure to return the total amount of chunks per segment	 */	if( internal_handle->write->segment_amount_of_chunks > 0 )	{		chunks_per_segment += internal_handle->write->segment_amount_of_chunks;	}	return( (uint32_t) chunks_per_segment );}/* Calculates the amount of chunks that fit within a chunks section * Returns the size or 0 on error */uint32_t libewf_write_calculate_chunks_per_chunks_section( LIBEWF_INTERNAL_HANDLE *internal_handle ){	int32_t remaining_amount_of_chunks = 0;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: invalid handle.\n" );		return( 0 );	}	if( internal_handle->media == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: invalid handle - missing subhandle media.\n" );		return( 0 );	}	if( internal_handle->write == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: invalid handle - missing subhandle write.\n" );		return( 0 );	}	if( internal_handle->write->chunks_per_segment > (uint32_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: invalid chunks per segment only values below 2^32 are supported.\n" );		return( 0 );	}	if( internal_handle->write->segment_file_size > (uint32_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: invalid segment file size only values below 2^32 are supported.\n" );		return( 0 );	}	if( internal_handle->write->chunks_section_number == 0 )	{		LIBEWF_WARNING_PRINT( "libewf_write_calculate_chunks_per_chunks_section: unsupported section number: %" PRIu8 ".\n", internal_handle->write->chunks_section_number );		return( 0 );	}	remaining_amount_of_chunks = (int32_t) internal_handle->write->chunks_per_segment;	if( internal_handle->write->chunks_section_number > 1 )	{		remaining_amount_of_chunks -= ( ( internal_handle->write->chunks_section_number - 1 ) * EWF_MAXIMUM_OFFSETS_IN_TABLE );	}	if( remaining_amount_of_chunks <= 0 )	{		return( 0 );	}	else if( ( remaining_amount_of_chunks > EWF_MAXIMUM_OFFSETS_IN_TABLE ) && ( internal_handle->write->unrestrict_offset_amount == 0 ) )	{		return( EWF_MAXIMUM_OFFSETS_IN_TABLE );	}	return( (uint32_t) remaining_amount_of_chunks );}/* Tests if the current segment file is full * Returns 1 if full, 0 if not, -1 on error */int8_t libewf_write_test_segment_file_full( LIBEWF_INTERNAL_HANDLE *internal_handle, off_t segment_file_offset ){	int32_t remaining_segment_file_size = 0;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_segment_file_full: invalid handle.\n" );		return( -1 );	}	if( internal_handle->media == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_segment_file_full: invalid handle - missing subhandle media.\n" );		return( -1 );	}	if( internal_handle->write == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_segment_file_full: invalid handle - missing subhandle write.\n" );		return( -1 );	}	if( segment_file_offset > (off_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_segment_file_full: invalid segment file offset only values below 2^32 are supported.\n" );		return( -1 );	}	if( internal_handle->write->segment_file_size > (uint32_t) INT32_MAX )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_segment_file_full: invalid segment file size only values below 2^32 are supported.\n" );		return( -1 );	}	/* Check if a chunks segment file has been opened	 */	if( segment_file_offset == 0 )	{		LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: no segment file has been created.\n" );		return( 0 );	}	/* Check if the maximum amount of chunks has been reached	 */	if( ( internal_handle->media->amount_of_chunks != 0 ) && ( internal_handle->media->amount_of_chunks == internal_handle->write->amount_of_chunks ) )	{		LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: all required chunks have been written.\n" );		return( 1 );	}	/* Check if the end of the input has been reached	*/	if( ( internal_handle->write->input_write_size != 0 ) && ( internal_handle->write->input_write_count >= (int64_t) internal_handle->write->input_write_size ) )	{		LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: all required data has been written.\n" );		return( 1 );	}	/* The EWF-S01 and EnCase1 format should use the pre calculated size	 */	if( ( internal_handle->ewf_format == EWF_FORMAT_S01 ) || ( internal_handle->format == LIBEWF_FORMAT_ENCASE1 ) )	{		if( internal_handle->write->segment_amount_of_chunks >= internal_handle->write->chunks_per_segment )		{			LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: no space left for additional chunk.\n" );			return( 1 );		}	}	else	{		/* Calculate the remaining segment file size		 */		remaining_segment_file_size = (int32_t) internal_handle->write->segment_file_size - (int32_t) segment_file_offset;		/* Leave space for the done or next section		 */		remaining_segment_file_size -= EWF_SECTION_SIZE;		/* Leave space for the table and table2 sections		 */		remaining_segment_file_size -= 2 * ( EWF_SECTION_SIZE + ( internal_handle->write->section_amount_of_chunks * EWF_TABLE_OFFSET_SIZE ) + EWF_CRC_SIZE );		/* Determine if a chunk would fit in the segment file		 */		remaining_segment_file_size -= internal_handle->media->chunk_size + EWF_CRC_SIZE;		if( remaining_segment_file_size <= 0 )		{			LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: no space left for additional chunk.\n" );			return( 1 );		}	}	LIBEWF_VERBOSE_PRINT( "libewf_write_test_segment_file_full: space left for additional chunk.\n" );	return( 0 );}/* Tests if the current chunks section is full * Returns 1 if full, 0 if not, -1 on error */int8_t libewf_write_test_chunks_section_full( LIBEWF_INTERNAL_HANDLE *internal_handle, off_t segment_file_offset ){	int32_t remaining_segment_file_size = 0;	if( internal_handle == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_chunks_section_full: invalid handle.\n" );		return( -1 );	}	if( internal_handle->media == NULL )	{		LIBEWF_WARNING_PRINT( "libewf_write_test_chunks_section_full: invalid handle - missing subhandle media.\n" );		return( -1 );	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av午夜电影| 国产精品不卡在线| 日本韩国欧美在线| 国产寡妇亲子伦一区二区| 日本网站在线观看一区二区三区| 国产精品国产三级国产aⅴ入口 | 欧美成人a视频| 欧美手机在线视频| 在线观看国产一区二区| 色综合久久久久综合体桃花网| 国产成人无遮挡在线视频| 韩日av一区二区| 国模少妇一区二区三区| 蜜臀av亚洲一区中文字幕| 天天综合网 天天综合色| 日av在线不卡| 极品少妇xxxx偷拍精品少妇| 韩国欧美国产1区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美激情一区二区三区在线| 久久综合久久综合九色| 精品国产第一区二区三区观看体验| 制服丝袜av成人在线看| 日韩免费视频线观看| 欧美精品一区二区三区蜜臀| 日韩欧美国产wwwww| 久久一区二区三区国产精品| 国产婷婷色一区二区三区在线| 欧美国产综合色视频| 亚洲视频免费看| 午夜精品福利视频网站| 精品综合免费视频观看| 欧美私人免费视频| 欧美日韩一区二区三区高清| 制服.丝袜.亚洲.另类.中文| 久久日韩精品一区二区五区| 亚洲国产高清aⅴ视频| 一区二区三区精品| 蜜桃久久av一区| 91丨porny丨国产入口| 欧美顶级少妇做爰| 精品国免费一区二区三区| 国产欧美一区二区精品婷婷| 一区二区视频在线| 日本不卡的三区四区五区| 国产精品91xxx| 色综合视频在线观看| 日韩午夜在线观看| 中文字幕亚洲一区二区av在线 | 男女性色大片免费观看一区二区| 国模套图日韩精品一区二区| 99re视频这里只有精品| 制服丝袜亚洲精品中文字幕| 亚洲国产成人一区二区三区| 亚洲国产精品久久艾草纯爱 | 欧美zozozo| 亚洲美女屁股眼交| 国精产品一区一区三区mba视频| 99精品1区2区| 国产日韩欧美综合一区| 日产国产高清一区二区三区| 成人丝袜高跟foot| 欧美大片在线观看| 性做久久久久久免费观看欧美| 国产91在线观看| 欧美一区二区三区免费在线看| 国产精品国产成人国产三级 | 亚洲一区欧美一区| 成人免费视频视频| 欧美精品一区二区精品网| 亚洲一区在线看| av日韩在线网站| 久久久久久久久久看片| 日韩二区三区四区| 欧美性xxxxxx少妇| 国产精品福利影院| 国产不卡视频一区| 精品国产sm最大网站免费看| 亚洲第一激情av| 欧美三级日韩三级国产三级| 亚洲欧美在线aaa| eeuss鲁片一区二区三区在线看| 久久综合色婷婷| 久久99最新地址| 7777精品伊人久久久大香线蕉经典版下载 | 国产一区二区三区精品欧美日韩一区二区三区| 一本一道波多野结衣一区二区| 亚洲国产成人在线| 成人国产免费视频| 国产精品久久久久久久久动漫 | 日韩一级高清毛片| 天天操天天干天天综合网| 欧美日韩二区三区| 五月天一区二区| 欧美精品一二三区| 久久99国产精品免费网站| 欧美一区二区精品在线| 青青青爽久久午夜综合久久午夜 | 老色鬼精品视频在线观看播放| 欧美一级免费大片| 国产九九视频一区二区三区| 国产亚洲综合在线| 不卡的av在线播放| 一区二区三区成人在线视频| 在线免费亚洲电影| 视频一区二区三区入口| 日韩精品专区在线影院观看| 久久精品国产精品青草| 久久久久久毛片| 91麻豆swag| 午夜不卡在线视频| 精品日韩av一区二区| 国产成人午夜精品5599| 中文字幕一区二区三区在线不卡| 欧洲精品在线观看| 三级一区在线视频先锋| 精品免费一区二区三区| 成人高清免费观看| 亚洲成人免费视频| 久久久久久综合| 91天堂素人约啪| 免费在线一区观看| 国产精品亲子乱子伦xxxx裸| 欧美三级韩国三级日本一级| 六月丁香婷婷色狠狠久久| 国产精品欧美一区二区三区| 欧美视频中文字幕| 国产盗摄视频一区二区三区| 亚洲精品伦理在线| 2017欧美狠狠色| 91视视频在线观看入口直接观看www | 成人成人成人在线视频| 午夜精品福利一区二区三区av | 日韩一区二区三区视频| 丰满亚洲少妇av| 午夜精品久久久久久久99水蜜桃| 日本一区二区三区国色天香| 欧美日韩在线电影| 成人精品国产福利| 麻豆精品久久久| 一区二区日韩电影| 欧美经典一区二区三区| 8x8x8国产精品| 91国偷自产一区二区开放时间 | 成人高清视频免费观看| 麻豆精品视频在线观看免费| 亚洲人成精品久久久久| 国产调教视频一区| 日韩一区二区视频在线观看| 91国内精品野花午夜精品| 国产在线不卡一卡二卡三卡四卡| 亚洲成a人v欧美综合天堂| 国产精品美女久久福利网站| 欧美一区二区三区播放老司机| 91丨九色丨蝌蚪富婆spa| 国产精品一区二区久激情瑜伽 | 午夜伊人狠狠久久| 亚洲美女在线一区| 亚洲视频免费看| 国产精品福利一区| 国产精品视频麻豆| 日本一区二区视频在线| 久久久精品综合| 精品999久久久| 欧美草草影院在线视频| 欧美大白屁股肥臀xxxxxx| 欧美一区三区四区| 欧美一级欧美三级在线观看| 欧美一区二区视频观看视频| 欧美精品免费视频| 91精品欧美福利在线观看| 欧美日本一区二区| 欧美精品v国产精品v日韩精品 | 日韩一区二区不卡| 制服丝袜av成人在线看| 欧美一区二区三区在线| 日韩一级免费一区| 精品国产一区二区三区四区四 | 偷拍亚洲欧洲综合| 午夜日韩在线观看| 青青草视频一区| 国模少妇一区二区三区| 成人性生交大合| av不卡一区二区三区| 色综合久久天天| 欧美精品18+| 日韩欧美电影一二三| 久久久久久久久伊人| 国产精品青草久久| 亚洲va国产天堂va久久en| 免费观看在线色综合| 国产精品原创巨作av| 成人午夜激情视频| 欧美视频一区二区在线观看| 日韩一卡二卡三卡国产欧美| 久久精品视频一区二区三区| 国产精品美日韩| 午夜成人免费电影| 福利视频网站一区二区三区| 欧美三级中文字|