I know how to load a file in memory but in java how can i define a structure to a memory address?
What I am trying to do is parse a PE (PORTABLE EXECUTABLE) file header. How can I do that without external libs.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understand what you want you are trying to read the PE file, but you don’t have any machine readable definitions of the file. In Java you can’t really have a class that just maps to arbitrary memory, so you will have to just make a bunch of constants with the offsets and sizes of the data in the header. And then you can make some class that will use these constants to return the correct bytes corresponding to what you want.