Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::ifstream ifs;
- ifs.open("ex1.o", std::ios::binary|std::ios::in);
- for (int i = 0; i < EI_NIDENT; i++)
- {
- ifs >> ehdr.e_ident[i];
- }
- ifs >> ehdr.e_type;
- ifs >> ehdr.e_machine;
- ifs >> ehdr.e_version;
- ifs >> ehdr.e_entry;
- ifs >> ehdr.e_phoff;
- ifs >> ehdr.e_shoff;
- ifs >> ehdr.e_flags;
- ifs >> ehdr.e_ehsize;
- ifs >> ehdr.e_phentsize;
- ifs >> ehdr.e_phnum;
- ifs >> ehdr.e_shentsize;
- ifs >> ehdr.e_shnum;
- ifs >> ehdr.e_shstrndx;
- return 0;
Add Comment
Please, Sign In to add comment