forked from njames93/GTA-V-Script-Decompiler
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
user
committed
Oct 16, 2022
1 parent
d0f230c
commit 89f70da
Showing
18 changed files
with
116 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.IO; | ||
|
||
namespace Decompiler | ||
{ | ||
internal class Crossmap | ||
{ | ||
public Dictionary<ulong, ulong> TranslationTable = new(); | ||
|
||
public ulong TranslateHash(ulong hash) | ||
{ | ||
TranslationTable.TryGetValue(hash, out hash); | ||
return hash; | ||
} | ||
|
||
public Crossmap() | ||
: base() | ||
{ | ||
StreamReader sr; | ||
sr = new StreamReader(new MemoryStream(Properties.Resources.CrossmapFile)); | ||
|
||
while (!sr.EndOfStream) | ||
{ | ||
var line = sr.ReadLine(); | ||
if (line.Length > 1) | ||
{ | ||
var val = line.Remove(line.IndexOfAny(new char[] { ':', '=', ',' })); | ||
var nat = line[(val.Length + 1)..]; | ||
|
||
if (val.StartsWith("0x")) | ||
val = val[2..]; | ||
|
||
if (nat.StartsWith("0x")) | ||
nat = nat[2..]; | ||
|
||
if (ulong.TryParse(val.Trim(), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var newer)) | ||
{ | ||
if (ulong.TryParse(nat.Trim(), NumberStyles.HexNumber, CultureInfo.InvariantCulture, out var older)) | ||
{ | ||
TranslationTable.Add(newer, older); | ||
} | ||
} | ||
} | ||
} | ||
|
||
sr.Close(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.