mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
block&replace ext development, LinuxHabboClient efficiency update
This commit is contained in:
parent
71a2a385c9
commit
7037d470aa
@ -3,6 +3,9 @@ package main.extensions.examples.blockreplacepackets;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.stage.Stage;
|
||||
import main.extensions.ExtensionForm;
|
||||
import main.extensions.ExtensionInfo;
|
||||
@ -23,11 +26,22 @@ import java.net.URL;
|
||||
)
|
||||
public class BlockAndReplacePackets extends ExtensionForm {
|
||||
|
||||
public TextField txt_replacement;
|
||||
public ComboBox<String> cmb_type;
|
||||
public TextField txt_id;
|
||||
public Button btn_add;
|
||||
|
||||
public static void main(String[] args) {
|
||||
ExtensionForm.args = args;
|
||||
launch(args);
|
||||
}
|
||||
|
||||
//initialize javaFX elements
|
||||
public void initialize() {
|
||||
cmb_type.getItems().addAll("Block OUT", "Block IN", "Replace OUT", "Replace IN");
|
||||
cmb_type.getSelectionModel().selectFirst();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initExtension() {
|
||||
|
||||
@ -38,7 +52,8 @@ public class BlockAndReplacePackets extends ExtensionForm {
|
||||
FXMLLoader loader = new FXMLLoader(BlockAndReplacePackets.class.getResource("blockreplace.fxml"));
|
||||
Parent root = loader.load();
|
||||
|
||||
primaryStage.setTitle("Packet blocker and replacer");
|
||||
primaryStage.setScene(new Scene(root, 565, 262));
|
||||
primaryStage.setTitle("Packet blocker &/ replacer");
|
||||
primaryStage.setScene(new Scene(root, 580, 262));
|
||||
primaryStage.getScene().getStylesheets().add(GEarthController.class.getResource("bootstrap3.css").toExternalForm());
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.ComboBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextArea?>
|
||||
<?import javafx.scene.control.Tab?>
|
||||
<?import javafx.scene.control.TabPane?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.ColumnConstraints?>
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.layout.RowConstraints?>
|
||||
|
||||
<GridPane prefHeight="260.0" prefWidth="179.0" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.extensions.examples.blockreplacepackets.BlockAndReplacePackets">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="367.0" minWidth="10.0" prefWidth="163.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="121.0" minHeight="10.0" prefHeight="28.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="234.0" minHeight="10.0" prefHeight="234.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<TextArea fx:id="text" editable="false" prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
|
||||
</GridPane.margin>
|
||||
</TextArea>
|
||||
<Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Blocks packets:" textAlignment="CENTER" GridPane.halignment="CENTER" GridPane.valignment="CENTER" />
|
||||
</children>
|
||||
</GridPane>
|
||||
</children>
|
||||
</GridPane>
|
||||
<TabPane prefHeight="255.0" prefWidth="580.0" tabClosingPolicy="UNAVAILABLE" xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1" fx:controller="main.extensions.examples.blockreplacepackets.BlockAndReplacePackets">
|
||||
<tabs>
|
||||
<Tab text="Block/replace packet">
|
||||
<content>
|
||||
<GridPane>
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints maxHeight="209.0" minHeight="10.0" prefHeight="187.0" vgrow="SOMETIMES" />
|
||||
<RowConstraints maxHeight="363.0" minHeight="10.0" prefHeight="35.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<GridPane prefHeight="30.0" prefWidth="500.0" GridPane.rowIndex="1">
|
||||
<columnConstraints>
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="118.0" minWidth="10.0" prefWidth="28.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="0.0" prefWidth="68.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="291.0" minWidth="0.0" prefWidth="124.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="246.0" minWidth="10.0" prefWidth="246.0" />
|
||||
<ColumnConstraints hgrow="SOMETIMES" maxWidth="91.0" minWidth="10.0" prefWidth="68.0" />
|
||||
</columnConstraints>
|
||||
<rowConstraints>
|
||||
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
|
||||
</rowConstraints>
|
||||
<children>
|
||||
<Button fx:id="btn_add" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" mnemonicParsing="false" text="Add" GridPane.columnIndex="4">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</GridPane.margin>
|
||||
</Button>
|
||||
<Label alignment="CENTER" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" text="Id:" textAlignment="CENTER" textFill="#000000ba" />
|
||||
<TextField fx:id="txt_id" GridPane.columnIndex="1">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
<ComboBox fx:id="cmb_type" maxWidth="1.7976931348623157E308" GridPane.columnIndex="2">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</GridPane.margin>
|
||||
</ComboBox>
|
||||
<TextField fx:id="txt_replacement" disable="true" GridPane.columnIndex="3">
|
||||
<GridPane.margin>
|
||||
<Insets left="5.0" right="5.0" />
|
||||
</GridPane.margin>
|
||||
</TextField>
|
||||
</children>
|
||||
<GridPane.margin>
|
||||
<Insets bottom="10.0" left="17.0" right="17.0" />
|
||||
</GridPane.margin>
|
||||
</GridPane>
|
||||
</children>
|
||||
</GridPane>
|
||||
</content>
|
||||
</Tab>
|
||||
<Tab text="Block/replace value">
|
||||
<content>
|
||||
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
|
||||
</content>
|
||||
</Tab>
|
||||
</tabs>
|
||||
</TabPane>
|
||||
|
@ -146,10 +146,22 @@ public class LinuxHabboClient extends HabboClient {
|
||||
for (LinuxMemorySnippet snippet : possibilities) {
|
||||
if (snippet.getData().length >= 1024 && snippet.getData().length <= 1024+2*offset) {
|
||||
for (int i = 0; i < (snippet.getData().length - ((256 - 1) * offset)); i+=offset) {
|
||||
byte[] wannabeRC4data = Arrays.copyOfRange(snippet.getData(), i, 1025 + i);
|
||||
byte[] wannabeRC4data = Arrays.copyOfRange(snippet.getData(), i, 1024 + i);
|
||||
byte[] data = new byte[256]; // dis is the friggin key
|
||||
for (int j = 0; j < 256; j++) data[j] = wannabeRC4data[j*4];
|
||||
resultSet.add(data);
|
||||
|
||||
boolean isvalid = true;
|
||||
for (int j = 0; j < 1024; j++) {
|
||||
if (j % 4 != 0 && wannabeRC4data[j] != 0) {
|
||||
isvalid = false;
|
||||
break;
|
||||
}
|
||||
if (j % 4 == 0) {
|
||||
data[j/4] = wannabeRC4data[j];
|
||||
}
|
||||
}
|
||||
if (isvalid) {
|
||||
resultSet.add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,6 @@ public abstract class Handler {
|
||||
((List<TrafficListener>)listeners[x]).get(i).onCapture(message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void sendToStream(byte[] buffer) {
|
||||
|
Loading…
Reference in New Issue
Block a user