4083Fermer4085
WarptenLe 23/11/2014 à 16:44
J'ai honte de généréer un dictionnaire de clefs Mifare Classic. Juste pour pouvoir modifier ma carte de fac ( y a mon crédit dedans grin ) C'est pas comme si on s'étalait sur 6 bytes....

using System; using System.Threading.Tasks; using System.IO; namespace MifareDict { class Program { public static void Main(string[] args) { StreamWriter output = new StreamWriter(new FileStream("./output2.txt", FileMode.Create)); // Keys are 6 bytes wide. Parallel.For(0x100000000000, 0xFFFFFFFFFFFF, i => { Console.WriteLine("{0:X12}", i); output.WriteLine("{0:X12}", i); }); } } }

[EDIT] Ah bah tiens grin
Exception non gérée : System.AggregateException: Une ou plusieurs erreurs se sont produites. ---> System.IndexOutOfRange
Exception: Condition de concurrence critique d'E/S probable détectée lors de la copie dans la mémoire. Le package d'E/S
n'est pas thread-safe par défaut. Dans des applications multithread, l'accès au flux doit se faire de façon thread-safe,
par exemple un wrapper thread-safe retourné par les méthodes Synchronized de TextReader ou TextWriter. Cela s'applique
également aux classes telles que StreamWriter et StreamReader.
à System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array dst, Int32 dstOffsetBytes, Int32 byteCount)
à System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count)
à System.IO.TextWriter.WriteLine(String value)
à System.IO.TextWriter.WriteLine(String format, Object arg0)
à MifareDict.Program.<>c__DisplayClass1.<Main>b__0(Int64 i) dans c:\SharpDevelop Projects\Mif
areDict\MifareDict\Program.cs:ligne 16
à System.Threading.Tasks.Parallel.<>c__DisplayClass15`1.<ForWorker64>b__12()
à System.Threading.Tasks.Task.InnerInvoke()
à System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
à System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
--- Fin de la trace de la pile d'exception interne ---
à System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
à System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
à System.Threading.Tasks.Task.Wait()
à System.Threading.Tasks.Parallel.ForWorker64[TLocal](Int64 fromInclusive, Int64 toExclusive, ParallelOptions paralle
lOptions, Action`1 body, Action`2 bodyWithState, Func`4 bodyWithLocal, Func`1 localInit, Action`1 localFinally)
à System.Threading.Tasks.Parallel.For(Int64 fromInclusive, Int64 toExclusive, Action`1 body)
à MifareDict.Program.Main(String[] args) dans c:\SharpDevelop Projects\MifareDict\MifareDict Program.cs:ligne 14

Surprenant que ça ne soit pas arrivé plus tôt (240Mo le dictionnaire là).