Principle of WinRAR key generation
## 1. What is WinRAR? WinRAR is a trialware file archiver utility for Windows, developed by Eugene Roshal of win.rar GmbH. It can create and view archives in RAR or ZIP file formats and unpack numerous archive file formats. WinRAR is not a free software. If you want to use it, you should pay to [__RARLAB__](https://www.rarlab.com/) and then you will get a license file named `rarreg.key`. This repository will tell you how WinRAR license file `"rarreg.key"` is generated. ## 2. How is "rarreg.key" generated? See [here](README.HOW_DOES_IT_WORK.md). ## 3. Use Github Actions Github Action is a CI/CD tool introduced after Microsoft acquired Github, and you can run programs on GitHub Action by following these steps. ### 3.1 Fork **Fork** this repo.  If you've forked before and I've committed new code, but you don't know how to merge the new content into your repository, then you can delete the current fork and fork again. ### 3.2 Modify info.json Go to `keygen/info.json` and click on the edit button to edit the file.  You can see: ```json { "text1": "Github", "text2": "Github.com" } ``` You can modify the values corresponding to `text1` and `text2`: ```json { "text1": "yourname", "text2": "yourteam" } ``` It is important to note that `test1` and `test2` are **ANSI-encoded string, without null-terminator.** Once you have finished making changes, click the **Commit changes** button and Github Actions will start automatically. If Github Actions does not start automatically, you will need to click on the Actions page to **allow this workflows to run**, then modify and commit `keygen/info.json` again. ### 3.3 Download key Go to the Actions page to see the status of the program.  Green means it ran successfully, yellow means it is running, red means it failed. After running successfully, open the corresponding task and select **rarreg_file** to download.  After decompression, you will get `rarreg.key`, just drag and drop it into WinRAR. If you get an invalid key, check that the `test1` and `test2` parameters are **ANSI encoded without spaces.** ## 4. Build in Visual Studio I recommend using the Github Actions, but you can still do your own compilation. If you don't want to compile it yourself, you can also go to the [release](https://github.com/bitcookies/winrar-keygen/releases/) page to get `winrar-keygen.exe`. ### 4.1 Prerequisites 1. Please make sure that you have **Visual Studio 2022**. Because this is a VS2022 project. If you are still using Visual Studio 2019, you can find projects for VS2019 in the [vs2019](https://github.com/bitcookies/winrar-keygen/tree/vs2019) branch, but this branch will no longer be maintained. 2. Please make sure you have installed `vcpkg` and the following libraries: * `mpir:x86-windows-static` * `mpir:x64-windows-static` is installed. You can install them by: ```console $ vcpkg install mpir:x86-windows-static $ vcpkg install mpir:x64-windows-static ``` 3. Your `vcpkg` has been integrated into your __Visual Studio__, which means you have run successfully. ```console $ vcpkg integrate install ``` ### 4.2 Build 1. Open this project in __Visual Studio__. 2. Select `Release` configuration. 3. Select __Build > Build Solution__. You will see executable files in `bin/` directory. ### 4.3 How to Use? Execute the following code in the terminal and configure two parameters to generate `rarreg.key`. Here is an example use `Github` and `Github.com`: ``` Usage: winrar-keygen.exe