Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. int main(int argc, char * argv[]) {
  2. HANDLE h = LoadLibrary("alphacore");
  3.  
  4. FILE * x, * y;
  5.  
  6. int (*alpha_compress)(FILE *, FILE *, int);
  7.  
  8. alpha_compress = (int (*)(FILE *, FILE *, int))GetProcAddress(h, "alpha_compress");
  9.  
  10. x = fopen("archive", "r");
  11. y = fopen("archive.ara", "w");
  12. return alpha_compress(x, y, 9);
  13. }
  14.  
  15. // In the alphacore library
  16.  
  17. extern "C" __declspec(dllexport) int alpha_compress(FILE * input, FILE * output, int level) {
  18. if(level > 9 || level < 0) {
  19. return 1;
  20. }
  21.  
  22. if(!input || !output) {
  23. printf("%X, %X", input, output);
  24. getchar();
  25. return 2;
  26. }
  27.  
  28. putc(magic[0], output);
  29. putc(magic[1], output);
  30.  
  31. Compress(input, output, level);
  32.  
  33. return 0;
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement