-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathUtils.cs
45 lines (44 loc) · 1.22 KB
/
Utils.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace Ether_IL2CPP
{
public class Utils
{
public static byte[] addBytes(byte[] data1, byte[] data2)
{
byte[] data3 = new byte[data1.Length + data2.Length];
data1.CopyTo(data3, 0);
data2.CopyTo(data3, data1.Length);
return data3;
}
public static byte[] StreamToBytes(Stream stream)
{
byte[] bytes = new byte[stream.Length];
stream.Read(bytes, 0, bytes.Length);
stream.Seek(0, SeekOrigin.Begin);
return bytes;
}
public static int CheckNull(int Checker)
{
for(byte i = byte.MinValue; i < byte.MaxValue;i++)
{
if ((byte)(i ^ Checker) == 0x00)
{
return i;
}
}
return 0x100;
}
public static string DownloadText(string url)
{
WebClient webClient = new WebClient();
webClient.Encoding= Encoding.UTF8;
return webClient.DownloadString(url);
}
}
}