Skip to content

Commit

Permalink
masesgroup#582 (comment): Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
masesdevelopers committed Dec 22, 2024
1 parent b2e90c4 commit 66f9a6d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ The configuration is:
"java.awt.peer"
],
"ClassesToBeListener": [
"java.lang.Runnable",
"javax.swing.Action",
"javax.management.NotificationFilter"
],
Expand Down
12 changes: 11 additions & 1 deletion src/documentation/articles/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ From .NET 9 preview 6, [CET is enabled by default on supported hardware](https:/

If the application, upon startup, fails with the error 0xc0000409 (subcode 0x30) it was compiled with CET enabled and it fails during JVM initialization.

To solve the issue there are three possible solutions:
To solve the issue there are four possible solutions:
1. use a .NET version, e.g. 8, that does not enable CET by default
2. Add the following snippet to disable CET on executable (templates available for JNet are ready made and solve this issue):

Expand All @@ -81,6 +81,16 @@ To solve the issue there are three possible solutions:
MyApplication.exe
```

4. If you want to run the classic application execute the following command:

```sh
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\MyApplication.exe" /v MitigationOptions /t REG_BINARY /d "0000000000000000000000000000002000" /f
```
then run:
```sh
MyApplication.exe
```

## Basic example

Below a basic example which demonstrates how to create a program based on JNet and some other features available like generics and exception handling.
Expand Down
6 changes: 6 additions & 0 deletions src/documentation/articles/usageCLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ To use the CLI interface (JNetCLI) runs a command like the following:
jnet -i
```

> [!IMPORTANT]
> If the previous command raises the error described in [Intel CET and KNet](usage.md#intel-cet-and-knet) the only solution is to apply the following workaround and disable CET:
> ```sh
> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\jnet.exe" /v MitigationOptions /t REG_BINARY /d "0000000000000000000000000000002000" /f
> ```
- **Docker image**
```sh
Expand Down
15 changes: 12 additions & 3 deletions src/documentation/articles/usageReflector.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ To use JNetReflector runs a command like the following:
jnetreflector -OriginRootPath C:\\myJars -OriginJavadocUrl \"https://thehost/javadoc/\" -JavadocVersion 11 -DestinationRootPath C:\\ReflectionDestination
```

> [!IMPORTANT]
> If the previous command raises the error described in [Intel CET and KNet](usage.md#intel-cet-and-knet) the only solution is to apply the following workaround and disable CET:
> ```sh
> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\jnetreflector.exe" /v MitigationOptions /t REG_BINARY /d "0000000000000000000000000000002000" /f
> ```
## Command switches available
_jnr_ accepts the following command-line switch:
_jnetreflector_ accepts the following command-line switch:
* **ConfigurationFile**: The path where is stored a JSON file containing the tool configuration properties; the JSON items shall be written using the same command-line property names
* **CopyrightFile**: The path where the tool will locate copyright info
Expand Down Expand Up @@ -107,14 +113,17 @@ The options used are:
"java.awt.peer"
],
"ClassesToBeListener": [
"java.lang.Runnable",
"javax.swing.Action",
"javax.management.NotificationFilter"
],
"ClassesManuallyDeveloped": [
"java.util.Comparator",
"java.util.EventListener"
],
"ClassesToAvoid": [
"java.lang.ProcessBuilder$Redirect$Type",
"java.lang.Thread$UncaughtExceptionHandler",
"java.util.Comparator",
"java.util.EventListener",
"java.util.stream.DoubleStream$Builder",
"java.util.stream.IntStream$Builder",
"java.util.stream.LongStream$Builder",
Expand Down

0 comments on commit 66f9a6d

Please sign in to comment.