BrawlCrate v0.41
Wii File Editor
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | List of all members
BrawlLib.SSBB.ResourceNodes.ModuleSectionNode Class Reference
Inheritance diagram for BrawlLib.SSBB.ResourceNodes.ModuleSectionNode:
BrawlLib.SSBB.ResourceNodes.ModuleDataNode BrawlLib.SSBB.ResourceNodes.RELEntryNode BrawlLib.SSBB.ResourceNodes.ResourceNode

Public Member Functions

 ModuleSectionNode ()
 
 ModuleSectionNode (uint size)
 
override bool OnInitialize ()
 
override void OnPopulate ()
 
override int OnCalculateSize (bool force)
 
override void OnRebuild (VoidPtr address, int length, bool force)
 
override void Dispose ()
 
override void Export (string outPath)
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ModuleDataNode
override void Dispose ()
 
void InitBuffer (uint size, VoidPtr address)
 Fills the data buffer with the specified amount of data from an address. More...
 
void InitBuffer (uint size)
 Fills the data buffer with the specified amount of zerobytes. More...
 
- Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void OnRenamed ()
 
List< ResourceNodeGetChildrenRecursive ()
 Used primarily to get bone lists. Kept for all resource nodes for utility. More...
 
virtual void SignalPropertyChange ()
 
virtual void Dispose ()
 
void SelectChildAtIndex (int index)
 
void UpdateProperties ()
 
void UpdateCurrentControl ()
 
virtual bool MoveUp ()
 
virtual bool MoveDown ()
 
virtual void OnMoved ()
 
virtual void DoMoveDown ()
 
virtual void DoMoveDown (bool select)
 
virtual void DoMoveUp ()
 
virtual void DoMoveUp (bool select)
 
virtual bool AddUp ()
 
virtual bool AddDown ()
 
virtual bool ToParent ()
 
void Populate (int levels=-1)
 
virtual void OnPopulate ()
 
void Initialize (ResourceNode parent, FileMap source)
 
void Initialize (ResourceNode parent, VoidPtr address, int length)
 
void Initialize (ResourceNode parent, DataSource origSource)
 
virtual void Initialize (ResourceNode parent, DataSource origSource, DataSource uncompSource)
 
virtual bool OnInitialize ()
 
virtual void Restore ()
 
virtual void Remove ()
 
virtual void RemoveChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child)
 
virtual void AddChild (ResourceNode child, bool change)
 
virtual void InsertChild (ResourceNode child, int index)
 
virtual void InsertChild (ResourceNode child, bool change, int index)
 
void SetSizeInternal (int size)
 
virtual void Replace (string fileName)
 
virtual void Replace (ResourceNode node)
 
virtual void Replace (string fileName, FileMapProtect prot, FileOptions options)
 
virtual void ReplaceRaw (VoidPtr address, int length)
 
virtual void ReplaceRaw (FileMap map)
 
virtual void Export (string outPath)
 
void Export (FileStream outStream)
 
virtual void ExportUncompressed (string outPath)
 
void ExportUncompressed (FileStream outStream)
 
virtual void Rebuild ()
 
virtual void Rebuild (bool force)
 
virtual void Rebuild (VoidPtr address, int length, bool force)
 
virtual void OnRebuild (VoidPtr address, int length, bool force)
 
virtual int CalculateSize (bool force)
 
virtual int OnCalculateSize (bool force)
 
void Merge ()
 
void Merge (bool forceBuild)
 
ResourceNode FindChildByType (string path, bool searchChildren, params ResourceType[] types)
 
ResourceNode FindChildByType (string path, bool searchChildren, StringComparison compare, params ResourceType[] types)
 
ResourceNode FindChild (string path)
 
ResourceNode FindChild (string path, bool searchChildren)
 
ResourceNode FindChild (string path, StringComparison compare)
 
ResourceNode FindChild (string path, bool searchChildren, StringComparison compare)
 
ResourceNode[] FindChildrenByClassType (string path, Type type)
 
ResourceNode[] FindChildrenByType (string path, ResourceType type)
 
ResourceNode[] FindChildrenByTypeInGroup (string path, ResourceType type, byte group)
 
ResourceNode[] FindChildrenByName (string name)
 
unsafe string FindName (string name)
 
ResourceNode FindEmbeddedIndex (int index)
 
virtual unsafe byte[] MD5 ()
 Find the MD5 checksum of this node's data. If this node doesn't have any data (BRESGroupNode, for example), this method will return null. More...
 
string MD5Str ()
 Get the result of the MD5() function as a string of hexadecimal digits. If MD5() returns null, this method will return an empty string. More...
 
