⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 global.c

📁 WiiFuse is a FUSE filesystem module for Linux and Mac OS X. It will let you mount a Wii disc ISO an
💻 C
字号:
/* *  Copyright (C) 2008 dhewg, #wiidev efnet * *  some functions are taken from *  http://git.infradead.org/?p=users/segher/wii.git *  Copyright 2007,2008  Segher Boessenkool  <segher@kernel.crashing.org> *  21:14:49 <@segher> i'll happily grant you to license the whole as v3, btw * *  this file is part of wiifuse *  http://wiibrew.org/index.php?title=Wiifuse * *  This program 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. * *  This program 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 this program; if not, write to the Free Software *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */#include "global.h"u8 verbose_level = 0;u16 get_be16 (const u8 *p) {	return (p[0] << 8) | p[1];}u32 get_be32 (const u8 *p) {	return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];}u64 get_be64 (const u8 *p) {	return ((u64) get_be32 (p) << 32) | get_be32 (p + 4);}void put_be16 (u8 *p, const u16 value) {	p[0] = (value >> 8) & 0xff;        p[1] = value & 0xff;}void put_be32 (u8 *p, const u32 value) {	p[0] = (value >> 24) & 0xff;	p[1] = (value >> 16) & 0xff;	p[2] = (value >> 8) & 0xff;        p[3] = value & 0xff;}void put_be64 (u8 *p, const u64 value) {        put_be32 (p, (value >> 32) & 0xffffffff);        put_be32 (p + 4, value & 0xffffffff);}size_t g_strnlen (const char *s, size_t size) {        size_t i;        for (i = 0; i < size; ++i)                if (s[i] == 0)                        return i;        return size;}u32 get_dol_size (const u8 *header) {        u8 i;        u32 offset, size;        u32 max = 0;        // iterate through the 7 code segments        for (i = 0; i < 7; ++i) {                offset = get_be32 (&header[i * 4]);                size = get_be32 (&header[0x90 + i * 4]);                if (offset + size > max)                        max = offset + size;        }        // iterate through the 11 data segments        for (i = 0; i < 11; ++i) {                offset = get_be32 (&header[0x1c + i * 4]);                size = get_be32 (&header[0xac + i * 4]);                if (offset + size > max)                        max = offset + size;        }        return max;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -