Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to GetContent() of a ImportAddressTable causes overflow exception #2

Closed
philipbraatz opened this issue Nov 27, 2019 · 5 comments
Assignees
Labels

Comments

@philipbraatz
Copy link

philipbraatz commented Nov 27, 2019

System.OverflowException: 'Value was either too large or too small for a UInt32.'
at System.Convert.ToUInt32(UInt64 value)
at Workshell.PE.LocationCalculator.VAToOffset(UInt64 va)
at Workshell.PE.DataDirectory.d__10.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Workshell.PE.DataDirectory.GetContent()
at Doorfail.Reverse.BL.Utility.d__1.MoveNext() in C:\Users\philb\source\repos\Doorfail.Reverse.UI.Console\BL\Utility.cs:line 55

foreach (var item in pe.NTHeaders.DataDirectories) { if (!item.IsEmpty) { Console.WriteLine(pe.NTHeaders + "Data Directory, Directory Type: " + item.DirectoryType + ", size " + item.Size); Console.WriteLine("Content DataDirectory, Directory Type: "+item.GetContent());//line 55 Console.WriteLine("Section Name: " + item.GetSection().Name); Console.WriteLine("Sections: " + item.GetSection().Sections); Console.WriteLine("Sections: " + item.GetSection().TableEntry); } }

@lkinsella
Copy link
Contributor

Curious.

If you switch to the pei-changes branch do you still have the same issue?

@philipbraatz
Copy link
Author

I have it installed through NuGet Package Manager in Visual Studio. version 2.1.0.47 . From there I don't see a way of doing that.

@lkinsella
Copy link
Contributor

Ahh no worries thought you might be working from source.

I’ll look into it, could be we’ve already fixed it there’s a bunch of changes in that branch.

Do you know what the value is at all? Would be useful for testing.

@philipbraatz
Copy link
Author

philipbraatz commented Nov 28, 2019

I am unable to check the value for you, sorry. This is the file I am testing with though.
TestScript2.zip

@lkinsella lkinsella added the bug label Nov 28, 2019
@lkinsella lkinsella self-assigned this Nov 28, 2019
lkinsella added a commit that referenced this issue Nov 28, 2019
lkinsella added a commit that referenced this issue Nov 28, 2019
#2: Fixed issue with default directory type handler
@lkinsella
Copy link
Contributor

This should be fixed now, turns out it was using the VA when it should have been using RVA.

It should be available on NuGet as version 2.1.1.53.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants