Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix uncaught exception when trying to retrieve negative addresses#3

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
KN4CK3R merged 4 commits intoReClassNET:masterfromTETYYS:TETYYS-patch-1
Dec 7, 2018

Conversation

@TETYYS
Copy link
Contributor

No description provided.

@KN4CK3R
Copy link
Member

KN4CK3R commentedDec 7, 2018
edited
Loading

Did you test a negative address intentional or how did you get this exception? Your patch doesn't fix the problem. Now you can't access offsets greater than int.MaxValue (2GB). I'm a little bit shocked that y and z are both negative...

var x = new IntPtr(-1);var y = x.ToInt32();var z = x.ToInt64();

I expected z to show a large number instead of -1.

@TETYYS
Copy link
ContributorAuthor

TETYYS commentedDec 7, 2018
edited
Loading

I think I got the exception when the program tried to construct a BaseHexCommentNode, presumably dereferencing an address, my file is exactly 2,147,516,415 bytes in size.

@TETYYS
Copy link
ContributorAuthor

I think the problem with this is that when pointer in IntPtr is 0x8000_0000, the ToInt64() operation does not cast bit-wise, resulting in same negative value

@TETYYS
Copy link
ContributorAuthor

I think this should work. The plugin fails to read valid bytes if you try to read after the file, but that's a different issue, I think I saw 64 byte blocks hardcoded somewhere, this might be related to that.


returntrue;
}
using(varstream=info.File.CreateViewStream(address.ToInt64(),size))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Now you are missing the addressInt64 here.

@TETYYS
Copy link
ContributorAuthor

There are some places in C# library methods I really wish that would just accept or provideunsigned values.

@KN4CK3R
Copy link
Member

I will add a new extension method for IntPtr in the ReClass.NET project to make the logic reusable.

@KN4CK3RKN4CK3R merged commitd80c8fe intoReClassNET:masterDec 7, 2018
KN4CK3R added a commit that referenced this pull requestDec 14, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@KN4CK3RKN4CK3RKN4CK3R left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@TETYYS@KN4CK3R

[8]ページ先頭

©2009-2025 Movatter.jp