Added solution and code.

This commit is contained in:
2014-03-05 03:53:37 +00:00
parent 1d9b670a94
commit e2536e0984
6 changed files with 1685 additions and 0 deletions

8
ChangeLog Normal file
View File

@@ -0,0 +1,8 @@
2014-03-05 Natalia Portillo <claunia@claunia.com>
* SFOParser.sln:
Added solution and code.
* README.md:
Updated README.md

225
SFOParser.sln Normal file
View File

@@ -0,0 +1,225 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SFOParser", "SFOParser\SFOParser.csproj", "{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}.Debug|x86.ActiveCfg = Debug|x86
{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}.Debug|x86.Build.0 = Debug|x86
{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}.Release|x86.ActiveCfg = Release|x86
{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = SFOParser\SFOParser.csproj
Policies = $0
$0.DotNetNamingPolicy = $1
$1.DirectoryNamespaceAssociation = Hierarchical
$1.ResourceNamePolicy = MSBuild
$0.TextStylePolicy = $2
$2.inheritsSet = VisualStudio
$2.inheritsScope = text/plain
$2.scope = text/x-csharp
$0.CSharpFormattingPolicy = $3
$3.IndentSwitchBody = True
$3.AnonymousMethodBraceStyle = NextLine
$3.PropertyBraceStyle = NextLine
$3.PropertyGetBraceStyle = NextLine
$3.PropertySetBraceStyle = NextLine
$3.EventBraceStyle = NextLine
$3.EventAddBraceStyle = NextLine
$3.EventRemoveBraceStyle = NextLine
$3.StatementBraceStyle = NextLine
$3.ElseNewLinePlacement = NewLine
$3.CatchNewLinePlacement = NewLine
$3.FinallyNewLinePlacement = NewLine
$3.WhileNewLinePlacement = DoNotCare
$3.ArrayInitializerWrapping = DoNotChange
$3.ArrayInitializerBraceStyle = NextLine
$3.BeforeMethodDeclarationParentheses = False
$3.BeforeMethodCallParentheses = False
$3.BeforeConstructorDeclarationParentheses = False
$3.BeforeDelegateDeclarationParentheses = False
$3.NewParentheses = False
$3.SpacesBeforeBrackets = False
$3.inheritsSet = Mono
$3.inheritsScope = text/x-csharp
$3.scope = text/x-csharp
$0.TextStylePolicy = $4
$4.inheritsSet = VisualStudio
$4.inheritsScope = text/plain
$4.scope = text/plain
$0.StandardHeader = $5
$5.Text = @\n ${FileName}\n \n Author:\n ${AuthorName} <${AuthorEmail}>\n\n Copyright (c) ${Year} ${CopyrightHolder}\n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 2 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n \n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software\n Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n
$5.IncludeInNewFiles = True
$0.NameConventionPolicy = $6
$6.Rules = $7
$7.NamingRule = $8
$8.Name = Namespaces
$8.AffectedEntity = Namespace
$8.VisibilityMask = VisibilityMask
$8.NamingStyle = PascalCase
$8.IncludeInstanceMembers = True
$8.IncludeStaticEntities = True
$7.NamingRule = $9
$9.Name = Types
$9.AffectedEntity = Class, Struct, Enum, Delegate
$9.VisibilityMask = VisibilityMask
$9.NamingStyle = PascalCase
$9.IncludeInstanceMembers = True
$9.IncludeStaticEntities = True
$7.NamingRule = $10
$10.Name = Interfaces
$10.RequiredPrefixes = $11
$11.String = I
$10.AffectedEntity = Interface
$10.VisibilityMask = VisibilityMask
$10.NamingStyle = PascalCase
$10.IncludeInstanceMembers = True
$10.IncludeStaticEntities = True
$7.NamingRule = $12
$12.Name = Attributes
$12.RequiredSuffixes = $13
$13.String = Attribute
$12.AffectedEntity = CustomAttributes
$12.VisibilityMask = VisibilityMask
$12.NamingStyle = PascalCase
$12.IncludeInstanceMembers = True
$12.IncludeStaticEntities = True
$7.NamingRule = $14
$14.Name = Event Arguments
$14.RequiredSuffixes = $15
$15.String = EventArgs
$14.AffectedEntity = CustomEventArgs
$14.VisibilityMask = VisibilityMask
$14.NamingStyle = PascalCase
$14.IncludeInstanceMembers = True
$14.IncludeStaticEntities = True
$7.NamingRule = $16
$16.Name = Exceptions
$16.RequiredSuffixes = $17
$17.String = Exception
$16.AffectedEntity = CustomExceptions
$16.VisibilityMask = VisibilityMask
$16.NamingStyle = PascalCase
$16.IncludeInstanceMembers = True
$16.IncludeStaticEntities = True
$7.NamingRule = $18
$18.Name = Methods
$18.AffectedEntity = Methods
$18.VisibilityMask = VisibilityMask
$18.NamingStyle = PascalCase
$18.IncludeInstanceMembers = True
$18.IncludeStaticEntities = True
$7.NamingRule = $19
$19.Name = Static Readonly Fields
$19.AffectedEntity = ReadonlyField
$19.VisibilityMask = Internal, Protected, Public
$19.NamingStyle = PascalCase
$19.IncludeInstanceMembers = False
$19.IncludeStaticEntities = True
$7.NamingRule = $20
$20.Name = Fields (Non Private)
$20.AffectedEntity = Field
$20.VisibilityMask = Internal, Protected, Public
$20.NamingStyle = PascalCase
$20.IncludeInstanceMembers = True
$20.IncludeStaticEntities = True
$7.NamingRule = $21
$21.Name = ReadOnly Fields (Non Private)
$21.AffectedEntity = ReadonlyField
$21.VisibilityMask = Internal, Protected, Public
$21.NamingStyle = PascalCase
$21.IncludeInstanceMembers = True
$21.IncludeStaticEntities = False
$7.NamingRule = $22
$22.Name = Fields (Private)
$22.AllowedPrefixes = $23
$23.String = _
$23.String = m_
$22.AffectedEntity = Field, ReadonlyField
$22.VisibilityMask = Private
$22.NamingStyle = CamelCase
$22.IncludeInstanceMembers = True
$22.IncludeStaticEntities = False
$7.NamingRule = $24
$24.Name = Static Fields (Private)
$24.AffectedEntity = Field
$24.VisibilityMask = Private
$24.NamingStyle = CamelCase
$24.IncludeInstanceMembers = False
$24.IncludeStaticEntities = True
$7.NamingRule = $25
$25.Name = ReadOnly Fields (Private)
$25.AllowedPrefixes = $26
$26.String = _
$26.String = m_
$25.AffectedEntity = ReadonlyField
$25.VisibilityMask = Private
$25.NamingStyle = CamelCase
$25.IncludeInstanceMembers = True
$25.IncludeStaticEntities = False
$7.NamingRule = $27
$27.Name = Constant Fields
$27.AffectedEntity = ConstantField
$27.VisibilityMask = VisibilityMask
$27.NamingStyle = PascalCase
$27.IncludeInstanceMembers = True
$27.IncludeStaticEntities = True
$7.NamingRule = $28
$28.Name = Properties
$28.AffectedEntity = Property
$28.VisibilityMask = VisibilityMask
$28.NamingStyle = PascalCase
$28.IncludeInstanceMembers = True
$28.IncludeStaticEntities = True
$7.NamingRule = $29
$29.Name = Events
$29.AffectedEntity = Event
$29.VisibilityMask = VisibilityMask
$29.NamingStyle = PascalCase
$29.IncludeInstanceMembers = True
$29.IncludeStaticEntities = True
$7.NamingRule = $30
$30.Name = Enum Members
$30.AffectedEntity = EnumMember
$30.VisibilityMask = VisibilityMask
$30.NamingStyle = PascalCase
$30.IncludeInstanceMembers = True
$30.IncludeStaticEntities = True
$7.NamingRule = $31
$31.Name = Parameters
$31.AffectedEntity = Parameter
$31.VisibilityMask = VisibilityMask
$31.NamingStyle = CamelCase
$31.IncludeInstanceMembers = True
$31.IncludeStaticEntities = True
$7.NamingRule = $32
$32.Name = Type Parameters
$32.RequiredPrefixes = $33
$33.String = T
$32.AffectedEntity = TypeParameter
$32.VisibilityMask = VisibilityMask
$32.NamingStyle = PascalCase
$32.IncludeInstanceMembers = True
$32.IncludeStaticEntities = True
$0.VersionControlPolicy = $34
$34.CommitMessageStyle = $35
$35.Indent = @\t
$35.LastFilePostfix = "@:\n "
$35.IncludeDirectoryPaths = True
$34.inheritsSet = Mono
$0.ChangeLogPolicy = $36
$36.UpdateMode = ProjectRoot
$36.MessageStyle = $37
$37.LastFilePostfix = "@:\n "
$37.IncludeDirectoryPaths = True
$36.inheritsSet = Mono
description = Parses Sony SFO (System File Object) and prints values.
version = 1.0
EndGlobalSection
EndGlobal

91
SFOParser/Program.cs Normal file
View File

@@ -0,0 +1,91 @@
//
// Program.cs
//
// Author:
// Natalia Portillo <claunia@claunia.com>
//
// Copyright (c) 2014 © Claunia.com
//
// 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
//
using System;
using System.IO;
namespace SFOParser
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("SFOParser v1.0 - Parses given PARAM.SFO file");
Console.WriteLine("Copyright (C) 2014 Natalia Portillo");
if (args.Length != 1)
{
Usage();
Environment.Exit(1);
}
Console.WriteLine();
string filename = args[0];
if (!File.Exists(filename))
{
Console.WriteLine("File \"{0}\" does not exist.", filename);
Usage();
Environment.Exit(2);
}
SFOFile sfo_file = new SFOFile(filename);
if (!sfo_file.OpenSFO())
{
Console.WriteLine("Unable to read SFO header.");
Environment.Exit(3);
}
if (!sfo_file.ReadIndex())
{
Console.WriteLine("Unable to read SFO index.");
Environment.Exit(4);
}
Console.WriteLine("SFO contains {0} entries.", sfo_file.SFOEntries);
Console.WriteLine("Parsing them...");
if (!sfo_file.ParseEntries())
{
Console.WriteLine("Unable to parse SFO entries.");
Environment.Exit(5);
}
Console.WriteLine("Parsed correctly.");
Console.WriteLine("All parsed entries:");
Console.WriteLine("{0}", sfo_file.DecodeAllEntries());
}
private static void Usage()
{
Console.WriteLine();
Console.WriteLine("Usage:");
Console.WriteLine();
Console.WriteLine("\tSFOParser <PARAM.SFO>");
}
}
}

View File

@@ -0,0 +1,22 @@
using System.Reflection;
using System.Runtime.CompilerServices;
// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.
[assembly: AssemblyTitle("SFOParser")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Claunia.com")]
[assembly: AssemblyProduct("")]
[assembly: AssemblyCopyright("© Claunia.com")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
[assembly: AssemblyVersion("1.0.*")]
// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.
//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

1287
SFOParser/SFOFile.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>12.0.0</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E99C44F4-6389-47E6-9DE5-DE11C30AD1D2}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SFOParser</RootNamespace>
<AssemblyName>SFOParser</AssemblyName>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<ReleaseVersion>1.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Externalconsole>true</Externalconsole>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SFOFile.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<StandardHeader Text="&#xA; ${FileName}&#xA; &#xA; Author:&#xA; ${AuthorName} &lt;${AuthorEmail}&gt;&#xA;&#xA; Copyright (c) ${Year} ${CopyrightHolder}&#xA;&#xA; This program is free software; you can redistribute it and/or modify&#xA; it under the terms of the GNU General Public License as published by&#xA; the Free Software Foundation; either version 2 of the License, or&#xA; (at your option) any later version.&#xA;&#xA; This program is distributed in the hope that it will be useful,&#xA; but WITHOUT ANY WARRANTY; without even the implied warranty of&#xA; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the&#xA; GNU General Public License for more details.&#xA; &#xA; You should have received a copy of the GNU General Public License&#xA; along with this program; if not, write to the Free Software&#xA; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA&#xA;" IncludeInNewFiles="True" />
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>