Dewera / Lunar

A lightweight native DLL mapping library that supports mapping directly from memory
MIT License
585 stars 102 forks source link

Out of the range of valid values. (Parameter 'length') -> GetRelocations() #21

Closed CrispCrew closed 3 years ago

CrispCrew commented 3 years ago

Unhandled exception. System.AggregateException: One or more errors occurred. (Specified argument was out of the range of valid values. (Parameter 'length')) ---> System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'length') at Lunar.PortableExecutable.DataDirectories.RelocationDirectory.GetRelocations()+MoveNext() in C:\Users\James\Downloads\Lunar-master\Lunar\PortableExecutable\DataDirectories\RelocationDirectory.cs:line 29 at System.Collections.Concurrent.Partitioner.DynamicPartitionerForIEnumerable1.InternalPartitionEnumerable.GrabChunk_Buffered(KeyValuePair2[] destArray, Int32 requestedChunkSize, Int32& actualNumElementsGrabbed) at System.Collections.Concurrent.Partitioner.DynamicPartitionerForIEnumerable1.InternalPartitionEnumerator.GrabNextChunk(Int32 requestedChunkSize) at System.Collections.Concurrent.Partitioner.DynamicPartitionEnumerator_Abstract2.MoveNext() at System.Threading.Tasks.Parallel.<>cDisplayClass44_02.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.<>c__DisplayClass44_02.b1(IEnumerator& partitionState, Int32 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica1.ExecuteAction(Boolean& yieldedBeforeCompletion) at System.Threading.Tasks.TaskReplicator.Replica.Execute() --- End of inner exception stack trace --- at System.Threading.Tasks.TaskReplicator.Run[TState](ReplicatableUserAction1 action, ParallelOptions options, Boolean stopOnFirstFailure) at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner1 source, ParallelOptions parallelOptions, Action1 simpleBody, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) --- End of stack trace from previous location --- at System.Threading.Tasks.Parallel.ThrowSingleCancellationExceptionOrOtherException(ICollection exceptions, CancellationToken cancelToken, Exception otherException) at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner1 source, ParallelOptions parallelOptions, Action1 simpleBody, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable1 source, ParallelOptions parallelOptions, Action1 body, Action2 bodyWithState, Action3 bodyWithStateAndIndex, Func4 bodyWithStateAndLocal, Func5 bodyWithEverything, Func1 localInit, Action1 localFinally) at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable1 source, Action1 body) at Lunar.LibraryMapper.RelocateImage() in C:\Users\James\Downloads\Lunar-master\Lunar\LibraryMapper.cs:line 633 at Lunar.LibraryMapper.MapLibrary() in C:\Users\James\Downloads\Lunar-master\Lunar\LibraryMapper.cs:line 126 at InjectorV2.Program.Main(String[] args) in C:\Users\James\Downloads\InjectorV2 (1)\InjectorV2\Program.cs:line 51

Dewera commented 3 years ago

Any chance I can get a copy of the DLL you are trying to map? I think this is by product of a compiler optimisation to the relocation directory that I came across a while back but couldn't replicate it after I lost the file (and so couldn't fix/test.)

If so, Quin#4576 on discord

CrispCrew commented 3 years ago

I added you