Skip to content

Commit 7d25bb2

Browse files
authored
Merge pull request #204 from sunnamed434/updates
Updates
2 parents 7d9e3ac + 96af688 commit 7d25bb2

25 files changed

+461
-255
lines changed

.readthedocs.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ python:
1010
- requirements: docs/requirements.txt
1111

1212
sphinx:
13-
configuration: docs/source/conf.py
13+
configuration: docs/source/conf.py
14+
15+
formats:
16+
- pdf
17+
- epub
18+
- html

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,24 @@ Read the **[docs][bitmono_docs]** to read protection, functionality, and more.
8888

8989
### Download
9090

91-
Go and get [Latest BitMono Release][bitmono_latest_release] and download preferred archive file, and make sure to select the similar or same Target Framework of the app that you are going to protect, for example:
92-
93-
- Your Target File is for .NET 8 then use BitMono for .NET 8 `BitMono-v0.25.3+e64e54d3-CLI-net8.0-win-x64.zip`
94-
- Your Target File is for .netstandard then use BitMono for .NET Framework or .NET 8 `BitMono-v0.25.3+e64e54d3-CLI-net8.0-win-x64.zip`
95-
- Your Target File is .NET Framework then use BitMono for .NET Framework `BitMono-v0.25.3+e64e54d3-CLI-net462-win-x64.zip`
96-
97-
If you select wrong BitMono build you have a risk that your file going to be protected incorrectly, because you use different target framework build.
91+
To download the latest release of BitMono, follow these steps:
92+
93+
1. Go to the [Latest BitMono Release][bitmono_latest_release].
94+
2. Select and download the archive file that matches the Target Framework of the application you want to protect. Here are some examples:
95+
96+
- **Targeting .NET 8**: If your target file is built for .NET 8, download:
97+
`BitMono-v0.25.3+e64e54d3-CLI-net8.0-win-x64.zip`
98+
99+
- **Targeting .NET Standard**: If your target file is built for .NET Standard, you can use either BitMono for .NET Framework or .NET 8:
100+
`BitMono-v0.25.3+e64e54d3-CLI-net8.0-win-x64.zip`
101+
102+
- **Targeting .NET Framework**: If your target file is built for .NET Framework, download:
103+
`BitMono-v0.25.3+e64e54d3-CLI-net462-win-x64.zip`
104+
105+
- **Targeting Mono or Unity Engine Runtime**: If your target file is built for .NET Framework and runs on Mono or Unity, use the .NET Framework version:
106+
`BitMono-v0.25.3+e64e54d3-CLI-net462-win-x64.zip`
107+
108+
> **Note:** Be sure to select the correct version of BitMono that matches your Target Framework. Using the wrong version could result in compatibility issues.
98109
99110
### Pre-Require
100111

docs/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_PROJECT_NAME=bitmono-docs-project

docs/.gitignore

Whitespace-only changes.

docs/Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Use a base image with Python
2+
FROM python:3.10-slim
3+
4+
# Set working directory
5+
WORKDIR /docs
6+
7+
# Copy the documentation source into the container
8+
COPY . /docs
9+
10+
# Install Sphinx and build the documentation
11+
RUN pip install sphinx sphinx-rtd-theme
12+
RUN sphinx-build -b html source build
13+
14+
# Expose the port the app runs on
15+
EXPOSE 8000
16+
17+
# Command to run the HTTP server and output instructions
18+
CMD echo "Documentation is available at http://localhost:8000" && \
19+
python -m http.server 8000 --directory build

docs/README.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
How to Run BitMono Docs Locally
2+
3+
Prerequisites:
4+
- Ensure Docker is installed on your machine. If not, install Docker from https://docs.docker.com/get-docker/.
5+
6+
Running Locally:
7+
1. Start Docker if it’s not already running.
8+
2. Open a terminal and navigate to the directory containing your docker-compose.yml file.
9+
3. Execute the following command to build and start the container:
10+
docker-compose up --build
11+
4. Open your browser and go to: http://localhost:8000 to view the documentation.
12+
13+
Restarting the Container:
14+
1. To stop the container, press CTRL + C in the terminal where Docker is running, or close the terminal window.
15+
2. To restart the container and apply any changes, execute:
16+
docker-compose up --build
17+
3. Refresh the browser page at http://localhost:8000 to see the latest updates.
18+
19+
To edit/update docs:
20+
Prerequisites:
21+
- Use Visual Studio Code, or any other tool. https://code.visualstudio.com/
22+
23+
Go to `source` folder and do your magic!

