Skip to content

Commit

Permalink
Merge pull request #1 from RedMadKnight/master
Browse files Browse the repository at this point in the history
Merging "1-st 1.0.8 update"
  • Loading branch information
DarkLotus committed Sep 26, 2013
2 parents b60e93a + 540024f commit d2acdbe
Show file tree
Hide file tree
Showing 7 changed files with 10,613 additions and 9,380 deletions.
Expand Up @@ -31,6 +31,7 @@ public enum NetAttributeEncoding
Float16,
Float16Or32,
Float32,
Null,
}

public class NetAttribute
Expand Down Expand Up @@ -87,6 +88,10 @@ public static void SaveXml(string filename)
for (int i = 0; i < Attributes.Length; i++)
{
var a = Attributes[i];
if (a == null)
{
continue;
}
root.Add(new XElement("Entry",
new XAttribute("Id", a.Id),
new XAttribute("U2", a.U2),
Expand Down
Expand Up @@ -182,9 +182,25 @@ public virtual void GenerateClass(StringBuilder b, int pad)
public virtual void GenerateOptionalParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); }
public virtual void GenerateOptionalEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); }

public virtual void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f) { throw new NotImplementedException(); }
public virtual void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); }
public virtual void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName) { throw new NotImplementedException(); }
public virtual void GenerateFixedArrayField(StringBuilder b, int pad, FieldDescriptor f)
{
b.Append(' ', pad); b.AppendLine("\\\\TESTING");
b.Append(' ', pad); b.AppendLine("public byte["+ f.ArrayLength +"] _" + f.GetFieldName() + ";");
b.Append(' ', pad); b.AppendLine("public byte[" + f.ArrayLength + "] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { _" + f.GetFieldName() + " = value; } }");
//throw new NotImplementedException();
}
public virtual void GenerateFixedArrayParseBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
{
b.Append(' ', pad); b.AppendLine("public byte[" + f.ArrayLength + "] _" + f.GetFieldName() + ";");
b.Append(' ', pad); b.AppendLine("public byte[" + f.ArrayLength + "] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { _" + f.GetFieldName() + " = value; } }");
//throw new NotImplementedException();
}
public virtual void GenerateFixedArrayEncodeBitBuffer(StringBuilder b, int pad, FieldDescriptor f, string bitBufferName)
{
b.Append(' ', pad); b.AppendLine("public byte[" + f.ArrayLength + "] _" + f.GetFieldName() + ";");
b.Append(' ', pad); b.AppendLine("public byte[" + f.ArrayLength + "] " + f.GetFieldName() + " { get { return _" + f.GetFieldName() + "; } set { _" + f.GetFieldName() + " = value; } }");
//throw new NotImplementedException();
}

}

Expand Down
92 changes: 82 additions & 10 deletions src/tools/GameServer/TypeExtractor/D3TypeDump/TypeDump.cs
Expand Up @@ -209,16 +209,82 @@ class TypeDump
#endregion

#region build 10057 addresses
const int OpcodeSwitch_Address = 0x008E6240;
const int TypeDescriptorsAddress = 0x0159A19C;
//const int OpcodeSwitch_Address = 0x008E6240;
//const int TypeDescriptorsAddress = 0x0159A19C;
//const int TypeDescriptorsOffset = 40;
//const int AttributesAddress = 0x0157D518;
//const int AttributeCount = 826;
//const int Attribute_Int = 0x01373660;
//const int Attribute_IntMinMax = 0x01373668;
//const int Attribute_FloatMinMax = 0x01373670;
//const int Attribute_Float16 = 0x01373678;
//const int Attribute_Float16Or32 = 0x01373680;
#endregion

#region build 1.0.3.10485 addresses
//const int OpcodeSwitch_Address = 0x008F8740;
//const int TypeDescriptorsAddress = 0x0159A194;
//const int TypeDescriptorsOffset = 40;
//const int AttributesAddress = 0x0157D518;
//const int AttributeCount = 826;
//const int Attribute_Int = 0x1373F00;
//const int Attribute_IntMinMax = 0x1373F08;
//const int Attribute_FloatMinMax = 0x1373F10;
//const int Attribute_Float16 = 0x1373F18;
//const int Attribute_Float16Or32 = 0x1373F20;
#endregion

#region build 1.0.4.11327 addresses
//const int OpcodeSwitch_Address = 0x008F9CD0;
//const int TypeDescriptorsAddress = 0x0153D574;
//const int TypeDescriptorsOffset = 40;
//const int AttributesAddress = 0x01520518;
//const int AttributeCount = 847;
//const int Attribute_Int = 0x131E70C;
//const int Attribute_IntMinMax = 0x131E714;
//const int Attribute_FloatMinMax = 0x131E71C;
//const int Attribute_Float16 = 0x131E724;
//const int Attribute_Float16Or32 = 0x131E72C;
#endregion

#region build 1.0.5.12811 addresses
//const int OpcodeSwitch_Address = 0x00F136F0;
//const int TypeDescriptorsAddress = 0x0169CC10;
//const int TypeDescriptorsOffset = 40;
//const int AttributesAddress = 0x0168D778;
//const int AttributeCount = 878;
//const int Attribute_Int = 0x14C3D64;
//const int Attribute_IntMinMax = 0x14C3D70;
//const int Attribute_FloatMinMax = 0x14C3D7C;
//const int Attribute_Float16 = 0x14C3D88;
//const int Attribute_Float16Or32 = 0x14C3D94;
#endregion

#region build 106133 addresses
//const int OpcodeSwitch_Address = 0x00F16A90;
//const int TypeDescriptorsAddress = 0x0169FC48;
//const int TypeDescriptorsOffset = 40;
//const int AttributesAddress = 0x01690788;
//const int AttributeCount = 878;
//const int Attribute_Int = 0x14C70F4;
//const int Attribute_IntMinMax = 0x14C7100;
//const int Attribute_FloatMinMax = 0x14C710C;
//const int Attribute_Float16 = 0x14C7118;
//const int Attribute_Float16Or32 = 0x14C7124;
#endregion

#region build 1.0.8.16603 addresses
const int OpcodeSwitch_Address = 0x00FE9520;
const int TypeDescriptorsAddress = 0x016F4480;
const int TypeDescriptorsOffset = 40;
const int AttributesAddress = 0x0157D518;
const int AttributeCount = 826;
const int Attribute_Int = 0x01373660;
const int Attribute_IntMinMax = 0x01373668;
const int Attribute_FloatMinMax = 0x01373670;
const int Attribute_Float16 = 0x01373678;
const int Attribute_Float16Or32 = 0x01373680;
const int AttributesAddress = 0x016E4BF8;
const int AttributeCount = 895;
const int Attribute_Null = 0x0;
const int Attribute_Int = 0x15149F4;
const int Attribute_IntMinMax = 0x1514A00;
const int Attribute_FloatMinMax = 0x1514A0C;
const int Attribute_Float16 = 0x1514A18;
const int Attribute_Float16Or32 = 0x1514A24;
#endregion

class GameMessageInfo
Expand Down Expand Up @@ -404,6 +470,11 @@ static void DumpAttributes(Mem32 mem)
byte u10 = attrib[36].Byte;
switch (decoder.Int32)
{
case Attribute_Null:
{
NetAttribute.Attributes[id] = new NetAttribute(id, u2, u3, u4, u5, scriptA, scriptB, name, NetAttributeEncoding.Null, u10, 0, 0, 0);
}
break;
case Attribute_Int:
{
int bitCount = decoder[12].Int32;
Expand Down Expand Up @@ -435,7 +506,8 @@ static void DumpAttributes(Mem32 mem)
case Attribute_FloatMinMax: // DecodeFloatMinMax
throw new Exception("FloatMinMax used");
default:
throw new Exception("Unknown decoder used");
//continue;
throw new Exception("Unknown decoder used " + decoder.Int32);
}
}
NetAttribute.SaveXml("attributes.xml");
Expand Down

0 comments on commit d2acdbe

Please sign in to comment.