本文整理汇总了C#中Ekona.sFile类的典型用法代码示例。如果您正苦于以下问题:C# sFile类的具体用法?C# sFile怎么用?C# sFile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
sFile类属于Ekona命名空间,在下文中一共展示了sFile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Unpack
public sFolder Unpack(sFile file)
{
if (file.name == "archiveDBK.dsa")
return Archive.Unpack_archiveDBK(pluginHost, file.path);
return new sFolder();
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例2: Show_Info
public Control Show_Info(sFile file)
{
if (file.name.ToUpper().EndsWith(".BIN"))
return new Bin(file.path, file.id, pluginHost, file.name).Get_Control();
return new Control();
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例3: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.name.ToUpper() == "ROMFILE.BIN")
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例4: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (gameCode == "YDNJ" && file.id == 0x1)
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例5: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.id >= 0x2F && file.id <= 0x93)
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:HONZ_Books.cs
示例6: Unpack
public sFolder Unpack(sFile file)
{
if (file.name.ToUpper().EndsWith(".DPK"))
return DPK.Unpack(file.path, pluginHost);
return new sFolder();
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例7: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.id == 0x461 || file.id == 0x462 || file.id == 0x45D || file.id == 0x45F)
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:ROCKMAN_EXE.cs
示例8: Unpack
public sFolder Unpack(sFile file)
{
if (file.name.ToUpper().EndsWith(".PACK"))
return PACK.Unpack(pluginHost, file.path);
return new sFolder();
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例9: Pack
public string Pack(ref sFolder unpacked, sFile file)
{
string fileOut = pluginHost.Get_TempFile();
PAC.Pack(file.path, fileOut, ref unpacked);
return fileOut;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例10: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
string ext = new String(Encoding.ASCII.GetChars(magic));
if (ext == "sadl")
{
byte coding = pluginHost.Get_Bytes(file.path, (int)file.offset + 0x33, 1)[0];
if ((coding & 0xF0) == 0x70 || (coding & 0xF0) == 0xB0)
return Format.Sound;
}
if (file.name.ToUpper().EndsWith(".ADX"))
{
if (magic[0] != 0x80 || magic[1] != 00) // Constant
return Format.Unknown;
byte[] checkBytes = pluginHost.Get_Bytes(file.path, (int)file.offset + 4, 0xF); // Version and encoding flags
if (checkBytes[0] == 0x03 && (checkBytes[0xE] == 0x03 || checkBytes[0xE] == 0x04))
{
byte[] offset = { magic[3], magic[2] };
byte[] copyright = pluginHost.Get_Bytes(file.path, (int)file.offset + BitConverter.ToUInt16(offset, 0) - 2, 6);
if (new String(Encoding.ASCII.GetChars(copyright)) == "(c)CRI")
return Format.Sound;
}
}
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:29,代码来源:Main.cs
示例11: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.name.EndsWith(".PACK"))
return Format.Compressed;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例12: Decrypt
public static sFolder Decrypt(sFile item, int blockSize, IPluginHost pluginHost)
{
sFolder unpacked = new sFolder();
unpacked.files = new List<sFile>();
byte[] data = File.ReadAllBytes(item.path);
int numBlocks = data.Length / blockSize;
for (int i = 0; i < numBlocks; i++)
{
byte[] block = new byte[blockSize];
Array.Copy(data, i * blockSize, block, 0, blockSize);
Decrypt(ref block);
Array.Copy(block, 0, data, i * blockSize, blockSize);
}
string fileout = pluginHost.Get_TempFile();
File.WriteAllBytes(fileout, data);
sFile newItem = new sFile();
newItem.path = fileout;
newItem.offset = 0;
newItem.name = item.name;
newItem.size = (uint)data.Length;
unpacked.files.Add(newItem);
return unpacked;
}
开发者ID:MetLob,项目名称:tinke,代码行数:28,代码来源:Encryption.cs
示例13: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (Encoding.ASCII.GetString(magic) == MagicStamp)
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Arch.cs
示例14: Unpack
public sFolder Unpack(sFile file)
{
if (file.id == 0x3F)
{
sFolder unpack = new sFolder();
unpack.files = new List<sFile>();
BinaryReader br = new BinaryReader(File.OpenRead(file.path));
uint fat_size = br.ReadUInt32();
uint num_files = fat_size / 4 - 1; // Include a ptr to the fat section
for (int i = 0; i < num_files; i++)
{
sFile cfile = new sFile();
cfile.name = "File" + i.ToString() + ".bin";
cfile.path = file.path;
br.BaseStream.Position = 8 + i * 4;
cfile.offset = br.ReadUInt32();
br.BaseStream.Position = cfile.offset;
cfile.size = br.ReadUInt32();
cfile.offset += 4;
unpack.files.Add(cfile);
}
br.Close();
br = null;
return unpack;
}
return new sFolder();
}
开发者ID:MetLob,项目名称:tinke,代码行数:34,代码来源:AWITCHSTALE.cs
示例15: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.name.ToUpper().EndsWith(".DPK"))
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例16: Read
public void Read(sFile file)
{
System.IO.BinaryReader br = new System.IO.BinaryReader(System.IO.File.OpenRead(file.path));
string ext = new String(Encoding.ASCII.GetChars(br.ReadBytes(4)));
br.Close();
if (ext == "CG4 ")
{
CGx cgx = new CGx(file.path, file.id, false, file.name);
pluginHost.Set_Palette(cgx.Palette);
pluginHost.Set_Image(cgx);
}
else if (ext == "CG8 ")
{
CGx cgx = new CGx(file.path, file.id, true, file.name);
pluginHost.Set_Palette(cgx.Palette);
pluginHost.Set_Image(cgx);
}
else if (ext == "SC4 " || ext == "SC8 ")
{
SCx scx = new SCx(file.path, file.id, file.name);
pluginHost.Set_Map(scx);
}
else if (ext == "CGT ")
{
CGT cgt = new CGT(file.path, file.id, file.name);
pluginHost.Set_Palette(cgt.Palette);
pluginHost.Set_Image(cgt);
}
}
开发者ID:MetLob,项目名称:tinke,代码行数:30,代码来源:Main.cs
示例17: Pack
public string Pack(ref sFolder unpacked, sFile file)
{
if (file.name.ToUpper().EndsWith(".DPK"))
return DPK.Pack(ref unpacked, file.path, file.id);
return null;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
示例18: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
string ext = new string(Encoding.ASCII.GetChars(magic));
uint exti = BitConverter.ToUInt32(magic, 0);
if (file.id == 0x1D9 || file.id == 0x1DA)
return Format.FullImage;
else if (ext == "LINK")
return Format.Pack;
else if (exti == 0x0040E3C4 || exti == 0x0040E3BC)
return Format.Pack;
else if (bigImages.Contains(file.id))
return Format.Tile;
else if (bigImages.Contains(file.id - 1))
return Format.System;
else if (file.id == 0x20F || file.id == 0x230 || file.id == 0x231)
return Format.FullImage;
else if (file.id == 0x210 || file.id == 0x232 || file.id == 0x233)
return Format.System;
if (file.id == 0xE6 || file.id == 0xE9)
return Format.Tile;
else if (file.id == 0xE7 || file.id == 0xEA)
return Format.Palette;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:27,代码来源:Main.cs
示例19: Recursive_GetDirectories
/// <summary>
/// Get a "sFolder" variable with all files and folders from the main folder path.
/// </summary>
/// <param name="folderPath">Folder to read</param>
/// <param name="currFolder">Empty folder</param>
/// <returns></returns>
public static sFolder Recursive_GetDirectories(string folderPath, sFolder currFolder)
{
foreach (string file in Directory.GetFiles(folderPath))
{
sFile newFile = new sFile();
newFile.name = Path.GetFileName(file);
newFile.offset = 0x00;
newFile.path = file;
newFile.size = (uint)new FileInfo(file).Length;
if (!(currFolder.files is List<sFile>))
currFolder.files = new List<sFile>();
currFolder.files.Add(newFile);
}
foreach (string folder in Directory.GetDirectories(folderPath))
{
sFolder newFolder = new sFolder();
newFolder.name = new DirectoryInfo(folder).Name;
newFolder = Recursive_GetDirectories(folder, newFolder);
if (!(currFolder.folders is List<sFolder>))
currFolder.folders = new List<sFolder>();
currFolder.folders.Add(newFolder);
}
return currFolder;
}
开发者ID:MetLob,项目名称:tinke,代码行数:34,代码来源:Helper.cs
示例20: Get_Format
public Format Get_Format(sFile file, byte[] magic)
{
if (file.name == "RESOURCE.NXARC")
return Format.Pack;
return Format.Unknown;
}
开发者ID:MetLob,项目名称:tinke,代码行数:7,代码来源:Main.cs
注:本文中的Ekona.sFile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论