c - 用c打开rar文件

标签 c windows compression

我必须用 C 语言编写代码才能在 Windows 中提取受密码保护的 rar 文件。我不知道如何做到这一点。有人能给我建议或提供一段示例代码吗?我将非常感激。

编辑:

这是我用来打开rar文件的代码。系统命令中的ranjit是密码。它给出了模块+文件名中 undefined symbol 系统错误。有谁能够帮助我??两天以来我一直在努力解决这个问题。 编辑:此代码打开存档但不提取它。如果我在命令行中使用 unrar 命令,它会提取文件。我该怎么办?

#include<stdio.h>
#include<stdlib.h>
int main(int argc, char **argv)
     {
     char file[20];
     char file2[50] = "F:\\Program Files\\WinRAR\\unrar.exe";
     printf("enter the name of the rar file : ");
     gets(file);
     puts(file);
     system(("%s e -p ranjit %s >C:\stdout.log 2>C:\stderr.log",file2, file));
     getchar();
     return 0;
     }

最佳答案

除了 karlphilip 的建议之外,http://www.rarlabs.com/rar_add.htm 上还有一些可能很有趣的资源。 .

我特别认为UnRAR.dllUnRAR源可能是相关的。不过我现在还不能真正检查它。

关于c - 用c打开rar文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3514854/

相关文章:

c++ - 我应该如何去阅读一个大的二进制文件

windows - 是否可以从脚本中了解 cpu 利用率

compression - 逆向工程 : How do I identify an unknown compression method?

c# - SharpZipLib 中的奇怪错误 - 大小为 x,但我期望 y

c - 在 C 中使用 scanf 接受用户提供的尽可能多的输入

c - 了解排序链表

windows - Matlab 在命令行上运行脚本并阻止直到完成

c - zlib 压缩和解压使用

c - 休眠一个进程并唤醒它

c - 递归函数C排名