(C) Relatively high density file backups on paper. Cross-platform CLI port of Ollydbg's Paperback from Windows and Borland C.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Fileproc.h 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * =====================================================================================
  3. *
  4. * Filename: Fileproc.h
  5. *
  6. * Description:
  7. *
  8. * Version: 1.2
  9. * Created: 07/26/2017 05:32:51 AM
  10. * Revision: none
  11. * Compiler: gcc
  12. *
  13. * Author: Oleh Yuschuk
  14. * Modified By: suhrke@teknik.io
  15. *
  16. * =====================================================================================
  17. */
  18. #include <string>
  19. typedef struct t_fproc { // Descriptor of processed file
  20. int busy; // In work
  21. // General file data.
  22. char name[64]; // File name - may have all 64 chars
  23. //FILETIME modified; // Time of last file modification
  24. time_t modified;
  25. ulong attributes; // Basic file attrributes
  26. ulong datasize; // Size of (compressed) data
  27. ulong pagesize; // Size of (compressed) data on page
  28. ulong origsize; // Size of original (uncompressed) data
  29. ulong mode; // Special mode bits, set of PBM_xxx
  30. int npages; // Total number of pages
  31. ulong filecrc; // 16-bit CRC of decrypted packed file
  32. // Properties of currently processed page.
  33. int page; // Currently processed page
  34. int ngroup; // Actual NGROUP on the page
  35. ulong minpageaddr; // Minimal address of block on page
  36. ulong maxpageaddr; // Maximal address of block on page
  37. // Gathered data.
  38. int nblock; // Total number of data blocks
  39. int ndata; // Number of decoded blocks so far
  40. uchar *datavalid; // 0:data invalid, 1:valid, 2:recovery
  41. uchar *data; // Gathered data
  42. // Statistics.
  43. int goodblocks; // Total number of good blocks read
  44. int badblocks; // Total number of unreadable blocks
  45. ulong restoredbytes; // Total number of bytes restored by ECC
  46. int recoveredblocks; // Total number of recovered blocks
  47. int rempages[8]; // 1-based list of remaining pages
  48. } t_fproc;
  49. //unique
  50. t_fproc fproc; // Processed file
  51. void Closefproc();
  52. int Startnextpage(t_superblock *superblock);
  53. int Addblock(t_block *block);
  54. int Finishpage(int ngood,int nbad,ulong nrestored);
  55. int Saverestoredfile(int force);
  56. #ifdef _WIN32
  57. int Filetimetotext(FILETIME *fttime,char *s,int n);
  58. #endif