Guest User

Untitled

a guest
May 26th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. std::ifstream ifs;
  2.  
  3. ifs.open("ex1.o", std::ios::binary|std::ios::in);
  4.  
  5. for (int i = 0; i < EI_NIDENT; i++)
  6. {
  7. ifs >> ehdr.e_ident[i];
  8. }
  9.  
  10. ifs >> ehdr.e_type;
  11. ifs >> ehdr.e_machine;
  12. ifs >> ehdr.e_version;
  13. ifs >> ehdr.e_entry;
  14. ifs >> ehdr.e_phoff;
  15. ifs >> ehdr.e_shoff;
  16. ifs >> ehdr.e_flags;
  17. ifs >> ehdr.e_ehsize;
  18. ifs >> ehdr.e_phentsize;
  19. ifs >> ehdr.e_phnum;
  20. ifs >> ehdr.e_shentsize;
  21. ifs >> ehdr.e_shnum;
  22. ifs >> ehdr.e_shstrndx;
  23.  
  24. return 0;
Add Comment
Please, Sign In to add comment