ResourceNode PrevSibling ()
 
ResourceNode NextSibling ()
 
override string ToString ()
 
virtual void SortChildren ()
 

Public Attributes

bool _isCodeSection = false
 
bool _isBSSSection
 
int _dataOffset
 
int _endBufferSize
 
uint _dataSize
 
int _dataAlign
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ModuleDataNode
RelocationManager _manager
 
UnsafeBuffer _dataBuffer
 
SectionEditor _linkedEditor = null
 
- Public Attributes inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
Form _mainForm
 
string _name
 
string _origPath
 
ResourceNode _parent
 
List< ResourceNode_children = new List<ResourceNode>()
 
int _calcSize
 
EventHandler UpdateControl
 
MoveEventHandler MovedDown
 
ResourceEventHandler Renamed
 
ResourceEventHandler PropertyChanged
 
ResourceEventHandler Replaced
 
ResourceEventHandler Restored
 
ResourceChildEventHandler ChildRemoved
 
bool _isPopulating
 
bool _replaced
 

Properties

override ResourceType ResourceFileType [get]
 
override uint ASMOffset [get]
 
string DataAlign [get]
 
int? EndBufferSize [get, set]
 
bool ExpandSection [get, set]
 
bool HasCommands [get]
 
override bool HasCode [get]
 
bool IsBSS [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ModuleDataNode
virtual bool HasCode [get]
 
virtual uint ASMOffset [get]
 
string DataSize [get]
 
buintBufferAddress [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.RELEntryNode
override ResourceType ResourceFileType [get]
 
uint ModuleID [get]
 
uint RootOffset [get]
 
string FileOffset [get]
 
VoidPtr BaseAddress [get]
 
ResourceNode Root [get]
 
ModuleSectionNode Location [get]
 
- Properties inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
string FilePath [get]
 
string FileName [get]
 
string DirectoryName [get]
 
ResourceNode RootNode [get]
 
DataSource OriginalSource [get]
 
DataSource UncompressedSource [get]
 
DataSource WorkingSource [get]
 
DataSource WorkingUncompressed [get]
 
virtual bool HasChildren [get]
 
virtual ResourceType ResourceFileType [get]
 
string NodeType [get]
 
virtual string TreePathAbsolute [get]
 
virtual string TreePath [get]
 
virtual int Level [get]
 
virtual int MaxNameLength [get]
 
virtual bool AllowDuplicateNames [get]
 
virtual bool AllowNullNames [get]
 
virtual string Name [get, set]
 
ResourceNode Parent [get, set]
 
List< ResourceNodeChildren [get]
 
int Index [get]
 
int HexIndex [get]
 
bool IsCompressed [get]
 
bool HasChanged [get, set]
 
bool IsBranch [get]
 
bool HasMerged [get]
 
virtual bool AllowSaving [get, set]
 
virtual bool IsDirty [get, set]
 
virtual uint UncompressedSize [get]
 
virtual Type[] AllowedChildTypes [get]
 
virtual string Compression [get, set]
 
virtual bool RetainChildrenOnReplace [get]
 
virtual bool supportsCompression [get]
 
static MD5CryptoServiceProvider MD5Provider [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
static ResourceNode[] FindAllSubNodes (ResourceNode root)
 
static ResourceNode FindNode (ResourceNode root, string path, bool searchChildren, StringComparison compare)
 
- Protected Member Functions inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
void ForceReplacedEvent ()
 
virtual void MergeInternal ()
 
- Events inherited from BrawlLib.SSBB.ResourceNodes.ResourceNode
SelectEventHandler SelectChild
 
EventHandler UpdateProps
 
MoveEventHandler MovedUp
 
ResourceEventHandler Disposing
 
ResourceChildEventHandler ChildAdded
 
ResourceChildInsertEventHandler ChildInserted
 

Constructor & Destructor Documentation

◆ ModuleSectionNode() [1/2]

BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.ModuleSectionNode ( )
inline
74 {
75 }

◆ ModuleSectionNode() [2/2]

BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.ModuleSectionNode ( uint  size)
inline
78 {
79 InitBuffer(size);
80 }
void InitBuffer(uint size, VoidPtr address)
Fills the data buffer with the specified amount of data from an address.
Definition: ModuleDataNode.cs:55

Member Function Documentation

◆ Dispose()

override void BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.Dispose ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ModuleDataNode.

137 {
139
140 base.Dispose();
141 }
void Dispose()
Definition: UnsafeBuffer.cs:32
UnsafeBuffer _dataBuffer
Definition: ModuleDataNode.cs:17

◆ Export()

override void BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.Export ( string  outPath)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

158 {
159 using (FileStream stream = new FileStream(outPath, FileMode.OpenOrCreate, FileAccess.ReadWrite,
160 FileShare.None, 8, FileOptions.RandomAccess))
161 {
162 stream.SetLength(_dataBuffer.Length);
163 using (FileMap map = FileMap.FromStream(stream))
164 {
166 }
167 }
168 }
Definition: FileMap.cs:10
static FileMap FromStream(FileStream stream)
Definition: FileMap.cs:117
VoidPtr Address
Definition: FileMap.cs:16
Definition: Memory.cs:8
static void Move(VoidPtr dst, VoidPtr src, uint size)
Definition: Memory.cs:9
VoidPtr Address
Definition: UnsafeBuffer.cs:9
int Length
Definition: UnsafeBuffer.cs:14

◆ OnCalculateSize()

override int BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.OnCalculateSize ( bool  force)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

122 {
123 return _dataBuffer.Length + _endBufferSize;
124 }
int _endBufferSize
Definition: RELSectionNode.cs:21

◆ OnInitialize()

override bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.OnInitialize ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

83 {
84 _expand = false;
85 if (_name == null)
86 {
87 if (_dataSize > 0)
88 {
89 _name = $"Section [{Index}]";
90 }
91 else
92 {
93 _name = $"null [{Index}]";
94 }
95 }
96
97 if (_dataOffset == 0 && WorkingUncompressed.Length != 0)
98 {
99 _isBSSSection = true;
101 }
102 else
103 {
104 _isBSSSection = false;
105 InitBuffer(_dataSize, Header);
106 if (Index == 5)
107 {
108 _parser = new ObjectParser(this);
109 }
110 }
111
112 return _parser != null;
113 }
int _dataOffset
Definition: RELSectionNode.cs:20
bool _isBSSSection
Definition: RELSectionNode.cs:19
uint _dataSize
Definition: RELSectionNode.cs:22
string _name
Definition: ResourceNode.cs:139
int Index
Definition: ResourceNode.cs:301
DataSource WorkingUncompressed
Definition: ResourceNode.cs:183
int Length
Definition: ResourceNode.cs:32

◆ OnPopulate()

override void BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.OnPopulate ( )
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

116 {
117 _parser?.Parse();
118 _parser?.Populate();
119 }
void Parse()
Definition: RELObjectParser.cs:22
void Populate()
Definition: RELObjectParser.cs:193

◆ OnRebuild()

override void BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.OnRebuild ( VoidPtr  address,
int  length,
bool  force 
)
inlinevirtual

Reimplemented from BrawlLib.SSBB.ResourceNodes.ResourceNode.

127 {
128 Memory.Move(address, _dataBuffer.Address, (uint) length);
129 address += _dataBuffer.Length;
130 if (_endBufferSize > 0)
131 {
132 Memory.Fill(address, (uint)_endBufferSize, 0x00);
133 }
134 }

Member Data Documentation

◆ _dataAlign

int BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._dataAlign

◆ _dataOffset

int BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._dataOffset

◆ _dataSize

uint BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._dataSize

◆ _endBufferSize

int BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._endBufferSize

◆ _isBSSSection

bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._isBSSSection

◆ _isCodeSection

bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode._isCodeSection = false

Property Documentation

◆ ASMOffset

override uint BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.ASMOffset
get

◆ DataAlign

string BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.DataAlign
get

◆ EndBufferSize

int? BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.EndBufferSize
getset
29 {
30 get => _endBufferSize;
31 set
32 {
33 if (value % 4 != 0 &&
34 MessageBox.Show(
35 "Buffers should generally be multiples of 0x4, are you sure you want to set this? (It may make the module unreadable!)",
36 "", MessageBoxButtons.YesNo) != DialogResult.Yes)
37 {
38 return;
39 }
40
41 if (value < 0 && !ExpandSection)
42 {
43 return;
44 }
45
46 _endBufferSize = value;
48 }
49 }
bool ExpandSection
Definition: RELSectionNode.cs:55
virtual void SignalPropertyChange()
Definition: ResourceNode.cs:313

◆ ExpandSection

bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.ExpandSection
getset
55 {
56 get => _expand;
57 set
58 {
59 _expand = value;
61 }
62
63 }

◆ HasCode

override bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.HasCode
get

◆ HasCommands

bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.HasCommands
get

◆ IsBSS

bool BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.IsBSS
get

◆ ResourceFileType

override ResourceType BrawlLib.SSBB.ResourceNodes.ModuleSectionNode.ResourceFileType
get

The documentation for this class was generated from the following file: