It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have a task of searching for opcode bytes in a PE file and checking whether a specified opcode byte sequence (constant and predefined) is present in the PE file. I have come across numerous examples online, but the solutions are mostly in C# or Python; however, my requirements are based in C language.
Please tell me how can I check and compare opcode byte values in a PE file by writing a simple program in C. Any help will be greatly appreciated.
Thanks.
You may take a look at ROPGadget or at rp, both software contain code that do what you want (and more).
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm trying to get the size of a file from the commandline in C using argv. I'm not too familiar with file i/o in C, so any pointers would be greatly appreciated. Thanks.
You've not stated the platform, but your C program is given an argument list when it is started, and the file names are strings. The POSIX function you'd probably use is stat(); it takes a pointer to a struct stat and will put the file's size into the st_size member of the structure.
The answer may be different on Windows; the POSIX subsystem will provide a stat() workalike (probably named _stat()), but there'll also be a native interface.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How to delete a specific data from binary file. Please example, thanks :)
Binary files have no lines, but to delete any block of data from any file you just need to write the data after this block starting at this block beginning and truncate the tail.
EDIT: to delete specific data you have to find the data and then read the first paragraph again :)
Binary data could have various types of structure, but not 'lines'. A priori, I recommend that you use some established library designed for however your data is formatted be it binary XML, Berkeley DB, whatever.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
for sending variables to procedures what we should do in c and(or) pascal?
as i searched this work has to be done by BP( base pointer)
or rather i should say that BP do it,and one more thing is that C and Pascal are opposite of each other.
You question is entirely unclear. It would appear that you might be asking about C and Pascal calling conventions on the x86 architecture (at least your mention of BP hints at this).
If that's the case, I'd recommend you study the Wikipedia page on x86 calling conventions, and come back when you have specific questions.
edit You might also want to check out X86 Assembly/High-Level Languages along with the "Further Reading" links therein.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to read an image(JPEG) file from hard disk to memory. How can I do this? What kind of variable type should I use ?
Use a big char array
char data[4096]
And fread(3) chunks into it. Of course an entire JPEG won't fit in 4096 bytes, but perhaps you can work with chunks instead of the entire file ?
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
what's the logic behind the calculator widget. i want to build it in gtk+.
First, don't listen to anyone who says that this is trivial.
Second, I'm going to assume that you really mean something like "How do I convert the user input to an internal expression structure which I can use to calculate the answer?". Well, Wikipedia has a good article (here) on converting infix (human readable) notation, which is what most modern calculators use (e.g you can write 1 + 2 instead of + 1 2), to the more computer appropriate polish (prefix) notation.
Third, if you don't know GTK+ yet, start here.
Hope this helps.