Skip to content

Commit eb91a85

Browse files
committed
chore: Update Copyright info
1 parent 3bdb14b commit eb91a85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3172
-3108
lines changed

Assets/WzLib/Scripts/Helpers/ErrorLogger.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -20,8 +20,6 @@
2020
using System;
2121
using System.Collections.Generic;
2222
using System.IO;
23-
using System.Linq;
24-
using System.Text;
2523

2624
namespace MapleLib.Helpers
2725
{
@@ -48,7 +46,7 @@ public static void SaveToFile(string filename)
4846
using (StreamWriter sw = new StreamWriter(File.Open(filename, FileMode.Append, FileAccess.Write, FileShare.Read)))
4947
{
5048
sw.WriteLine("Starting error log on " + DateTime.Today.ToShortDateString());
51-
foreach (Error e in errorList)
49+
foreach (Error e in errorList)
5250
{
5351
sw.WriteLine(e.level.ToString() + ":" + e.message);
5452
}
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -24,80 +24,80 @@
2424
namespace MapleLib.MapleCryptoLib
2525
{
2626

27-
/// <summary>
28-
/// Class to handle the AES Encryption routines
29-
/// </summary>
30-
public class AESEncryption
31-
{
27+
/// <summary>
28+
/// Class to handle the AES Encryption routines
29+
/// </summary>
30+
public class AESEncryption
31+
{
3232

33-
/// <summary>
34-
/// Encrypt data using MapleStory's AES algorithm
35-
/// </summary>
36-
/// <param name="IV">IV to use for encryption</param>
37-
/// <param name="data">Data to encrypt</param>
38-
/// <param name="length">Length of data</param>
39-
/// <returns>Crypted data</returns>
40-
public static byte[] aesCrypt(byte[] IV, byte[] data, int length)
41-
{
42-
return aesCrypt(IV, data, length, CryptoConstants.getTrimmedUserKey());
43-
}
33+
/// <summary>
34+
/// Encrypt data using MapleStory's AES algorithm
35+
/// </summary>
36+
/// <param name="IV">IV to use for encryption</param>
37+
/// <param name="data">Data to encrypt</param>
38+
/// <param name="length">Length of data</param>
39+
/// <returns>Crypted data</returns>
40+
public static byte[] aesCrypt(byte[] IV, byte[] data, int length)
41+
{
42+
return aesCrypt(IV, data, length, CryptoConstants.getTrimmedUserKey());
43+
}
4444

45-
/// <summary>
46-
/// Encrypt data using MapleStory's AES method
47-
/// </summary>
48-
/// <param name="IV">IV to use for encryption</param>
49-
/// <param name="data">data to encrypt</param>
50-
/// <param name="length">length of data</param>
51-
/// <param name="key">the AES key to use</param>
52-
/// <returns>Crypted data</returns>
53-
public static byte[] aesCrypt(byte[] IV, byte[] data, int length, byte[] key)
54-
{
55-
AesManaged crypto = new AesManaged();
56-
crypto.KeySize = 256; //in bits
57-
crypto.Key = key;
58-
crypto.Mode = CipherMode.ECB; // Should be OFB, but this works too
45+
/// <summary>
46+
/// Encrypt data using MapleStory's AES method
47+
/// </summary>
48+
/// <param name="IV">IV to use for encryption</param>
49+
/// <param name="data">data to encrypt</param>
50+
/// <param name="length">length of data</param>
51+
/// <param name="key">the AES key to use</param>
52+
/// <returns>Crypted data</returns>
53+
public static byte[] aesCrypt(byte[] IV, byte[] data, int length, byte[] key)
54+
{
55+
AesManaged crypto = new AesManaged();
56+
crypto.KeySize = 256; //in bits
57+
crypto.Key = key;
58+
crypto.Mode = CipherMode.ECB; // Should be OFB, but this works too
5959

60-
MemoryStream memStream = new MemoryStream();
61-
CryptoStream cryptoStream = new CryptoStream(memStream, crypto.CreateEncryptor(), CryptoStreamMode.Write);
60+
MemoryStream memStream = new MemoryStream();
61+
CryptoStream cryptoStream = new CryptoStream(memStream, crypto.CreateEncryptor(), CryptoStreamMode.Write);
6262

63-
int remaining = length;
64-
int llength = 0x5B0;
65-
int start = 0;
66-
while (remaining > 0)
67-
{
68-
byte[] myIV = MapleCrypto.multiplyBytes(IV, 4, 4);
69-
if (remaining < llength)
70-
{
71-
llength = remaining;
72-
}
73-
for (int x = start; x < (start + llength); x++)
74-
{
75-
if ((x - start) % myIV.Length == 0)
76-
{
77-
cryptoStream.Write(myIV, 0, myIV.Length);
78-
byte[] newIV = memStream.ToArray();
79-
Array.Copy(newIV, myIV, myIV.Length);
80-
memStream.Position = 0;
81-
}
82-
data[x] ^= myIV[(x - start) % myIV.Length];
83-
}
84-
start += llength;
85-
remaining -= llength;
86-
llength = 0x5B4;
87-
}
63+
int remaining = length;
64+
int llength = 0x5B0;
65+
int start = 0;
66+
while (remaining > 0)
67+
{
68+
byte[] myIV = MapleCrypto.multiplyBytes(IV, 4, 4);
69+
if (remaining < llength)
70+
{
71+
llength = remaining;
72+
}
73+
for (int x = start; x < (start + llength); x++)
74+
{
75+
if ((x - start) % myIV.Length == 0)
76+
{
77+
cryptoStream.Write(myIV, 0, myIV.Length);
78+
byte[] newIV = memStream.ToArray();
79+
Array.Copy(newIV, myIV, myIV.Length);
80+
memStream.Position = 0;
81+
}
82+
data[x] ^= myIV[(x - start) % myIV.Length];
83+
}
84+
start += llength;
85+
remaining -= llength;
86+
llength = 0x5B4;
87+
}
8888

89-
try
90-
{
91-
cryptoStream.Dispose();
92-
memStream.Dispose();
93-
}
94-
catch (Exception e)
95-
{
89+
try
90+
{
91+
cryptoStream.Dispose();
92+
memStream.Dispose();
93+
}
94+
catch (Exception e)
95+
{
9696
Helpers.ErrorLogger.Log(Helpers.ErrorLevel.Critical, "Error disposing AES streams" + e);
97-
//Console.WriteLine("Error disposing AES streams" + e);
98-
}
97+
//Console.WriteLine("Error disposing AES streams" + e);
98+
}
9999

100-
return data;
101-
}
102-
}
100+
return data;
101+
}
102+
}
103103
}
Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -19,16 +19,16 @@
1919

2020
namespace MapleLib.MapleCryptoLib
2121
{
22-
/// <summary>
23-
/// Contains all the constant values used for various functions
24-
/// </summary>
25-
public class CryptoConstants
26-
{
22+
/// <summary>
23+
/// Contains all the constant values used for various functions
24+
/// </summary>
25+
public class CryptoConstants
26+
{
2727

28-
/// <summary>
29-
/// AES UserKey used by MapleStory
30-
/// </summary>
31-
public static byte[] UserKey = new byte[128] { //16 * 8
28+
/// <summary>
29+
/// AES UserKey used by MapleStory
30+
/// </summary>
31+
public static byte[] UserKey = new byte[128] { //16 * 8
3232
0x13, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x5B, 0x00, 0x00, 0x00,
3333
0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
3434
0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00,
@@ -39,10 +39,10 @@ public class CryptoConstants
3939
0x52, 0x00, 0x00, 0x00, 0xDE, 0x00, 0x00, 0x00, 0xC7, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00
4040
};
4141

42-
/// <summary>
43-
/// ShuffleBytes used by MapleStory to generate a new IV
44-
/// </summary>
45-
public static byte[] bShuffle = new byte[256] {//16 * 16
42+
/// <summary>
43+
/// ShuffleBytes used by MapleStory to generate a new IV
44+
/// </summary>
45+
public static byte[] bShuffle = new byte[256] {//16 * 16
4646
0xEC, 0x3F, 0x77, 0xA4, 0x45, 0xD0, 0x71, 0xBF, 0xB7, 0x98, 0x20, 0xFC, 0x4B, 0xE9, 0xB3, 0xE1,
4747
0x5C, 0x22, 0xF7, 0x0C, 0x44, 0x1B, 0x81, 0xBD, 0x63, 0x8D, 0xD4, 0xC3, 0xF2, 0x10, 0x19, 0xE0,
4848
0xFB, 0xA1, 0x6E, 0x66, 0xEA, 0xAE, 0xD6, 0xCE, 0x06, 0x18, 0x4E, 0xEB, 0x78, 0x95, 0xDB, 0xBA,
@@ -61,39 +61,39 @@ public class CryptoConstants
6161
0x84, 0x7F, 0x61, 0x1E, 0xCF, 0xC5, 0xD1, 0x56, 0x3D, 0xCA, 0xF4, 0x05, 0xC6, 0xE5, 0x08, 0x49
6262
};
6363

64-
/// <summary>
65-
/// Default AES Key used to generate a new IV
66-
/// </summary>
67-
public static byte[] bDefaultAESKeyValue = new byte[16] {
64+
/// <summary>
65+
/// Default AES Key used to generate a new IV
66+
/// </summary>
67+
public static byte[] bDefaultAESKeyValue = new byte[16] {
6868
0xC6, 0x50, 0x53, 0xF2, 0xA8, 0x42, 0x9D, 0x7F, 0x77, 0x09, 0x1D, 0x26, 0x42, 0x53, 0x88, 0x7C,
6969
};
7070

71-
/// <summary>
72-
/// IV used to create the WzKey for GMS
73-
/// </summary>
74-
public static byte[] WZ_GMSIV = new byte[4] { 0x4D, 0x23, 0xC7, 0x2B };
71+
/// <summary>
72+
/// IV used to create the WzKey for GMS
73+
/// </summary>
74+
public static byte[] WZ_GMSIV = new byte[4] { 0x4D, 0x23, 0xC7, 0x2B };
7575

76-
/// <summary>
77-
/// IV used to create the WzKey for MSEA
78-
/// </summary>
79-
public static byte[] WZ_MSEAIV = new byte[4] { 0xB9, 0x7D, 0x63, 0xE9 };
76+
/// <summary>
77+
/// IV used to create the WzKey for MSEA
78+
/// </summary>
79+
public static byte[] WZ_MSEAIV = new byte[4] { 0xB9, 0x7D, 0x63, 0xE9 };
8080

81-
/// <summary>
82-
/// Constant used in WZ offset encryption
83-
/// </summary>
84-
public static uint WZ_OffsetConstant = 0x581C3F6D;
81+
/// <summary>
82+
/// Constant used in WZ offset encryption
83+
/// </summary>
84+
public static uint WZ_OffsetConstant = 0x581C3F6D;
8585

86-
/// <summary>
87-
/// Trims the AES UserKey for use an AES cryptor
88-
/// </summary>
89-
public static byte[] getTrimmedUserKey()
90-
{
91-
byte[] key = new byte[32];
92-
for (int i = 0; i < 128; i += 16)
93-
{
94-
key[i / 4] = UserKey[i];
95-
}
96-
return key;
97-
}
98-
}
86+
/// <summary>
87+
/// Trims the AES UserKey for use an AES cryptor
88+
/// </summary>
89+
public static byte[] getTrimmedUserKey()
90+
{
91+
byte[] key = new byte[32];
92+
for (int i = 0; i < 128; i += 16)
93+
{
94+
key[i / 4] = UserKey[i];
95+
}
96+
return key;
97+
}
98+
}
9999
}

Assets/WzLib/Scripts/MapleCryptoLib/MapleCrypto.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

Assets/WzLib/Scripts/MapleCryptoLib/MapleCustomEncryption.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* MapleLib - A general-purpose MapleStory library
22
*
33
* Copyright (C) 2009-2015 Snow and haha01haha01
4-
* Copyright (C) 2021-2024 Jen-Chieh Shen
4+
* Copyright (C) 2021-2025 Jen-Chieh Shen
55
*
66
* This program is free software: you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -17,20 +17,17 @@
1717
* along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
*/
1919

20-
using System;
2120
using System.Collections.Generic;
22-
using System.Linq;
23-
using System.Text;
2421

2522
namespace MapleLib.WzLib
2623
{
27-
public interface IPropertyContainer
28-
{
29-
void AddProperty(WzImageProperty prop);
30-
void AddProperties(List<WzImageProperty> props);
31-
void RemoveProperty(WzImageProperty prop);
32-
void ClearProperties();
24+
public interface IPropertyContainer
25+
{
26+
void AddProperty(WzImageProperty prop);
27+
void AddProperties(List<WzImageProperty> props);
28+
void RemoveProperty(WzImageProperty prop);
29+
void ClearProperties();
3330
List<WzImageProperty> WzProperties { get; }
3431
WzImageProperty this[string name] { get; set; }
35-
}
32+
}
3633
}

0 commit comments

Comments
 (0)