-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOffsetFinder.cs
57 lines (42 loc) · 1.31 KB
/
OffsetFinder.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
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Text;
namespace ashr.net.hacktools
{
public class OffsetFinder
{
public OffsetFinder (){}
static char currentFirst = 'Z';
static char currentSecond ='z';
static int currentThird = 9;
private static string getNextNumber(){
char incCurrentFirst = currentFirst;//(char)((int)currentFirst + 1);
char incCurrentSecond = currentSecond;//(char)((int)currentSecond + 1);
int incCurrentThird = ++currentThird;
if (incCurrentThird > 9) {
incCurrentThird = 0;
incCurrentSecond = (char)((int)currentSecond + 1);
if (((int)incCurrentSecond) > ((int)'z')) {
incCurrentSecond = 'a';
incCurrentFirst = (char)((int)currentFirst + 1);
if (((int)incCurrentFirst) > ((int)'Z')) {
incCurrentFirst = 'A';
}
}
}
currentFirst = incCurrentFirst;
currentSecond = incCurrentSecond;
currentThird = incCurrentThird;
return incCurrentFirst.ToString() + incCurrentSecond.ToString() + incCurrentThird.ToString ();
}
public string GeneratePattern(int Length){
StringBuilder output = new StringBuilder ();
while (output.Length < Length) {
output.Append (getNextNumber ());
}
return (output.ToString ().Substring(0,Length));
}
public int FindOffset(string Pattern, int Length){
throw new NotImplementedException ();
}
}
}