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

Can't get method header size #48

Closed
mazegen opened this issue Oct 19, 2015 · 2 comments
Closed

Can't get method header size #48

mazegen opened this issue Oct 19, 2015 · 2 comments

Comments

@mazegen
Copy link

mazegen commented Oct 19, 2015

I can check if method has fat header using MethodBody.isTiny but I can't get the fat header size. It is usually 12 bytes but IIRC it is variable. It would be nice if dnlib can compute the size for me.

@0xd4d
Copy link
Collaborator

0xd4d commented Oct 19, 2015

Reader: CilBody.HeaderSize: https://github.com/0xd4d/dnlib/blob/master/src/DotNet/Emit/MethodBody.cs#L89

But you seem to be talking about the writer's MethodBody class. It doesn't have a header size because it only writes 12-byte fat headers. You can safely assume that the fat header that the method body writer writes is 12 bytes. https://github.com/0xd4d/dnlib/blob/master/src/DotNet/Writer/MethodBodyWriter.cs#L126

@mazegen
Copy link
Author

mazegen commented Oct 19, 2015

Thank you. I've checked ECMA-335 again and the fat header size is fixed to 12-bytes.

@mazegen mazegen closed this as completed Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant