Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char * argv[]) {
- HANDLE h = LoadLibrary("alphacore");
- FILE * x, * y;
- int (*alpha_compress)(FILE *, FILE *, int);
- alpha_compress = (int (*)(FILE *, FILE *, int))GetProcAddress(h, "alpha_compress");
- x = fopen("archive", "r");
- y = fopen("archive.ara", "w");
- return alpha_compress(x, y, 9);
- }
- // In the alphacore library
- extern "C" __declspec(dllexport) int alpha_compress(FILE * input, FILE * output, int level) {
- if(level > 9 || level < 0) {
- return 1;
- }
- if(!input || !output) {
- printf("%X, %X", input, output);
- getchar();
- return 2;
- }
- putc(magic[0], output);
- putc(magic[1], output);
- Compress(input, output, level);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement