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

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

?? iin_cdrwin.cpp

?? PS2游戲硬盤直灌(HDL)的Windows下VC的源代碼
?? CPP
字號:
/* * iin_cdrwin.c * $Id: iin_cdrwin.c,v 1.9 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 <ctype.h>#include <stdlib.h>#include <string.h>#include "iin_cdrwin.h"#include "iin_img_base.h"#include "osal.h"#include "retcodes.h"#include "common.h"typedef enum data_mode_type  {    dm_mode1_plain = 0,    dm_mode1_raw = 1,    dm_mode2_plain = 2,    dm_mode2_raw = 3  } data_mode_t;/* values for CDRWIN found out by building test images and by looking at   http://www.disctronics.co.uk/technology/cd-rom/cdrom_spec.htm */static const u_int32_t RAW_SECTOR_SIZE [4] = { 2048, 2352, 2336, 2352 };static const u_int32_t RAW_SKIP_OFFSET [4] = {    0,   16,    8,   24 }; /**************************************************************/#define is_space_or_tab(ch) ((ch) == ' ' || (ch) == '\t')static int /* would also check whether file exists or not */cue_parse_file_line (const char *cuesheet_path,		     char *line,		     char source [MAX_PATH]){  /* FILE xxx BINARY or FILE "xx xx" BINARY accepted */  int result;  char *p = line;  while (is_space_or_tab (*p)) ++p;  line = p;  while (!is_space_or_tab (*p) && *p != '\0') ++p;  *p++ = '\0';  result = caseless_compare (line, "file") ? RET_OK : RET_NOT_COMPAT;  if (result == RET_OK)    {      char *dest = source, *dest_end = source + MAX_PATH - 1;      while (is_space_or_tab (*p)) ++p;      if (*p == '\"')	{ /* "FILE NAME" */	  ++p; /* skip initial " */	  while (*p != '\"' && *p != '\0' && dest < dest_end)	    *dest++ = *p++;	  if (*p++ != '\"')	    result = RET_NOT_COMPAT;	}      else	{ /* FILE_NAME */	  while (!is_space_or_tab (*p) && *p != '\0' && dest < dest_end)	    *dest++ = *p++;	}      *dest = '\0'; /* zero-terminate destination */      if (result == OSAL_OK)	{	  while (is_space_or_tab (*p)) ++p;	  result = caseless_compare (p, "binary") ? RET_OK : RET_NOT_COMPAT;	}    }  if (result == RET_OK)    { /* check whether file exists */      if (file_exists (source))	; /* ok */      else	{ /* check for the source in the same folder as the cue file */	  result = lookup_file (source, cuesheet_path);	  if (result == RET_OK)	    ; /* linked file found */	  else if (result == RET_FILE_NOT_FOUND)	    result = RET_BROKEN_LINK;	}    }  return (result);}/**************************************************************/static intcue_parse_track_line (char *line,		      data_mode_t *mode){  int result;  char *p = line;  while (is_space_or_tab (*p)) ++p;  line = p;  while (!is_space_or_tab (*p) && *p != '\0') ++p;  *p++ = '\0';  result = caseless_compare (line, "track") ? RET_OK : RET_NOT_COMPAT;  if (result == RET_OK)    { /* TRACK 01 MODE?/???? accepted */      char *track_no, *text_mode;      while (is_space_or_tab (*p)) ++p;      track_no = p;      while (!is_space_or_tab (*p) && *p != '\0') ++p;      *p++ = '\0';      while (is_space_or_tab (*p)) ++p;      text_mode = p;      result = atoi (track_no) == 1 ? RET_OK : RET_BAD_COMPAT;      if (result == RET_OK)	result = (tolower (text_mode [0]) == 'm' &&		  tolower (text_mode [1]) == 'o' &&		  tolower (text_mode [2]) == 'd' &&		  tolower (text_mode [3]) == 'e') ? RET_OK : RET_BAD_COMPAT;      if (result == RET_OK)	{	  int sector_size = atoi (text_mode + 6);	  if (text_mode [4] == '1')	    /* mode 1 */	    switch (sector_size)	      {	      case 2048: *mode = dm_mode1_plain; break;	      case 2352: *mode = dm_mode1_raw; break;	      default: result = RET_BAD_COMPAT;	      }	  else	    /* mode 2 */	    switch (sector_size)	      {	      case 2336: *mode = dm_mode2_plain; break;	      case 2352: *mode = dm_mode2_raw; break;	      default: result = RET_BAD_COMPAT;	      }	}    }  return (result);}/**************************************************************/static intcue_parse_index_line (char *line){  int result;  char *p = line;  while (is_space_or_tab (*p)) ++p;  line = p;  while (!is_space_or_tab (*p) && *p != '\0') ++p;  *p++ = '\0';  result = caseless_compare (line, "index") ? RET_OK : RET_NOT_COMPAT;  return (result);}/**************************************************************/static intcue_parse (const char *path,	   char source [MAX_PATH],	   data_mode_t *mode){  osal_handle_t in;  u_int64_t file_size = 0;  int result = osal_open (path, &in, 0);  if (result == OSAL_OK)    { /* get file size */      result = osal_get_file_size (in, &file_size);      osal_close (in);    }  if (result == OSAL_OK)    result = file_size < 1024 ? OSAL_OK : RET_NOT_COMPAT; /* a cuesheet up to 1KB is accepted */  if (result == OSAL_OK)    {      char *contents;      u_int32_t length;      result = read_file (path, &contents, &length);      if (result == OSAL_OK)	{	  char *line = strtok (contents, "\r\n");	  if (line != NULL && *line != '\0')	    /* extract data file path and check whether it exists or not */	    result = cue_parse_file_line (path, line, source);	  else	    result = RET_NOT_COMPAT;	  if (result == OSAL_OK)	    { /* get mode and bytes per sector */	      line = strtok (NULL, "\r\n");	      if (line != NULL && *line != '\0')		result = cue_parse_track_line (line, mode);	      else		result = RET_BAD_COMPAT;	    }	  if (result == OSAL_OK)	    { /* validate that 3rd line is an index line */	      line = strtok (NULL, "\r\n");	      if (line != NULL && *line != '\0')		result = cue_parse_index_line (line);	      else		result = RET_BAD_COMPAT;	    }	  if (result == OSAL_OK)	    { /* there should not be 4th line */	      line = strtok (NULL, "\r\n");	      result = line == NULL || *line == '\0' ? RET_OK : RET_BAD_COMPAT;	    }	  osal_free (contents);	}    }  return (result);}/**************************************************************/intiin_cdrwin_probe_path (const char *path,		       iin_t **iin){  char source [MAX_PATH];  data_mode_t mode;  int result = cue_parse (path, source, &mode);  if (result == RET_OK)    {      u_int64_t file_size;      u_int32_t device_sector_size;      result = osal_get_file_size_ex (source, &file_size);      if (result == OSAL_OK)	result = osal_get_volume_sect_size (source, &device_sector_size);      if (result == OSAL_OK)	{	  iin_img_base_t *img_base =	    img_base_alloc (RAW_SECTOR_SIZE [mode], RAW_SKIP_OFFSET [mode]);	  if (img_base != NULL)	    result = img_base_add_part (img_base, source,					(u_int32_t) (file_size / RAW_SECTOR_SIZE [mode]),					(u_int64_t) 0, device_sector_size);	  else	    /* img_base_alloc failed */	    result = RET_NO_MEM;	  if (result == OSAL_OK)	    { /* success */	      *iin = (iin_t*) img_base;	      switch (mode)		{		case dm_mode1_plain:		  strcpy ((*iin)->source_type, "ISO Image, Mode 1, plain"); break;		case dm_mode1_raw:		  strcpy ((*iin)->source_type, "BIN Image, Mode 1, RAW"); break;		case dm_mode2_plain:		  strcpy ((*iin)->source_type, "BIN Image, Mode 2, plain"); break;		case dm_mode2_raw:		  strcpy ((*iin)->source_type, "BIN Image, Mode 2, RAW"); break;		}	    }	  else if (img_base != NULL)	    ((iin_t*) img_base)->close ((iin_t*) img_base);	}    }  return (result);}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久精品国产免大香伊 | 久久免费美女视频| 日本网站在线观看一区二区三区 | 欧美日韩一级二级| 亚洲电影一级片| 欧美日韩在线播| 奇米一区二区三区av| 在线电影一区二区三区| 久久99国产精品尤物| 精品国产伦一区二区三区免费 | 日韩av中文字幕一区二区三区| 色欧美日韩亚洲| 亚洲国产精品天堂| 欧美美女一区二区在线观看| 精品一二三四区| 久久精品人人做人人爽97| 高清久久久久久| 亚洲人成网站在线| 91黄色免费版| 精品一区二区三区日韩| 久久久久久一二三区| 91一区一区三区| 亚洲一区二区三区视频在线播放 | 久久精品人人做人人爽97| 国产二区国产一区在线观看| 亚洲综合男人的天堂| 欧美精品丝袜久久久中文字幕| 一区二区三区在线播| 精品人伦一区二区色婷婷| 国产成人欧美日韩在线电影| 亚洲一二三专区| 日韩午夜在线播放| 一本一道波多野结衣一区二区| 亚洲电影在线播放| 国产精品欧美一区喷水| 欧美性极品少妇| 久久99国产乱子伦精品免费| 一区二区成人在线视频 | 精品久久久久久久久久久久包黑料 | 国产乱子伦一区二区三区国色天香| 国产日本欧洲亚洲| 成人小视频免费观看| 免费成人在线播放| 成人免费在线播放视频| 日韩美女主播在线视频一区二区三区| 国产曰批免费观看久久久| 日韩一区有码在线| 精品久久人人做人人爽| 色婷婷亚洲一区二区三区| 美女视频免费一区| 亚洲国产一区二区a毛片| 国产三级精品三级在线专区| 日韩三级在线观看| 99精品桃花视频在线观看| 国产成人综合在线观看| 亚洲国产欧美日韩另类综合| 成人欧美一区二区三区白人| 欧美不卡一区二区三区| 91精品国产91综合久久蜜臀| 丰满白嫩尤物一区二区| 精品亚洲欧美一区| 婷婷夜色潮精品综合在线| 亚洲精品一二三| 国产亚洲一区二区三区在线观看 | av男人天堂一区| 免费成人av在线| 一区二区三区在线免费视频| 精品国内二区三区| 精品免费视频一区二区| 欧美午夜在线一二页| 91久久精品一区二区| 国产99久久久国产精品潘金网站| 九色|91porny| 日韩精品乱码免费| 视频在线观看一区| 亚洲成人福利片| 亚洲国产美国国产综合一区二区| 国产精品久久久久久福利一牛影视| 日韩欧美国产三级| 亚洲精品在线三区| 欧美一区二区三区性视频| 日韩一级在线观看| 欧美精品第1页| 日韩视频国产视频| 欧美一区二区女人| 欧美刺激午夜性久久久久久久| 欧美日本视频在线| 91免费国产在线| 欧美中文字幕一区二区三区亚洲| 99久久精品国产麻豆演员表| 日本韩国欧美三级| 色屁屁一区二区| 欧美人牲a欧美精品| 欧美精品久久天天躁| 91精品国模一区二区三区| 欧美高清视频www夜色资源网| 日韩欧美中文字幕精品| 欧美一级片免费看| 精品奇米国产一区二区三区| 欧美不卡激情三级在线观看| 日韩精品中文字幕在线不卡尤物| 久久精品日韩一区二区三区| 国产欧美日韩综合精品一区二区| 亚洲人妖av一区二区| 亚洲精品国产一区二区精华液| 午夜精品久久久久久久久久| 日日骚欧美日韩| 国产精品18久久久久久久久久久久| 国产福利91精品一区二区三区| 91亚洲精品久久久蜜桃| 欧美中文一区二区三区| 在线观看日韩精品| 久久综合久久鬼色中文字| 久久九九影视网| 亚洲高清视频的网址| 日韩不卡在线观看日韩不卡视频| 国产成人精品免费看| 99久久婷婷国产综合精品| 欧美一区二区免费观在线| 精品国产123| 亚洲一区二区av在线| 精品一区精品二区高清| 一本一道综合狠狠老| 91精品国产丝袜白色高跟鞋| 国产精品久久久久影院| 午夜精品久久久久久久99水蜜桃 | 99视频一区二区| 日韩视频在线一区二区| 欧美国产乱子伦| 日本不卡视频一二三区| 国产精品自在在线| 欧美日韩精品高清| 久久久五月婷婷| 五月天精品一区二区三区| 国产麻豆精品95视频| 色婷婷综合久久久中文字幕| 日韩免费看网站| 国产女同互慰高潮91漫画| 免费欧美在线视频| 99这里只有精品| 国产欧美久久久精品影院| 亚洲国产精品嫩草影院| 成人爽a毛片一区二区免费| 欧美精品三级在线观看| 一区二区在线电影| 国产乱一区二区| 精品国产伦一区二区三区免费 | 色综合久久久久网| 亚洲国产成人午夜在线一区| 天天影视涩香欲综合网| 色婷婷激情综合| 国产欧美久久久精品影院| 国产一区二区在线观看免费 | 激情久久久久久久久久久久久久久久| 欧美在线免费播放| 国产精品成人免费| 成人在线视频首页| 精品不卡在线视频| 精品一区二区三区在线观看国产| 在线免费精品视频| 亚洲欧美国产三级| 成人午夜激情在线| 中文一区一区三区高中清不卡| 日韩中文欧美在线| 5858s免费视频成人| 亚洲另类春色校园小说| 91免费在线播放| 亚洲国产精品成人久久综合一区| 国产成人午夜片在线观看高清观看| 91精品综合久久久久久| 婷婷开心激情综合| 日本道精品一区二区三区| 亚洲一区二区高清| 色94色欧美sute亚洲13| 亚洲自拍与偷拍| av在线不卡网| 亚洲夂夂婷婷色拍ww47| www.av亚洲| 亚洲精品久久久久久国产精华液| 成人av高清在线| 亚洲综合视频在线| 91福利国产成人精品照片| 性做久久久久久| 欧美亚洲丝袜传媒另类| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美日韩亚洲不卡| 蜜桃免费网站一区二区三区| 制服丝袜av成人在线看| 美女www一区二区| 亚洲精品在线观| 99久久婷婷国产| 亚洲女女做受ⅹxx高潮| 欧美日韩国产美| 日本不卡1234视频| 国产日韩影视精品| 成人深夜视频在线观看| 亚洲成人你懂的| 日韩一区二区三区在线| 成人深夜视频在线观看| 亚洲视频网在线直播|