<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mephales</id>
		<title>Dragon Age Toolset Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.datoolset.net/mw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mephales"/>
		<link rel="alternate" type="text/html" href="http://www.datoolset.net/wiki/Special:Contributions/Mephales"/>
		<updated>2026-05-05T11:56:09Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.6</generator>

	<entry>
		<id>http://www.datoolset.net/mw/index.php?title=ERF&amp;diff=15946</id>
		<title>ERF</title>
		<link rel="alternate" type="text/html" href="http://www.datoolset.net/mw/index.php?title=ERF&amp;diff=15946"/>
				<updated>2011-03-03T00:29:41Z</updated>
		
		<summary type="html">&lt;p&gt;Mephales: /* Encryption */ described XOR encryption and decryption&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:ERF editor.png|thumb|ERF editor]]&lt;br /&gt;
&lt;br /&gt;
'''ERF''' (&amp;quot;Encapsulated Resource File&amp;quot;) files are container files for game resources. &lt;br /&gt;
&lt;br /&gt;
= List of common ERF Files =&lt;br /&gt;
&lt;br /&gt;
ERF Files for Dragon Age Game Resources are stored in the (Dragon Age Install Dir)\packages\core\ Folder and Subdirectories. ERF's for Addons or Mods are usually in their respective Addon or Mod Folder.&lt;br /&gt;
&lt;br /&gt;
Common ERF's of certain interests are,&lt;br /&gt;
&lt;br /&gt;
*Game Resources&lt;br /&gt;
**packages\core\data\2da.erf&lt;br /&gt;
**packages\core\data\anims.erf&lt;br /&gt;
**packages\core\data\consolescripts.erf&lt;br /&gt;
**packages\core\data\designerareas.erf&lt;br /&gt;
**packages\core\data\designercreatures.erf&lt;br /&gt;
**packages\core\data\designercutscenes.erf&lt;br /&gt;
**packages\core\data\designerdialogs.erf&lt;br /&gt;
**packages\core\data\designeritems.erf&lt;br /&gt;
**packages\core\data\designerplaceables.erf&lt;br /&gt;
**packages\core\data\designerplots.erf&lt;br /&gt;
**packages\core\data\designertriggers.erf&lt;br /&gt;
**packages\core\data\face.erf&lt;br /&gt;
**packages\core\data\gui.erf&lt;br /&gt;
**packages\core\data\guiexport.erf&lt;br /&gt;
**packages\core\data\iterationtests.erf&lt;br /&gt;
**packages\core\data\lightprobedata.erf&lt;br /&gt;
**packages\core\data\materialobjects.erf&lt;br /&gt;
**packages\core\data\materials.erf&lt;br /&gt;
**packages\core\data\misc.erf&lt;br /&gt;
**packages\core\data\modelhierarchies.erf&lt;br /&gt;
**packages\core\data\modelmeshdata.erf&lt;br /&gt;
**packages\core\data\pathfindingpatches.erf&lt;br /&gt;
**packages\core\data\postprocesseffects.erf&lt;br /&gt;
**packages\core\data\resmetrics.erf&lt;br /&gt;
**packages\core\data\scripts.erf&lt;br /&gt;
**packages\core\data\shaders.erf&lt;br /&gt;
**packages\core\data\states.erf&lt;br /&gt;
**packages\core\data\subqueuefiles.erf&lt;br /&gt;
**packages\core\data\textures.erf&lt;br /&gt;
**packages\core\data\tints.erf&lt;br /&gt;
**packages\core\textures\high\texturepack.erf&lt;br /&gt;
**packages\core\textures\medium\texturepack.erf&lt;br /&gt;
&lt;br /&gt;
*Patch Resources&lt;br /&gt;
**packages\core\patch\... --- Contains Resources added by Game Patches&lt;br /&gt;
&lt;br /&gt;
*Toolset specific Resources&lt;br /&gt;
**packages\core\data_tools\... ---Contains Resources for the Toolset&lt;br /&gt;
&lt;br /&gt;
= Extracting Resources =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- As long as no technical explanation is present or needed, I may prefer seeing explanations of usage like this: --&amp;gt;&lt;br /&gt;
The Toolset is capable of extracting ERF Files Contents.&lt;br /&gt;
&lt;br /&gt;
If you are modding Resources, the first step would be extracting Resources. You may start of by extracting all Resources of certain interest to you, or just a single File. To Maintain a simple and clean resource place, it is best to use a similar Folder Names to extract in.&lt;br /&gt;
&lt;br /&gt;
One may create a Folder on the HD named for example &amp;quot;gameresources&amp;quot;. Then added with subfolders that suit the Purpose, for example &amp;quot;Materials&amp;quot; in which one extracts only Materials. Preferably the Folderscheme is similar to that of the ERF's, to make browsing simple and easy to remember. &lt;br /&gt;
&lt;br /&gt;
= Packing Resources =&lt;br /&gt;
&lt;br /&gt;
The [[builder to player]] process packages up resources into ERF files for you, storing the generated ERFs inside [[DAZIP]]s.&lt;br /&gt;
&lt;br /&gt;
Additionally, you can edit any ERF by opening it directly in the Toolset, and add or remove files by drag&amp;amp; dropping them into the Toolset with the ERF open manually. In cases the above process fails or whenever.&lt;br /&gt;
&lt;br /&gt;
= Overriding Resources =&lt;br /&gt;
&lt;br /&gt;
ERF's are named by their general purpose. But not all material files need to necessarily be put into Materials.ERF as an example. Patches do add every Patched Resource into one single ERF for example. The Original Game Resource ERF Files however are best left alone, as it has a high risk of breaking the game.&lt;br /&gt;
&lt;br /&gt;
Files do not need to be present in ERF Files at all. When Overriding Gameresources as when modding, this is a pretty easy method. Overriding Files are of equal name to their original Gameresource counterpart, and are to be placed into packages\core\override\. The Game will then choose this File over the original.&lt;br /&gt;
&lt;br /&gt;
= File Format =&lt;br /&gt;
&lt;br /&gt;
== Version 2.0 ==&lt;br /&gt;
&lt;br /&gt;
All values are [http://en.wikipedia.org/wiki/Endianness#Little-endian little-endian].&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| magic&lt;br /&gt;
| utf16[8]&lt;br /&gt;
| &amp;quot;ERF V2.0&amp;quot;, a total of 16 bytes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| fileCount&lt;br /&gt;
| uint32&lt;br /&gt;
| Number of files encapsulated in this ERF.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| year&lt;br /&gt;
| uint32&lt;br /&gt;
| Year since 1900.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| day&lt;br /&gt;
| uint32&lt;br /&gt;
| Day since January 1st.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| unknown&lt;br /&gt;
| uint32&lt;br /&gt;
| Always 0xFFFFFFFF?&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Table of Contents ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| toc&lt;br /&gt;
| [[#Entry|entry]][fileCount]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Entry ====&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| utf16[32]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| uint32&lt;br /&gt;
| Offset to entry file data, from start of ERF file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| size&lt;br /&gt;
| uint32&lt;br /&gt;
| Length of file data.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
 &lt;br /&gt;
== Version 2.2 ==&lt;br /&gt;
&lt;br /&gt;
This version introduces support for encrypted and compressed file data.&lt;br /&gt;
&lt;br /&gt;
All values are [http://en.wikipedia.org/wiki/Endianness#Little-endian little-endian].&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| magic&lt;br /&gt;
| utf16[8]&lt;br /&gt;
| &amp;quot;ERF V2.2&amp;quot;, a total of 16 bytes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| fileCount&lt;br /&gt;
| uint32&lt;br /&gt;
| Number of files encapsulated in this ERF.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| year&lt;br /&gt;
| uint32&lt;br /&gt;
| Year since 1900.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| day&lt;br /&gt;
| uint32&lt;br /&gt;
| Day since January 1st.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| unknown&lt;br /&gt;
| uint32&lt;br /&gt;
| Always 0xFFFFFFFF?&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| uint32 [http://en.wikipedia.org/wiki/Bit_field Bit flags]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
* 0x00000001 (bit 0) : Unknown&lt;br /&gt;
* 0x000000F0 (bits 4 - 7) : [[#Encryption|Encryption]] scheme&lt;br /&gt;
* 0xE0000000 (bits 29 - 31) : [[#Compression|Compression]] scheme&lt;br /&gt;
&lt;br /&gt;
[[#Encryption|Encryption]] scheme:&lt;br /&gt;
''(flags &amp;gt;&amp;gt; 4) &amp;amp; 0xF''&lt;br /&gt;
* 0 : None&lt;br /&gt;
* 1 : XOR&lt;br /&gt;
* 2 : Blowfish&lt;br /&gt;
* 3 : Blowfish ''(Dragon Age 2 only)''&lt;br /&gt;
* Any other value is invalid.&lt;br /&gt;
&lt;br /&gt;
[[#Compression|Compression]] scheme:&lt;br /&gt;
''(flags &amp;gt;&amp;gt; 29) &amp;amp; 0x7''&lt;br /&gt;
* 0 : None&lt;br /&gt;
* 1 : Bioware Zlib ''(Dragon Age 2 only)''&lt;br /&gt;
* 7 : Headerless Zlib ''(Dragon Age 2 only)''&lt;br /&gt;
* Any other value is invalid.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| moduleId&lt;br /&gt;
| uint32&lt;br /&gt;
| This id is used to look up the password for the ERF when encryption is present, for example, DLC.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| passwordDigest&lt;br /&gt;
| byte[16]&lt;br /&gt;
| [http://en.wikipedia.org/wiki/MD5 MD5] sum of password (as a string).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Table of Contents ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| toc&lt;br /&gt;
| [[#Entry_2|entry]][fileCount]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Entry ====&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| name&lt;br /&gt;
| utf16[32]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| uint32&lt;br /&gt;
| Offset to entry file data, from start of ERF file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| packedSize&lt;br /&gt;
| uint32&lt;br /&gt;
| Packed length of file data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| unpackedSize&lt;br /&gt;
| uint32&lt;br /&gt;
| Unpacked length of file data.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Version 3.0 ==&lt;br /&gt;
&lt;br /&gt;
Found in Dragon Age 2.&lt;br /&gt;
&lt;br /&gt;
This version introduces hashed file names (and extensions) for faster file lookup.&lt;br /&gt;
&lt;br /&gt;
All values are [http://en.wikipedia.org/wiki/Endianness#Little-endian little-endian].&lt;br /&gt;
&lt;br /&gt;
=== Header ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| magic&lt;br /&gt;
| utf16[8]&lt;br /&gt;
| &amp;quot;ERF V3.0&amp;quot;, a total of 16 bytes.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| stringTableSize&lt;br /&gt;
| uint32&lt;br /&gt;
| Size of the file name string table.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| fileCount&lt;br /&gt;
| uint32&lt;br /&gt;
| Number of files encapsulated in this ERF.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| flags&lt;br /&gt;
| uint32 [http://en.wikipedia.org/wiki/Bit_field Bit flags]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
Flags:&lt;br /&gt;
* 0x00000001 (bit 0) : Unknown&lt;br /&gt;
* 0x000000F0 (bits 4 - 7) : [[#Encryption|Encryption]] scheme&lt;br /&gt;
* 0xE0000000 (bits 29 - 31) : [[#Compression|Compression]] scheme&lt;br /&gt;
&lt;br /&gt;
[[#Encryption|Encryption]] scheme:&lt;br /&gt;
''(flags &amp;gt;&amp;gt; 4) &amp;amp; 0xF''&lt;br /&gt;
* 0 : None&lt;br /&gt;
* 1 : XOR&lt;br /&gt;
* 2 : Blowfish&lt;br /&gt;
* 3 : Blowfish ''(Dragon Age 2 only)''&lt;br /&gt;
* Any other value is invalid.&lt;br /&gt;
&lt;br /&gt;
[[#Compression|Compression]] scheme:&lt;br /&gt;
''(flags &amp;gt;&amp;gt; 29) &amp;amp; 0x7''&lt;br /&gt;
* 0 : None&lt;br /&gt;
* 1 : Bioware Zlib ''(Dragon Age 2 only)''&lt;br /&gt;
* 7 : Headerless Zlib ''(Dragon Age 2 only)''&lt;br /&gt;
* Any other value is invalid.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| moduleId&lt;br /&gt;
| uint32&lt;br /&gt;
| This id is used to look up the password for the ERF when encryption is present, for example, DLC.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| passwordDigest&lt;br /&gt;
| byte[16]&lt;br /&gt;
| [http://en.wikipedia.org/wiki/MD5 MD5] sum of password (as a string).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| stringTable&lt;br /&gt;
| char[stringTableSize]&lt;br /&gt;
| Zero-padded strings referenced by nameOffset in [[#Entry_3|TOC entries]]. Strings are stored as ASCII. Note that not all TOC entries have to reference an entry in the string table.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Table of Contents ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| toc&lt;br /&gt;
| [[#Entry_3|entry]][fileCount]&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Entry ====&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; width=&amp;quot;100%&amp;quot; &lt;br /&gt;
&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Name&lt;br /&gt;
! width=&amp;quot;20%&amp;quot; | Type / Size&lt;br /&gt;
! width=&amp;quot;60%&amp;quot; | Info&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nameOffset&lt;br /&gt;
| int32&lt;br /&gt;
| Offset in stringTable of the file name for this entry. -1 if none.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| nameHash&lt;br /&gt;
| uint64&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function FNV64 hash] of lowercased file name, including path and extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| typeHash&lt;br /&gt;
| uint32&lt;br /&gt;
| [http://en.wikipedia.org/wiki/Fowler–Noll–Vo_hash_function FNV32 hash] of lowercased file extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| offset&lt;br /&gt;
| uint32&lt;br /&gt;
| Offset to entry file data, from start of ERF file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| packedSize&lt;br /&gt;
| uint32&lt;br /&gt;
| Packed length of file data.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| unpackedSize&lt;br /&gt;
| uint32&lt;br /&gt;
| Unpacked length of file data.&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== File Data ==&lt;br /&gt;
&lt;br /&gt;
=== Encryption ===&lt;br /&gt;
&lt;br /&gt;
When the appropriate flags are set in the header, a digest of the password will be present. File data will be encrypted depending on what scheme is specified.&lt;br /&gt;
&lt;br /&gt;
You may not extract such third party ERF files unless you have permission to do so. This is provided only for purposes when you want to encrypt your own ERF files.&lt;br /&gt;
&lt;br /&gt;
==== Blowfish ====&lt;br /&gt;
&lt;br /&gt;
File data will be encrypted using [http://en.wikipedia.org/wiki/Blowfish_(cipher) Blowfish] in ECB.&lt;br /&gt;
&lt;br /&gt;
'''To encrypt:'''&lt;br /&gt;
* Generate random number (represented as string, base 10), such as &amp;quot;12345678&amp;quot;.&lt;br /&gt;
* Generate digest of the string (without null-terminating character) using MD5 and store it in the header.&lt;br /&gt;
* Convert those digits to 64-bit integer (0x0000000000BC614E).&lt;br /&gt;
* Store it in byte array in little-endian encoding (0x4E, 0x61, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00).&lt;br /&gt;
* Use that array as key to initialize Blowfish.&lt;br /&gt;
* Pad your content to multiple of 8 with zeroes.&lt;br /&gt;
* Encrypt the data.&lt;br /&gt;
&lt;br /&gt;
'''To decrypt:'''&lt;br /&gt;
* You already know your password (&amp;quot;12345678&amp;quot;).&lt;br /&gt;
* Generate its MD5 digest and compare it with the digest in the header.&lt;br /&gt;
* If they don't match file is either damaged or you forgot your password. If you forgot, brute-force attack should take no more than 1 minute. You '''may not''' perform brute-force attack on ERF files that are not yours unless you have permission from its owner to do so.&lt;br /&gt;
* Convert those digits to 64-bit integer (0x0000000000BC614E).&lt;br /&gt;
* Store it in byte array in little-endian encoding (0x4E, 0x61, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00).&lt;br /&gt;
* Use that array as key to initialize Blowfish.&lt;br /&gt;
* Decrypt the data.&lt;br /&gt;
&lt;br /&gt;
==== XOR ====&lt;br /&gt;
&lt;br /&gt;
Much of the process for protecting data with [http://en.wikipedia.org/wiki/Exclusive_or XOR] is the same as for Blowfish.&lt;br /&gt;
&lt;br /&gt;
'''To encrypt:'''&lt;br /&gt;
* Generate random number (represented as string, base 10), such as &amp;quot;12345678&amp;quot;.&lt;br /&gt;
* Generate digest of the string (without null-terminating character) using MD5 and store it in the header.&lt;br /&gt;
* Convert those digits to 72-bit integer (0x000000000000BC614E).&lt;br /&gt;
* Store it in byte array in little-endian encoding (0x4E, 0x61, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00).&lt;br /&gt;
* XOR each block of 9 bytes with the array.&lt;br /&gt;
* If the final block is not 9 bytes, XOR the block with the first N bytes of the array, where N is the length of the block.&lt;br /&gt;
&lt;br /&gt;
'''To decrypt:'''&lt;br /&gt;
* You already know your password (&amp;quot;12345678&amp;quot;).&lt;br /&gt;
* Generate its MD5 digest and compare it with the digest in the header.&lt;br /&gt;
* If they don't match file is either damaged or you forgot your password. If you forgot, brute-force attack should take no more than 1 minute. You '''may not''' perform brute-force attack on ERF files that are not yours unless you have permission from its owner to do so.&lt;br /&gt;
* Convert those digits to 72-bit integer (0x000000000000BC614E).&lt;br /&gt;
* Store it in byte array in little-endian encoding (0x4E, 0x61, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00).&lt;br /&gt;
* XOR each block of 9 bytes with the array.&lt;br /&gt;
* If the final block is not 9 bytes, XOR the block with the first N bytes of the array, where N is the length of the block.&lt;br /&gt;
&lt;br /&gt;
=== Compression ===&lt;br /&gt;
&lt;br /&gt;
'''''Compression is not supported by Dragon Age: Origins.'''''&lt;br /&gt;
&lt;br /&gt;
Compression is supported by Dragon Age 2.&lt;br /&gt;
&lt;br /&gt;
Note that if encryption is enabled:&lt;br /&gt;
* When decompressing, file data must first be decrypted.&lt;br /&gt;
* When compressing, file data must be encrypted after compression.&lt;br /&gt;
&lt;br /&gt;
==== Bioware Zlib ====&lt;br /&gt;
&lt;br /&gt;
File data is compressed with [http://en.wikipedia.org/wiki/Zlib zlib], with a custom 1-byte (commonly observed as 0xF9) header (vs the normal 2-byte zlib header).&lt;br /&gt;
&lt;br /&gt;
The upper 4 bits of the header byte represent the window bits. The lower 4 bits are currently unknown.&lt;br /&gt;
&lt;br /&gt;
==== Headerless Zlib ====&lt;br /&gt;
&lt;br /&gt;
File data is compressed with [http://en.wikipedia.org/wiki/Zlib zlib], the normal 2-byte zlib header is omitted.&lt;br /&gt;
&lt;br /&gt;
[[Category:File types]]&lt;/div&gt;</summary>
		<author><name>Mephales</name></author>	</entry>

	<entry>
		<id>http://www.datoolset.net/mw/index.php?title=Talk:GFF&amp;diff=15884</id>
		<title>Talk:GFF</title>
		<link rel="alternate" type="text/html" href="http://www.datoolset.net/mw/index.php?title=Talk:GFF&amp;diff=15884"/>
				<updated>2011-02-28T04:20:10Z</updated>
		
		<summary type="html">&lt;p&gt;Mephales: /* GFF V4.1 */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here's some more info on it for consideration. As is, the wiki article leaves you to guess at a lot of what's going on. Listing it here for now so I don't lose track of it.&lt;br /&gt;
* http://social.bioware.com/forum/1/topic/8/index/464166&lt;br /&gt;
* http://social.bioware.com/forum/1/topic/72/index/508109&lt;br /&gt;
--[[User:FollowTheGourd|FollowTheGourd]] 06:56, 26 January 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
== Field information incorrect ==&lt;br /&gt;
After checking a .das file with the GFF editor that comes with the toolset, it would appear that FieldType is TypeID *then* flags. Also the flags are Reference (MSB, bit 16), List (bit 15), and Struct (bit 14).&lt;br /&gt;
&lt;br /&gt;
This can be verified with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# let data be an array of the gff file&lt;br /&gt;
# let offset be the start of a field in the field array&lt;br /&gt;
(id, type, flags, index) = unpack(&amp;quot;I H H I),data[offset:offset+12])&lt;br /&gt;
&lt;br /&gt;
isList = (flags &amp;amp; (1 &amp;lt;&amp;lt; 15) &amp;gt;0)&lt;br /&gt;
isStruct = (flags &amp;amp; (1 &amp;lt;&amp;lt; 14) &amp;gt;0)&lt;br /&gt;
isRef = (flags &amp;amp; (1 &amp;lt;&amp;lt; 16) &amp;gt;0)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Given this, I'm going to change the page. If I'm incorrect, feel free to revert and explain why here.&lt;br /&gt;
&lt;br /&gt;
--[[User:Overture1943|Overture1943]] 19:22, 6 November 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
:I say this is not easy, however i think the original was correct. I dont have big explanation at hand, the Bonesused List in MMH for example has Bit 1 set. The &amp;quot;Generic List&amp;quot; has Bit 1 and 3 set (Where with Bit3 Data contains a Struct reference). And lastly &amp;quot;Struct List&amp;quot; has Bit 1 and 2 set. (Where with bit2 the Data contains the Struct itself) All of them data are referenced in itself, however i think that is a given for Lists. &lt;br /&gt;
:With which if only Bit3 is set, then the Data isnt referenced, but a struct is referenced ,and it is not a list or so it seems to me. [[User:Eshme|Eshme]] 07:25, 15 March 2010 (UTC)&lt;br /&gt;
::This appears true in GAD files as well, solely Bit1 is set for a Float32 list. [[User:Eshme|Eshme]] 22:51, 15 March 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
== GFF V4.1 ==&lt;br /&gt;
&lt;br /&gt;
Due to the new ERF V3.0 format, we don't have a lot to go on for the new GFF V4.1 format. The only example I know of is profile.dap. However, here are my thoughts. The header has two additional uint32 fields, giving us:&lt;br /&gt;
&amp;lt;pre&amp;gt;struct header {&lt;br /&gt;
  char[8] magic = &amp;quot;GFF V4.1&amp;quot;;&lt;br /&gt;
  char[4] platform;&lt;br /&gt;
  char[4] file_type;&lt;br /&gt;
  char[4] file_version;&lt;br /&gt;
  uint32 struct_count;&lt;br /&gt;
  uint32 unknown_1;&lt;br /&gt;
  uint32 string_offset;&lt;br /&gt;
  uint32 data_offset;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
I haven't figured out what the first new field is, but the field I call string_offset appears to be an offset from the beginning of the file to a new list of zero-terminated strings, just like the ERF V3.0 format has for filenames. And as a result of this, it appears that ECStrings are now represented as offsets into this string section. They also do not start with the length of the string, and it appears the strings are most probably encoded in utf-8, but definitely not in utf-16 anymore.&lt;br /&gt;
&lt;br /&gt;
I had an alternate theory that involved the the strings still being part of the data section and the root structure being able to start later in the data section, but the offsets for lists are still relative to the root structure's start, so they appear to be different sections.&lt;br /&gt;
&lt;br /&gt;
I imagine there will be a few more surprises in store for us beyond these, like what the purpose of the first new field is, but it looks like we need to puzzle out the ERF V3.0 format or wait for a toolset so we can get more GFF V4.1 samples. [[User:Mephales|Mephales]] 04:20, 28 February 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Mephales</name></author>	</entry>

	</feed>