Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
first
  • Loading branch information
BestGamersH committed Sep 5, 2023
1 parent 2e8735f commit 896468a
Show file tree
Hide file tree
Showing 79 changed files with 7,162 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
# Auto detect text files and perform LF normalization
* text=auto
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

Binary file added .github/assets/Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions .github/assets/discord.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: build/release

on:
push:
branches: [ "master" ]
tags: [ "v[0-9]+.[0-9]+.[0-9]+" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

permissions:
contents: write

jobs:
create-release:
if: github.ref_type == 'tag'
runs-on: ubuntu-latest
steps:
- run: gh release create ${{ github.ref_name }} -R ${{ github.repository }} --draft --title ${GITHUB_REF_NAME#v} -n ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build:
needs: [create-release]
if: always() && !failure() && !cancelled()

strategy:
matrix:
os: [ubuntu-20.04, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- uses: dtolnay/rust-toolchain@nightly

- uses: mozilla-actions/sccache-action@v0.0.3

- name: Build with Gradle
uses: gradle/gradle-build-action@v2.7.0
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
with:
arguments: assembleDist installDist

- name: Create Windows Installer
if: runner.os == 'Windows' && github.ref_type == 'tag'
working-directory: installer
run: iscc installer.iss /DAppVersion=$($env:GITHUB_REF_NAME.Substring(1))

- name: Upload Release Artifact
if: github.ref_type == 'tag'
shell: bash
run: |
os=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')
case $os in
windows)
mv build/distributions/lcqt2.zip windows-portable.zip
artifacts="windows-portable.zip installer/*.exe";;
*)
mv build/distributions/lcqt2.tar.gz $os-portable.tar.gz
artifacts="$os-portable.tar.gz";;
esac
gh release upload ${{ github.ref_name }} $artifacts
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}


7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

.idea
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ALL RIGHTS RESERVED

Copyright (c) 2023 BestGamersHK

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
81 changes: 81 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<h1 align="center">
Lunar Client Qt 2
<a href="https://discord.gg/SfPEPWdMfw">
<img src=".github/assets/discord.svg" alt="discord" height="32" style="vertical-align: -5px;"/>
</a>
</h1>
<p align="center">
<img align=center src=".github/assets/screenshot.png" width="600" alt="screenshot of lcqt"></br>
</p>

## FAQ
**Q: Can I be banned for using this?** </br>
A: Lets break this into 2 types of bans: </br>
- Lunar: While LCQT is *theoretically* detectable on lunars end, as of right now they do not issue client bans. </br>
- Hypixel / Other Servers: LCQT does not send any information to the server. As long as you don't abuse any disabled mods (e.g chat macros) you will not be banned.

**Q: What patches are included in the lcqt2 agent?** </br>
A: In case this goes out of date you can find them [here](https://github.com/BestGamersH/lcqt2/tree/master/agent/src/main/kotlin/io/github/nilsen84/lcqt/patches). </br>
*However:* </br>
- Cosmetics Unlocker: Unlocks cosmetics for paid Minecraft users.
- Cracked Account: Allows Cracked Accounts to be used.
- FPS Spoof: Spoof your FPS.
- Freelook: Re-enables Freelook and AutoTextHotkey on servers.
- NoHitDelay: Removes delay between hits.
- Debug: Enables "Staff" Mods (Currently only X-Ray).
- *Panorama Maker: **Internal Use Only**
- *GeckoLib Debug Mod: **Internal Use Only**

**Q: Why isn't cosmetics working on a cracked account?** </br>
A: Because of the way the cosmetics unlocker is implemented you have to be connected to lunars servers for it to work. </br>
For obvious reasons lunars websocket server does not allow cracked accounts. </br>
***Note: Premium users on cracked servers, this is applicable to you as well.***

**Q: Why isn't my JRE working under Custom JVM?** </br>
A: Your JRE/JDK needs to be Java 17. </br>

**Q: How do I add a java agent?** </br>
A: Append the following to your JVM Arguments in **Settings**: `-javaagent:/path/to/.jar` </br>
You must use forward slashes (/) or double backslashes (\\) in your path.

***Note: As always, use this at YOUR OWN RISK, I am not responsible for any damages that may occur.***

## Installation
#### Windows
Simply download and run the setup executable [here](https://github.com/BestGamersH/lcqt2/releases/latest). </br>
If you prefer a portable version, download the [zip](https://github.com/BestGamersH/lcqt2/releases/latest/download/windows-portable.zip).

#### Arch Linux
Use the AUR package: [lunar-client-qt2](https://aur.archlinux.org/packages/lunar-client-qt2).

#### macOS/Linux
> If you are using Linux, be sure to have the `Lunar Client-X.AppImage` renamed to `lunarclient` in `/usr/bin/`. Alternatively, run lcqt2 with `Lunar Client Qt ~/path/to/lunar/appimage`.
1. Download the file: [Linux](https://github.com/BestGamersH/lcqt2/releases/latest/download/linux-portable.tar.gz) or [macOS](https://github.com/BestGamersH/lcqt2/releases/latest/download/macos-portable.tar.gz).
2. Extract it anywhere (`tar -xf os-portable.tar.gz`)
3. Run the `Lunar Client Qt` executable

> **IMPORTANT:** All 3 files which where inside the tar need to stay together.
> You are allowed to move all 3 together, you're also allowed to create symlinks.
## Building
#### Prerequisites
- Rust Nightly
- NPM

#### Building
LCQT2 is made up of 3 major components:
- The injector - responsible for locating the launcher executable and injecting a javascript patch into it
- The gui - contains the gui opened by pressing the syringe button, also contains the javascript patch used by the injector
- The agent - java agent which implements all game patches

In order for lcqt to work properly all 3 components need to be built into the same directory.

```bash
$ ./gradlew installDist # builds all 3 components and generates a bundle in build/install/lcqt2
```
```bash
$ ./gradlew run # equivalent to ./gradlew installDist && './build/install/lcqt2/Lunar Client Qt'
```
> `./gradlew installDebugDist` and `./gradlew runDebug` do the same thing except they build the rust injector in debug mode.
###### Copyright © 2023 BestGamersHK - [License](https://raw.githubusercontent.com/BestGamersH/lcqt2/master/LICENSE)
42 changes: 42 additions & 0 deletions agent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### IntelliJ IDEA ###
.idea/modules.xml
.idea/jarRepositories.xml
.idea/compiler.xml
.idea/libraries/
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
55 changes: 55 additions & 0 deletions agent/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
plugins {
kotlin("jvm") version "1.9.0"
kotlin("plugin.serialization") version "1.9.0"
id("com.google.protobuf") version "0.9.3"
id("com.github.johnrengelman.shadow") version "8.1.1"
}

group = "io.github.nilsen84"

repositories {
mavenCentral()
maven("https://jitpack.io")
}

sourceSets {
val declarations by creating {
java {
srcDir("src/declarations")
}
}

main {
compileClasspath += declarations.output
}
}

dependencies {
implementation("com.github.Nilsen84:kt-bytecode-dsl:v1.1")
implementation("org.ow2.asm:asm-tree:9.4")
implementation("com.google.protobuf:protobuf-kotlin:3.23.4")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")

compileOnly("net.java.jinput:jinput:2.0.5")
}

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.23.4"
}
}

kotlin {
jvmToolchain(17)
}

tasks.jar {
archiveClassifier.set("thin")
manifest.attributes(
"Premain-Class" to "io.github.nilsen84.lcqt.LcqtPatcher"
)
}

tasks.shadowJar {
archiveClassifier.set(null as String?)
}
8 changes: 8 additions & 0 deletions agent/src/declarations/net/minecraft/util/MouseHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package net.minecraft.util;

public class MouseHelper {
public int deltaX;
public int deltaY;

public void mouseXYChange(){}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package io.github.nilsen84.lcqt.minecraft;

import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment;
import net.java.games.input.DirectAndRawInputEnvironmentPlugin;
import net.java.games.input.Mouse;
import net.minecraft.util.MouseHelper;

import java.util.Arrays;

public class RawMouseHelper extends MouseHelper {
ControllerEnvironment enviro = new DirectAndRawInputEnvironmentPlugin();

Mouse[] mice = Arrays.stream(enviro.getControllers())
.filter(c -> c.getType() == Controller.Type.MOUSE)
.map(Mouse.class::cast)
.toArray(Mouse[]::new);

@Override
public void mouseXYChange() {
this.deltaX = 0;
this.deltaY = 0;

for(var mouse : mice) {
mouse.poll();
this.deltaX += mouse.getX().getPollData();
this.deltaY -= mouse.getY().getPollData();
}
}
}
19 changes: 19 additions & 0 deletions agent/src/main/kotlin/io/github/nilsen84/lcqt/Config.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.github.nilsen84.lcqt

import kotlinx.serialization.Serializable

@Serializable
class Config {
val cosmeticsEnabled: Boolean = false
val freelookEnabled: Boolean = false
val crackedEnabled: Boolean = false
val noHitDelayEnabled: Boolean = false
val debugModsEnabled: Boolean = false

val fpsSpoofEnabled: Boolean = false
val fpsSpoofMultiplier: Float = 1.0f

val rawInputEnabled: Boolean = false

val packFixEnabled: Boolean = false
}
Loading

0 comments on commit 896468a

Please sign in to comment.