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

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

?? iin_iml.cpp

?? PS2游戲硬盤直灌(HDL)的Windows下VC的源代碼
?? CPP
字號:
/* * iin_iml.c * $Id: iin_iml.c,v 1.6 2004/12/04 10:20:52 b081 Exp $ * * Copyright 2004 Bobi B., w1zard0f07@yahoo.com * * This file is part of hdl_dump. * * hdl_dump is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * hdl_dump is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with hdl_dump; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include <stdio.h>#include <ctype.h>#include <string.h>#include <stdlib.h>#include "iin_iml.h"#include "iin_img_base.h"#include "osal.h"#include "retcodes.h"#include "common.h"#define GROW_ALLOC 256typedef struct iml_file_type{  u_int64_t offset; /* relative to the begining of the file */  u_int32_t start_s, end_s;  char *path;} iml_file_t;typedef struct iml_files_type{  u_int32_t used, alloc;  iml_file_t *files;} iml_files_t;typedef struct iin_iml_type{  iin_t iin;  FILE *zero;} iin_iml_t;/**************************************************************/static iml_files_t*list_alloc (void){  iml_files_t *list = (iml_files_t*) osal_alloc (sizeof (iml_files_t));  if (list != NULL)    {      memset (list, 0, sizeof (iml_files_t));    }  return (list);}/**************************************************************/static voidlist_free (iml_files_t *list){  u_int32_t i;  for (i=0; i<list->used; ++i)    osal_free (list->files [i].path);  osal_free (list->files);  osal_free (list);}/**************************************************************/static intlist_grow (iml_files_t *list){  iml_file_t *tmp =    (iml_file_t*) osal_alloc ((list->alloc + GROW_ALLOC) * sizeof (iml_file_t));  if (tmp != NULL)    {      if (list->files != NULL)	{ /* transfer old data and free old buffer */	  memcpy (tmp, list->files, list->used * sizeof (iml_file_t));	  osal_free (list->files);	}      list->files = tmp;      list->alloc += GROW_ALLOC;      return (OSAL_OK);    }  else    return (RET_NO_MEM);}/**************************************************************/static intlist_add_file (iml_files_t *list,	       const char *path,	       u_int32_t start_s,	       u_int32_t end_s,	       u_int64_t offset){  int result = OSAL_OK;  if (list->used == list->alloc)    result = list_grow (list);  if (result == OSAL_OK)    {      u_int32_t len = strlen (path);      iml_file_t *dest;      dest = list->files + list->used;      dest->offset = offset;      dest->start_s = start_s;      dest->end_s = end_s;      dest->path = (char *)osal_alloc (len + 1);      if (dest->path != NULL)	{	  strcpy (dest->path, path);	  dest->offset = offset;	  ++list->used;	}      else	result = RET_NO_MEM;    }  return (result);}/**************************************************************/#define is_space_or_tab(ch) ((ch) == ' ' || (ch) == '\t')static intprocess_loc_line (iml_files_t *list,		  char *line){ /* 322 322 0.0 0 "SYSTEM.CNF" */  int result = OSAL_OK;  u_int64_t offset;  u_int32_t start_s, end_s;  char *path, *endp;  start_s = strtoul (line, &endp, 10); /* start */  result = is_space_or_tab (*endp) ? OSAL_OK : RET_BAD_COMPAT;  if (result == OSAL_OK)    {      while (is_space_or_tab (*endp)) ++endp;      end_s = strtoul (endp, &endp, 10); /* end */      result = is_space_or_tab (*endp) ? OSAL_OK : RET_BAD_COMPAT;    }  if (result == OSAL_OK)    { /* dummies */      while (is_space_or_tab (*endp)) ++endp;      strtod (endp, &endp);      result = is_space_or_tab (*endp) ? OSAL_OK : RET_BAD_COMPAT;      if (result == OSAL_OK)	{	  while (is_space_or_tab (*endp)) ++endp;	  strtol (endp, &endp, 10);	  result = is_space_or_tab (*endp) ? OSAL_OK : RET_BAD_COMPAT;	}    }  if (result == OSAL_OK)    { /* path */      while (is_space_or_tab (*endp)) ++endp;      path = endp;      if (*endp == '\"')	{ /* "FILE NAME" */	  ++path; ++endp; /* skip initial " */	  while (*endp != '\"' && *endp != '\0') ++endp;	  if (*endp == '\"')	    *endp++ = '\0'; /* remove trailing " */	  else	    result = RET_NOT_COMPAT;	}      else	/* FILE_NAME */	while (!is_space_or_tab (*endp) && *endp != '\0') ++endp;      if (result == OSAL_OK)	{	  if (*endp != '\0')	    { /* offset? */	      *endp++ = '\0';	      while (is_space_or_tab (*endp)) ++endp;	      offset = strtoul (endp, NULL, 10); /* could cause overflows, but it is not likely */	    }	  else	    offset = 0;	}    }  if (result == OSAL_OK)    result = list_add_file (list, path, start_s, end_s, offset);  return (result);}/**************************************************************/enum section_type_t  {    st_unk,    st_sys,    st_cue,    st_loc  };static intbuild_file_list (const char *iml_path,		 iml_files_t **list2){  u_int64_t file_size;  int result;  iml_files_t *list = list_alloc ();  result = list != NULL ? OSAL_OK : RET_NO_MEM;  if (result == OSAL_OK)    result = osal_get_file_size_ex (iml_path, &file_size);  if (result == OSAL_OK)    result = file_size <= 1 _MB ? OSAL_OK : RET_NOT_COMPAT;  if (result == OSAL_OK)    {      char *data;      u_int32_t length;      result = read_file (iml_path, &data, &length);      if (result == OSAL_OK)	{	  enum section_type_t sec = st_unk; /* current section */	  char *line = strtok (data, "\r\n");	  if (line != NULL && line != '\0')	    do	      {		if (caseless_compare (line, "[sys]"))		  sec = st_sys;		else if (caseless_compare (line, "[/sys]"))		  sec = st_unk;		else if (caseless_compare (line, "[cue]"))		  sec = st_cue;		else if (caseless_compare (line, "[/cue]"))		  sec = st_unk;		else if (caseless_compare (line, "[loc]"))		  sec = st_loc;		else if (caseless_compare (line, "[/loc]"))		  sec = st_unk;		else		  { /* a line in one of the sections */		    if (sec == st_loc &&			line [0] != '#' &&			isdigit (line [0]))		      { /* a file: "322 322 0.0 0 \"SYSTEM.CNF\"" */			result = process_loc_line (list, line);		      }		  }		line = strtok (NULL, "\r\n");	      }	    while (line != NULL && *line != '\0');	  osal_free (data);	}    }  if (result == OSAL_OK)    result = list->used > 0 ? OSAL_OK : RET_NOT_COMPAT;  if (result == OSAL_OK)    *list2 = list; /* success */  else if (list != NULL)    list_free (list);  return (result);}/**************************************************************/intiin_iml_probe_path (const char *path,		    iin_t **iin){  iml_files_t *list;  int result = build_file_list (path, &list);  if (result == OSAL_OK)    { /* gaps are automagically handled by iin_img_base_t */      u_int32_t i;      iml_file_t *prev = NULL;      iin_img_base_t *img_base = img_base_alloc (2048 /* RAW sect size */, 0 /* skip per sect */);      char source [MAX_PATH];      u_int32_t device_sector_size;      if (img_base != NULL)	{	  for (i=0; result == OSAL_OK && i<list->used; ++i)	    {	      iml_file_t *curr = list->files + i;	      u_int32_t gap_s = prev != NULL ? curr->start_s - (prev->end_s + 1) : 0;	      if (gap_s == 0)		;	      else		/* add a gap between previous and current file */		img_base_add_gap (img_base, gap_s);	      strcpy (source, curr->path);	      result = lookup_file (source, path);	      if (result == OSAL_OK)		result = osal_get_volume_sect_size (source, &device_sector_size);	      else if (result == RET_FILE_NOT_FOUND)		result = RET_BROKEN_LINK;	      if (result == OSAL_OK)		result = img_base_add_part (img_base, source, curr->end_s - curr->start_s + 1,					    curr->offset, device_sector_size);	      prev = curr;	    }	  if (result == OSAL_OK)	    {	      *iin = (iin_t*) img_base;	      strcpy ((*iin)->source_type, "IML file");	    }	  else	    ((iin_t*) img_base)->close ((iin_t*) img_base);	}      else	result = RET_NO_MEM;      list_free (list);    }  return (result);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜欧美在线一二页| 亚洲另类在线制服丝袜| 色八戒一区二区三区| 成人永久aaa| 国产.欧美.日韩| 国产成人亚洲综合a∨猫咪| 国产在线播放一区二区三区| 麻豆久久久久久| 国产资源在线一区| 国产在线不卡视频| www.欧美色图| 色婷婷综合五月| 欧美久久久久中文字幕| 欧美一二三四区在线| 日韩精品一区二区三区视频 | 91色视频在线| 色偷偷久久一区二区三区| 91网站视频在线观看| 欧美日韩在线综合| 欧美一区二区在线观看| 久久久午夜精品理论片中文字幕| 国产三级一区二区三区| 国产精品美女久久久久aⅴ国产馆| 中文字幕一区二区三区不卡| 亚洲愉拍自拍另类高清精品| 免费xxxx性欧美18vr| 韩国成人精品a∨在线观看| 国产·精品毛片| 欧美三级电影在线观看| 日韩欧美三级在线| 国产精品私房写真福利视频| 亚洲福利一二三区| 极品销魂美女一区二区三区| 91在线视频播放地址| 欧美久久久久久蜜桃| 国产欧美日本一区视频| 亚洲综合一二区| 国产超碰在线一区| 在线观看91精品国产入口| 精品国精品国产| 综合精品久久久| 久久av老司机精品网站导航| 色综合一区二区| 日韩精品一区二区三区蜜臀 | 一区二区三区成人| 久久国产成人午夜av影院| 国产美女一区二区三区| 欧美性色黄大片| 中文在线资源观看网站视频免费不卡| 一区二区在线观看av| 国内成人免费视频| 色天天综合色天天久久| 久久精品夜色噜噜亚洲aⅴ| 亚洲图片欧美综合| 不卡一区二区中文字幕| 7777精品伊人久久久大香线蕉 | 91视频一区二区| 精品精品国产高清a毛片牛牛| 一区二区三区在线观看国产| 国产成人日日夜夜| 精品国产自在久精品国产| 午夜av电影一区| 欧美视频一区二区三区| 亚洲欧美自拍偷拍色图| 国产白丝精品91爽爽久久| 欧美r级在线观看| 免费看欧美女人艹b| 欧美综合色免费| 亚洲裸体xxx| 不卡视频免费播放| 中文字幕va一区二区三区| 国产一区二区精品久久91| 精品国产亚洲在线| 激情久久五月天| 精品处破学生在线二十三| 久久精品久久99精品久久| 欧美伦理电影网| 日本成人超碰在线观看| 欧美一区二区三区人| 日日欢夜夜爽一区| 欧美一区二区三区不卡| 三级欧美韩日大片在线看| 欧美日韩视频专区在线播放| 亚洲大尺度视频在线观看| 欧美午夜精品久久久| 亚洲国产精品麻豆| 欧美女孩性生活视频| 日本亚洲一区二区| 91精品国产乱| 国产一区二区免费在线| 中文字幕精品一区二区三区精品 | 国产精品女人毛片| 成人爱爱电影网址| 亚洲视频精选在线| 欧美在线免费播放| 日韩精品电影在线| 2020国产精品| 成人免费毛片嘿嘿连载视频| 成人免费一区二区三区在线观看| 一本到高清视频免费精品| 亚洲午夜激情网页| 精品国产免费久久 | 中文字幕制服丝袜成人av | 日韩精品久久理论片| 欧美一区二区福利视频| 狠狠色丁香婷综合久久| 国产精品污网站| 欧美体内she精视频| 黄色日韩网站视频| 樱花影视一区二区| 日韩精品一区二区三区蜜臀| 成人动漫一区二区| 日韩激情中文字幕| 国产精品污网站| 91精品国产综合久久婷婷香蕉| 国产一二三精品| 婷婷国产在线综合| 亚洲精品免费在线观看| 日韩一区二区三| 972aa.com艺术欧美| 狠狠色狠狠色合久久伊人| 亚洲欧洲日韩综合一区二区| 日韩欧美一二三| 色综合久久久久久久久久久| 国产综合一区二区| 亚洲高清在线精品| 国产精品久久久久久福利一牛影视| 欧美日韩中文字幕一区| 成人午夜精品一区二区三区| 免费一级欧美片在线观看| 亚洲精品乱码久久久久久久久| 精品裸体舞一区二区三区| 欧美视频一区二区三区四区| 不卡在线视频中文字幕| 国产一区二区精品久久91| 日韩经典中文字幕一区| 亚洲曰韩产成在线| 亚洲欧洲精品一区二区精品久久久| 精品少妇一区二区三区在线视频| 欧美性猛片xxxx免费看久爱| 99国产精品久久久久久久久久久 | 成人免费va视频| 国产美女av一区二区三区| 免费成人在线影院| 无吗不卡中文字幕| 亚洲国产成人精品视频| 亚洲精品乱码久久久久久久久| 中文字幕日韩一区二区| 亚洲国产精品v| 国产亚洲女人久久久久毛片| 欧美成人vps| 日韩欧美一区在线| 欧美一区二区三区在线观看| 欧美日韩高清一区二区| 欧美日韩成人一区二区| 精品视频123区在线观看| 欧美性高清videossexo| 欧美在线免费观看视频| 精品视频免费在线| 精品视频免费看| 日韩一区二区视频在线观看| 欧美精品自拍偷拍| 91精品婷婷国产综合久久性色| 欧美日本不卡视频| 日韩一区二区免费在线观看| 日韩一区二区免费在线观看| 亚洲精品一区二区精华| 2020国产精品自拍| 国产精品美日韩| 亚洲欧美日韩国产一区二区三区| 亚洲精品乱码久久久久| 亚洲午夜久久久久久久久久久 | 国产精品乱码一区二区三区软件| 日韩午夜中文字幕| 2020日本不卡一区二区视频| 亚洲国产激情av| 亚洲欧美成aⅴ人在线观看| 亚洲综合色噜噜狠狠| 亚洲福中文字幕伊人影院| 日韩综合小视频| 国产寡妇亲子伦一区二区| 99国产麻豆精品| 欧美日韩色一区| 久久综合狠狠综合久久综合88| 国产欧美一区二区三区鸳鸯浴 | 久国产精品韩国三级视频| 国产一区不卡精品| 一本久久a久久精品亚洲| 8x8x8国产精品| 中文字幕+乱码+中文字幕一区| 亚洲日本va午夜在线影院| 日韩不卡一二三区| 粉嫩一区二区三区性色av| 色综合久久中文综合久久牛| 日韩欧美一区中文| √…a在线天堂一区| 日本女优在线视频一区二区| 成人h动漫精品一区二| 日韩欧美综合在线| 亚洲图片另类小说|