https://github.com/etdon/winj
Windows platform API bindings, utilities and penetration testing framework.
https://github.com/etdon/winj
ffm penetration-testing win-api win32 windows windows-api windows-utility
Last synced: 13 days ago
JSON representation
Windows platform API bindings, utilities and penetration testing framework.
- Host: GitHub
- URL: https://github.com/etdon/winj
- Owner: etdon
- License: apache-2.0
- Created: 2024-10-01T13:31:35.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2026-05-22T16:10:53.000Z (about 2 months ago)
- Last Synced: 2026-05-22T20:47:10.599Z (about 2 months ago)
- Topics: ffm, penetration-testing, win-api, win32, windows, windows-api, windows-utility
- Language: Java
- Homepage: https://docs.etdon.com/winj/
- Size: 406 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README





Badges marked with a `*` indicate limited compatability with alternatives, please check out the [documentation] for details.
## ð° Introduction
winj is your go-to Java library for seamless Windows API access, leveraging the FFM API. With zero third-party
runtime dependencies, it offers an easy-to-use interface that simplifies native functionality integration, allowing
developers to harness the full power of Windows effortlessly.
## Details
- Gives the user more control over the memory (de)allocation through extensive use of arenas.
- Bindings are provided for both higher level API functions and types as well as lower level ones which are often
completely missing in similar libraries.
- Function calls and types are constructed cleanly with fluent builders.
- Facades (`facade` module) are built around more complex and constant flows like hook management as well
as logically tied components.
- Lightweight with zero third-party runtime dependencies (less than 1 MB in compiled size).
## Warning
No production promises: Names and locations might change, things might get refactored changing the fundamental structure. Published
full release versions will remain untouched (unless critical fixes are needed) and changes will only be shipped with the next version.
Snapshot versions might change at any time.
## Examples
Check out the [documentation] for various examples paired with explanations.
```java
// Re-usable
final WindowsAPI windowsAPI = WindowsAPI.of(arena);
final NativeContext nativeContext = NativeContext.of(arena, this.nativeCaller);
final Window window = windowsAPI.getForegroundWindow();
final String windowText = window.getText(nativeContext);
```
```java
final MemorySegment windowHandle = CreateWindowExW.builder()
.className(className)
.windowName(windowName)
.moduleHandle(moduleHandle)
.style(
Flag.combine(
WindowStyle.WS_SYSMENU,
WindowStyle.WS_CAPTION,
WindowStyle.WS_BORDER
)
)
.build()
.call();
ShowWindow.builder()
.handle(windowHandle)
.presentation(WindowPresentation.SW_SHOW)
.build()
.call();
```
## Getting Started
> [!NOTE]
> ð· winj is in early development and currently **not** feature complete.
> [!IMPORTANT]
> Requirements:
> - Java 22
> âđïļ *Java 22 (non-LTS) has been prioritized over Java 21 (LTS) because of the finalization of the FFM API.*
ðŠķ Maven:
```xml
etdon-repo
https://repo.etdon.com/repository/maven-snapshots/
```
```xml
com.etdon.winj
core
1.0.1-SNAPSHOT
com.etdon.winj
facade
1.0.1-SNAPSHOT
```
ð Gradle:
```groovy
maven {
url = uri("https://repo.etdon.com/repository/maven-snapshots/")
}
```
```groovy
dependencies {
implementation 'com.etdon.winj:core:1.0.1-SNAPSHOT'
implementation 'com.etdon.winj:facade:1.0.1-SNAPSHOT'
}
```
Latest stable
ðŠķ Maven:
```xml
etdon-repo
https://repo.etdon.com/repository/maven-releases/
```
```xml
com.etdon.winj
core
1.0.0
com.etdon.winj
facade
1.0.0
```
ð Gradle:
```groovy
maven {
url = uri("https://repo.etdon.com/repository/maven-releases/")
}
```
```groovy
dependencies {
implementation 'com.etdon.winj:core:1.0.0'
implementation 'com.etdon.winj:facade:1.0.0'
}
```
### Required options:
ðŠķ Maven:
```xml
ALL-UNNAMED
```
ð Gradle:
```groovy
jar {
manifest {
attributes(
'Enable-Native-Access': 'ALL-UNNAMED'
)
}
}
```
ðĨïļ Command line:
```
--enable-native-access=ALL-UNNAMED
```
## ðĶ Building
The build management tool used for this project is [Apache Maven][building]. Executing the following
command will install the compiled artifact into your local repository if no critical issues occur during any of the
lifecycle phases.
```
mvn clean install
```
## ðŦī Contributing
The contribution guidelines are a part of the `shared-guidelines` repository and can be found here: [Contributing][contributing]
## ð License
The project is licensed under the [Apache 2.0 License][license].
```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
[documentation]: https://docs.etdon.com/winj
[building]: https://maven.apache.org/
[contributing]: https://github.com/etdon/shared-guidelines/blob/main/CONTRIBUTING.md
[license]: https://github.com/etdon/winj/blob/master/LICENSE