docs/docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
docs:
3+
build:
4+
context: .
5+
dockerfile: Dockerfile
6+
image: bitmono-docs-image:latest
7+
ports:
8+
- "8000:8000"
9+
entrypoint: ["sh", "-c", "echo 'Documentation is available at http://localhost:8000' && python -m http.server 8000 --directory build"]

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ Table of Contents:
5757
obfuscationissues/corlib-not-found
5858
obfuscationissues/intended-for
5959
obfuscationissues/compatibility
60+
obfuscationissues/ready-to-run
6061

6162

6263
.. toctree::
Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,39 @@
11
The module is built for ...
22
===========================
33

4-
`The module is built for .NET (Core), but you're using a version of BitMono intended for .NET Framework.` - this message is very important because if your app is built on .NET Core but BitMono on .NET Framework after obfuscation your app just won't work.
4+
Understanding Compatibility
5+
---------------------------
56

6-
Examples
7-
--------
7+
When using BitMono for obfuscation, it's critical to ensure that the version of BitMono matches the framework your application is built on.
88

9-
Good:
9+
For example, if your application is built on .NET Core, you **must** use the version of BitMono that is also built for .NET Core. Using an incompatible version will result in your application not functioning after obfuscation.
1010

11-
- BitMono on .NET Core and your app on .NET Core
12-
- BitMono on .NET Framework and your app on .NET Framework
11+
.. note::
12+
A common error message you may encounter is:
13+
``The module is built for .NET (Core), but you're using a version of BitMono intended for .NET Framework.``
14+
This indicates a mismatch between your app's framework and BitMono's version.
1315

14-
Bad (IT WON'T WORK!!!):
16+
Examples of Compatibility
17+
--------------------------
1518

16-
- BitMono on .NET Core and your app on .NET Framework
17-
- BitMono on .NET Framework and your app on .NET Core
19+
Here are some examples of correct and incorrect configurations:
20+
21+
**✅ Good Configurations:**
22+
23+
- **BitMono for .NET Core** with an application built on **.NET Core**
24+
- **BitMono for .NET Framework** with an application built on **.NET Framework**
25+
26+
**❌ Bad Configurations (These Won't Work!):**
27+
28+
- **BitMono for .NET Core** with an application built on **.NET Framework**
29+
- **BitMono for .NET Framework** with an application built on **.NET Core**
30+
31+
Key Takeaways
32+
-------------
33+
34+
- Always ensure that **BitMono's framework version** matches the **framework version** of your application.
35+
- Incompatible configurations will break your app after obfuscation.
36+
- Carefully check the framework version of both your app and the BitMono release you are using.
37+
38+
.. warning::
39+
Mixing framework versions (e.g., using BitMono for .NET Framework with a .NET Core app) will cause the app to fail after obfuscation.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
ReadyToRun
2+
==========
3+
4+
If you're encountering an error from BitMono regarding ReadyToRun, or your application is built using ReadyToRun, it means that your application is "protected" by being compiled into native code. However, BitMono cannot obfuscate it because it requires "managed" code.
5+
6+
To solve this issue, you can do the following:
7+
8+
Disable ReadyToRun
9+
------------------
10+
11+
Simply go to your `.csproj` file, add the `PublishReadyToRun` option and set it to `false`. This will look like the following:
12+
13+
.. code-block:: xml
14+
15+
<Project Sdk="Microsoft.NET.Sdk">
16+
<PropertyGroup>
17+
<OutputType>Exe</OutputType>
18+
<TargetFramework>net8.0</TargetFramework>
19+
<ImplicitUsings>enable</ImplicitUsings>
20+
<Nullable>enable</Nullable>
21+
<PublishReadyToRun>false</PublishReadyToRun> <!-- Add this option and set to false -->
22+
</PropertyGroup>
23+
</Project>
24+
25+
26+
Now, build the project and use `.dll` file that has a managed code, instead of native code.
27+
28+
`For more information, visit: <https://learn.microsoft.com/en-us/dotnet/core/deploying/ready-to-run>`_
29+
30+
Use .dll File with Managed Code Instead of .exe File
31+
----------------------------------------------------
32+
33+
Usually, in the output folder of your project (if it's a `.exe`), there should be a `.dll` file with managed code. Use this `.dll` file for obfuscation instead, if there's no such file or it has a native code then use upper solution.
34+
35+
Didn't Help?
36+
------------
37+
38+
If none of the solutions worked, it likely means your file is either protected or broken. If this isn't the case, please open an issue on the BitMono GitHub repository or reach out to us on Discord for further assistance.

0 commit comments

Comments
 (0)