Apoc, this is very well written although, because I'm anal, I've located a few functions you can safely convert to LINQ, the bottom function I just added in the ?? operator.
Code:
private static bool DataCompare(byte[] data, int offset, byte[] byteMask, string mask)
{
// Only check for 'x' mismatches. As we'll assume anything else is a wildcard.
return !mask.Where((t, i) => t == 'x' && byteMask[i] != data[i + offset]).Any();
}
Code:
public T Read<T>(params IntPtr[] addresses)
{
return Read<T>(addresses.Select(ptr => (ADDR) ptr.ToInt32()).ToArray());
}
Code:
public static Magic Instance
{
get { return _instance ?? (_instance = new Magic()); }
}
Don't mean to nit-pick here.
--Formerly known as "Bind"