Add project files (part 1/2)
Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
3721eaecb2
commit
73baf8d02d
274 files changed
+83593
No files matched your search
@@ -0,0 +1,47 @@
|
||||
// Slinky client - shared declarations for every module.
|
||||
// Symbols keep the names they had in the original binary (fn_<rva>, data_<rva>,
|
||||
// rdata_<rva>), so the code can be compared with the decompiled image one
|
||||
// function at a time.
|
||||
#pragma once
|
||||
|
||||
// ---- widget API (GUI drawing), original RVAs ----
|
||||
extern "C" void W_bool(void *a, void *ctx, void *cfg); // 0x0cef0
|
||||
extern "C" void W_slider(void *a, void *ctx, void *cfg); // 0x0cf30
|
||||
extern "C" void W_range(void *a, void *ctx, void *cfg); // 0x0cfb0
|
||||
extern "C" void W_enumw(void *a, void *ctx, void *cfg); // 0x0d040
|
||||
extern "C" void W_color(void *a, void *ctx, void *cfg); // 0x0d0a0
|
||||
extern "C" void W_items(void *a, void *ctx, void *cfg); // 0x0d0e0
|
||||
extern "C" void W_label(void *ctx, void *a, const char *s); // 0x13e90
|
||||
|
||||
// ---- settings registration API ----
|
||||
extern "C" void R_bool(void *mgr, const char *name, void *cfg); // 0x0c3b0
|
||||
extern "C" void R_num(void *mgr, const char *name, void *cfg); // 0x0c450
|
||||
extern "C" void R_rng(void *mgr, const char *name, void *cfg); // 0x0c550
|
||||
extern "C" void R_enum(void *mgr, const char *name, void *cfg); // 0x0c6f0
|
||||
extern "C" void R_key(void *mgr, const char *name, void *cfg); // 0x0c7e0
|
||||
extern "C" void R_kind2(void *mgr, const char *name, void *cfg); // 0x0ca00
|
||||
|
||||
// ---- original .rdata strings (symbol = RVA) ----
|
||||
#define S(n) extern "C" const char n[]
|
||||
#define D(n) extern "C" unsigned char n[]
|
||||
|
||||
// The original compiler (an older clang-cl) emitted a 1-byte `nop` between a
|
||||
// tail-call `jmp` and a following SEH epilogue; clang 23 no longer does. Put
|
||||
// EPILOG_NOP() on the fall-through path that reaches that second epilogue to
|
||||
// reproduce it (compiler-version shim, not original source).
|
||||
#define EPILOG_NOP() __asm__ __volatile__("nop")
|
||||
|
||||
// Same story for if/else that rejoins at one epilogue: clang 23 tail-duplicates
|
||||
// the epilogue into both arms, the original kept a single shared one. An empty
|
||||
// asm-goto is not duplicable, so it pins the join block. Emits no code.
|
||||
#define SHARED_EPILOG() do { __asm__ __volatile__("" ::: "memory"); \
|
||||
__asm__ goto("" :::: shared_epilog_); shared_epilog_:; } while (0)
|
||||
|
||||
// Same trick for any mid-function join (usable several times per function):
|
||||
// stops clang 23 from tail-duplicating the following block into each predecessor.
|
||||
#define JOIN_AT_(n) do { __asm__ goto("" :::: join_##n##_); join_##n##_:; } while (0)
|
||||
#define JOIN_AT(n) JOIN_AT_(n)
|
||||
#define JOIN() JOIN_AT(__COUNTER__)
|
||||
|
||||
// module logging/format helper (0x0ab710): log_fmt(self, len, fmt, arg)
|
||||
extern "C" void log_fmt(void *self, int len, const char *fmt, ...);
|
||||
@@ -0,0 +1,174 @@
|
||||
// cJSON internals (upstream cJSON 1.7.x, MIT) mapped onto the image's globals.
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
typedef int cJSON_bool;
|
||||
#define false 0
|
||||
#define true 1
|
||||
#define cJSON_Invalid (0)
|
||||
#define cJSON_False (1 << 0)
|
||||
#define cJSON_True (1 << 1)
|
||||
#define cJSON_NULL (1 << 2)
|
||||
#define cJSON_Number (1 << 3)
|
||||
#define cJSON_String (1 << 4)
|
||||
#define cJSON_Array (1 << 5)
|
||||
#define cJSON_Object (1 << 6)
|
||||
#define cJSON_Raw (1 << 7)
|
||||
#define cJSON_IsReference 256
|
||||
#define cJSON_StringIsConst 512
|
||||
typedef struct cJSON {
|
||||
struct cJSON *next, *prev, *child;
|
||||
int type;
|
||||
char *valuestring;
|
||||
int valueint;
|
||||
double valuedouble;
|
||||
char *string;
|
||||
} cJSON;
|
||||
typedef struct internal_hooks {
|
||||
void *(*allocate)(size_t size);
|
||||
void (*deallocate)(void *pointer);
|
||||
void *(*reallocate)(void *pointer, size_t size);
|
||||
} internal_hooks;
|
||||
typedef struct { const unsigned char *json; size_t position; } error;
|
||||
typedef struct {
|
||||
const unsigned char *content; size_t length; size_t offset; size_t depth; internal_hooks hooks;
|
||||
} parse_buffer;
|
||||
typedef struct {
|
||||
unsigned char *buffer; size_t length; size_t offset; size_t depth; cJSON_bool noalloc; cJSON_bool format;
|
||||
internal_hooks hooks;
|
||||
} printbuffer;
|
||||
extern "C" internal_hooks block_in_speed_setting_field_0x38;
|
||||
extern "C" error cjson_state;
|
||||
extern "C" double not_a_number; // NAN
|
||||
#define global_hooks block_in_speed_setting_field_0x38
|
||||
#define global_error cjson_state
|
||||
#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length))
|
||||
#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index))
|
||||
#define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset)
|
||||
#define cjson_min(a, b) (((a) < (b)) ? (a) : (b))
|
||||
extern "C" __attribute__((pure)) size_t libc_strlen(const char *s); // strlen
|
||||
extern "C" __attribute__((pure)) int libc_strncmp(const char *a, const char *b, size_t n); // strncmp
|
||||
extern "C" __attribute__((pure)) int libc_strcmp(const char *a, const char *b); // strcmp
|
||||
extern "C" void *libc_memcpy_alt(void *d, const void *s, size_t n); // memcpy
|
||||
#define strlen libc_strlen
|
||||
#define strncmp libc_strncmp
|
||||
#define strcmp libc_strcmp
|
||||
#define memcpy libc_memcpy_alt
|
||||
#define memset __builtin_memset
|
||||
static inline __attribute__((always_inline)) cJSON_bool cJSON_IsString(const cJSON *const item) {
|
||||
if (item == NULL) return false;
|
||||
return (item->type & 0xFF) == cJSON_String;
|
||||
}
|
||||
static inline __attribute__((always_inline)) cJSON_bool cJSON_IsNumber(const cJSON *const item) {
|
||||
if (item == NULL) return false;
|
||||
return (item->type & 0xFF) == cJSON_Number;
|
||||
}
|
||||
static inline __attribute__((always_inline)) cJSON *cJSON_New_Item(const internal_hooks *const hooks) {
|
||||
cJSON *node = (cJSON *)hooks->allocate(sizeof(cJSON));
|
||||
if (node) memset(node, '\0', sizeof(cJSON));
|
||||
return node;
|
||||
}
|
||||
static inline __attribute__((always_inline)) void update_offset(printbuffer *const buffer) {
|
||||
const unsigned char *buffer_pointer = NULL;
|
||||
if ((buffer == NULL) || (buffer->buffer == NULL)) return;
|
||||
buffer_pointer = buffer->buffer + buffer->offset;
|
||||
buffer->offset += strlen((const char *)buffer_pointer);
|
||||
}
|
||||
|
||||
// ---- shared static helpers (inlined into every public function, as in the original) ----
|
||||
#define INLINE static inline __attribute__((always_inline))
|
||||
extern "C" double threshold_2_14748e09, threshold_neg_2_14748e09; // INT_MAX, INT_MIN as doubles
|
||||
#define INT_MAX 2147483647
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
extern "C" void cjson_delete(cJSON *item); // cJSON_Delete
|
||||
INLINE unsigned char *cJSON_strdup(const unsigned char *string, const internal_hooks *const hooks) {
|
||||
size_t length = 0;
|
||||
unsigned char *copy = NULL;
|
||||
if (string == NULL) return NULL;
|
||||
length = strlen((const char *)string) + sizeof("");
|
||||
copy = (unsigned char *)hooks->allocate(length);
|
||||
if (copy == NULL) return NULL;
|
||||
memcpy(copy, string, length);
|
||||
return copy;
|
||||
}
|
||||
INLINE void suffix_object(cJSON *prev, cJSON *item) { prev->next = item; item->prev = prev; }
|
||||
INLINE cJSON_bool add_item_to_array(cJSON *array, cJSON *item) {
|
||||
cJSON *child = NULL;
|
||||
if ((item == NULL) || (array == NULL) || (array == item)) return false;
|
||||
child = array->child;
|
||||
if (child == NULL) {
|
||||
array->child = item;
|
||||
item->prev = item;
|
||||
item->next = NULL;
|
||||
} else {
|
||||
if (child->prev) {
|
||||
suffix_object(child->prev, item);
|
||||
child->prev = item;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
INLINE cJSON_bool add_item_to_object(cJSON *const object, const char *const string, cJSON *const item,
|
||||
const internal_hooks *const hooks, const cJSON_bool constant_key) {
|
||||
char *new_key = NULL;
|
||||
int new_type = cJSON_Invalid;
|
||||
if ((object == NULL) || (string == NULL) || (item == NULL) || (object == item)) return false;
|
||||
if (constant_key) {
|
||||
new_key = (char *)string;
|
||||
new_type = item->type | cJSON_StringIsConst;
|
||||
} else {
|
||||
new_key = (char *)cJSON_strdup((const unsigned char *)string, hooks);
|
||||
if (new_key == NULL) return false;
|
||||
new_type = item->type & ~cJSON_StringIsConst;
|
||||
}
|
||||
if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) hooks->deallocate(item->string);
|
||||
item->string = new_key;
|
||||
item->type = new_type;
|
||||
return add_item_to_array(object, item);
|
||||
}
|
||||
INLINE cJSON *cJSON_CreateBool(cJSON_bool boolean) {
|
||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||
if (item) item->type = boolean ? cJSON_True : cJSON_False;
|
||||
return item;
|
||||
}
|
||||
INLINE cJSON *cJSON_CreateNumber(double num) {
|
||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||
if (item) {
|
||||
item->type = cJSON_Number;
|
||||
item->valuedouble = num;
|
||||
if (num >= threshold_2_14748e09) item->valueint = INT_MAX;
|
||||
else if (num <= threshold_neg_2_14748e09) item->valueint = INT_MIN;
|
||||
else item->valueint = (int)num;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
INLINE cJSON *cJSON_CreateString(const char *string) {
|
||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||
if (item) {
|
||||
item->type = cJSON_String;
|
||||
item->valuestring = (char *)cJSON_strdup((const unsigned char *)string, &global_hooks);
|
||||
if (!item->valuestring) {
|
||||
cjson_delete(item);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return item;
|
||||
}
|
||||
INLINE cJSON *cJSON_CreateObject(void) {
|
||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||
if (item) item->type = cJSON_Object;
|
||||
return item;
|
||||
}
|
||||
INLINE cJSON *cJSON_CreateArray(void) {
|
||||
cJSON *item = cJSON_New_Item(&global_hooks);
|
||||
if (item) item->type = cJSON_Array;
|
||||
return item;
|
||||
}
|
||||
#define CJSON_NESTING_LIMIT 1000
|
||||
extern "C" void buffer_skip_whitespace_unused_return(parse_buffer *const buffer); // buffer_skip_whitespace (void-returning copy)
|
||||
INLINE parse_buffer *buffer_skip_whitespace_i(parse_buffer *const buffer) {
|
||||
if ((buffer == NULL) || (buffer->content == NULL)) return NULL;
|
||||
if (cannot_access_at_index(buffer, 0)) return buffer;
|
||||
while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) buffer->offset++;
|
||||
if (buffer->offset == buffer->length) buffer->offset--;
|
||||
return buffer;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
// Java class-file constant pool access (the client patches classes in ClassFileLoadHook).
|
||||
// Error codes: 0x2af8 truncated, 0x2afd bad index, 0x2afe wrong tag.
|
||||
#pragma once
|
||||
struct CP { const unsigned char **e; unsigned short n; char pad[6]; const unsigned char *end; };
|
||||
struct Utf8 { const unsigned char *p; unsigned short len; };
|
||||
struct NameType { Utf8 name, desc; };
|
||||
struct MemberRef { Utf8 cls; NameType nt; };
|
||||
static inline __attribute__((always_inline)) unsigned short be16(const unsigned char *p) {
|
||||
unsigned short v = *(const unsigned short *)p;
|
||||
return (unsigned short)((v << 8) | (v >> 8));
|
||||
}
|
||||
// entry `idx` (1-based) and the end of its bytes (start of the next entry, or the pool end)
|
||||
#define CP_ENTRY(cp, idx, ent, lim, fail) \
|
||||
do { \
|
||||
if ((idx) == 0) goto fail; \
|
||||
unsigned short i_ = (unsigned short)((idx) - 1); \
|
||||
if (i_ >= (cp)->n) goto fail; \
|
||||
ent = (cp)->e[i_]; \
|
||||
if (!ent) goto fail; \
|
||||
const unsigned char **nx_ = &(cp)->e[i_]; \
|
||||
\
|
||||
lim = *((idx) == (cp)->n ? &(cp)->end : nx_ + 1); \
|
||||
} while (0)
|
||||
@@ -0,0 +1,33 @@
|
||||
// Engine-side types and helpers shared by the recoded module logic.
|
||||
// Everything is named after its original RVA until its purpose is understood.
|
||||
#pragma once
|
||||
#include "slinky/api.h"
|
||||
|
||||
// Per-hook context handed to every module callback (rcx at +0x08 points here).
|
||||
struct Ctx {
|
||||
void *jvm; // +0x00 JNI/JVM handle passed as the first argument of every java_* call
|
||||
void *module_manager; // +0x08 target of queue_module_toggle
|
||||
void *profile_list; // +0x10
|
||||
void *minecraft; // +0x18 Minecraft instance
|
||||
void *world; // +0x20 client world
|
||||
void *player; // +0x28 local player entity
|
||||
void *key_state_table; // +0x30
|
||||
void *target; // +0x38 current combat target record (entity, squared distance, ...)
|
||||
unsigned char in_game; // +0x40 non-zero while a world is loaded
|
||||
};
|
||||
|
||||
// Current combat target record (Ctx::target)
|
||||
struct CombatTarget {
|
||||
void *padding_00;
|
||||
void *ent; // +0x08 target entity
|
||||
double dist2; // +0x10 squared distance to it
|
||||
unsigned char valid; // +0x18
|
||||
};
|
||||
|
||||
// Hook argument block (rcx of every descriptor callback).
|
||||
struct Hook {
|
||||
char pad0[8];
|
||||
Ctx *ctx; // +0x08
|
||||
};
|
||||
|
||||
#define FN(ret, name, args) extern "C" ret name args
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,117 @@
|
||||
// Layout of the client GUI state block (the `gui` argument of every GUI helper).
|
||||
// Field offsets match the original image; overlapping uses are expressed as unions.
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
|
||||
struct GuiTab { int kind; int pad; const char *label; }; // one entry of the tab bar (kind 6 = unload)
|
||||
struct GuiVec2 { float x, y; };
|
||||
struct GuiColor { float r, g, b, a; };
|
||||
struct GuiRgb { float r, g, b; };
|
||||
struct GuiHsl { float h, s, l; };
|
||||
|
||||
struct GuiCell { float x, y, w, h; };
|
||||
// one entry of the layout-row stack (see push_layout_row / add_cell)
|
||||
struct GuiLayoutRow {
|
||||
char pad[4]; float top; float width; int padw; float y0; int pad14; unsigned char clip; char pad2[7];
|
||||
float bottom; int pad3; long long cols; GuiCell cell[4]; unsigned long long items;
|
||||
};
|
||||
static_assert(sizeof(GuiLayoutRow) == 0x78, "layout row size");
|
||||
|
||||
struct GuiState {
|
||||
GuiLayoutRow rows[5]; // 0x000 layout-row stack
|
||||
long long layout_row_depth; // 0x258 number of rows currently pushed
|
||||
int layout_column_count; // 0x260
|
||||
char pad_264[4];
|
||||
unsigned char toast_visible; // 0x268
|
||||
char pad_269;
|
||||
char toast_text[0x66]; // 0x26a message shown by the toast at the top of the window
|
||||
float toast_x; // 0x2d0
|
||||
float toast_y; // 0x2d4
|
||||
float toast_fade; // 0x2d8 0 -> 1 while the toast fades in
|
||||
char pad_2dc[4];
|
||||
GuiTab tabs[7]; // 0x2e0
|
||||
unsigned long long selected_tab; // 0x350
|
||||
float tab_highlight_pos; // 0x358 animated position of the tab highlight
|
||||
char pad_35c[4];
|
||||
GuiColor accent_color; // 0x360
|
||||
union {
|
||||
int input_mode; // 0x370 0 idle, 1 key-bind capture, 2/3 text field being edited
|
||||
unsigned input_mode_u;
|
||||
};
|
||||
char pad_374[4];
|
||||
union { // 0x378
|
||||
char edit_text[0x68]; // text being edited (input_mode 2/3)
|
||||
struct {
|
||||
void *keybind_callback; // key-bind capture (input_mode 1)
|
||||
void *keybind_target; // 0x380
|
||||
};
|
||||
};
|
||||
void *edit_char_filter; // 0x3e0 per-character filter of the text field
|
||||
void *edit_filter_arg; // 0x3e8
|
||||
unsigned char edit_confirmed; // 0x3f0
|
||||
char pad_3f1[7];
|
||||
union {
|
||||
long long popup_kind; // 0x3f8 0 none, 1 callback, 2 colour picker, 3 confirm, 4 list picker
|
||||
int popup_kind_i;
|
||||
unsigned popup_kind_u;
|
||||
};
|
||||
void *popup_context; // 0x400
|
||||
union {
|
||||
void *popup_title; // 0x408
|
||||
const char *popup_title_text;
|
||||
const char ***popup_title_items;
|
||||
};
|
||||
double popup_open_time; // 0x410
|
||||
float popup_opacity; // 0x418
|
||||
float popup_height; // 0x41c
|
||||
unsigned char popup_animating; // 0x420
|
||||
char pad_421[7];
|
||||
void *popup_callback; // 0x428
|
||||
union { // 0x430 payload, depends on popup_kind
|
||||
char popup_message[0x68]; // confirm: formatted message
|
||||
struct { // colour picker
|
||||
GuiRgb popup_rgb; // 0x430
|
||||
GuiHsl popup_hsl; // 0x43c
|
||||
};
|
||||
struct { // list picker
|
||||
void *popup_list_callback; // 0x430
|
||||
void *popup_list_items; // 0x438
|
||||
union { void *popup_list_extra; unsigned long long popup_list_extra_u; }; // 0x440
|
||||
double popup_list_state; // 0x448
|
||||
void *popup_list_view; // 0x450
|
||||
unsigned long long popup_list_count; // 0x458
|
||||
};
|
||||
};
|
||||
double card_anim_start_time; // 0x498
|
||||
double profile_refresh_time; // 0x4a0
|
||||
GuiVec2 mouse_scene; // 0x4a8 mouse position in scaled window space
|
||||
GuiVec2 mouse_raw; // 0x4b0
|
||||
union {
|
||||
float card_open_progress; // 0x4b8
|
||||
int card_open_progress_i;
|
||||
};
|
||||
float scroll; // 0x4bc
|
||||
float scroll_max; // 0x4c0
|
||||
float row_height; // 0x4c4
|
||||
unsigned char click_capture; // 0x4c8
|
||||
unsigned char click_consumed; // 0x4c9
|
||||
unsigned char numeric_drag_enabled; // 0x4ca
|
||||
unsigned char unload_requested; // 0x4cb
|
||||
unsigned char card_layout_mode; // 0x4cc
|
||||
unsigned char wide_layout; // 0x4cd
|
||||
};
|
||||
|
||||
#define GUI_CHECK(field, off) static_assert(offsetof(GuiState, field) == off, #field)
|
||||
GUI_CHECK(layout_row_depth, 0x258); GUI_CHECK(toast_visible, 0x268); GUI_CHECK(toast_text, 0x26a);
|
||||
GUI_CHECK(toast_x, 0x2d0); GUI_CHECK(toast_fade, 0x2d8); GUI_CHECK(tabs, 0x2e0); GUI_CHECK(selected_tab, 0x350);
|
||||
GUI_CHECK(tab_highlight_pos, 0x358); GUI_CHECK(accent_color, 0x360); GUI_CHECK(input_mode, 0x370);
|
||||
GUI_CHECK(edit_text, 0x378); GUI_CHECK(keybind_target, 0x380); GUI_CHECK(edit_char_filter, 0x3e0);
|
||||
GUI_CHECK(edit_filter_arg, 0x3e8); GUI_CHECK(edit_confirmed, 0x3f0); GUI_CHECK(popup_kind, 0x3f8);
|
||||
GUI_CHECK(popup_context, 0x400); GUI_CHECK(popup_title, 0x408); GUI_CHECK(popup_open_time, 0x410);
|
||||
GUI_CHECK(popup_opacity, 0x418); GUI_CHECK(popup_height, 0x41c); GUI_CHECK(popup_animating, 0x420);
|
||||
GUI_CHECK(popup_callback, 0x428); GUI_CHECK(popup_message, 0x430); GUI_CHECK(popup_rgb, 0x430);
|
||||
GUI_CHECK(popup_hsl, 0x43c); GUI_CHECK(popup_list_extra, 0x440); GUI_CHECK(popup_list_state, 0x448);
|
||||
GUI_CHECK(popup_list_view, 0x450); GUI_CHECK(popup_list_count, 0x458); GUI_CHECK(card_anim_start_time, 0x498);
|
||||
GUI_CHECK(profile_refresh_time, 0x4a0); GUI_CHECK(mouse_scene, 0x4a8); GUI_CHECK(mouse_raw, 0x4b0);
|
||||
GUI_CHECK(card_open_progress, 0x4b8); GUI_CHECK(scroll, 0x4bc); GUI_CHECK(row_height, 0x4c4);
|
||||
GUI_CHECK(click_capture, 0x4c8); GUI_CHECK(wide_layout, 0x4cd);
|
||||
@@ -0,0 +1,16 @@
|
||||
// JNI bridge call in the shape the original compiler emitted: ids and env loaded first, then the
|
||||
// JNIEnv function pointer, then the call (the barrier keeps the pointer load from folding into the jmp/call).
|
||||
#pragma once
|
||||
#include "slinky/jids.h"
|
||||
#define JCALL(j, Fn, ...) ({ JIds *ids = (j)->ids; JNIEnv *env = (j)->env; auto f_ = (*env)->Fn; \
|
||||
asm("" : "+r"(f_)); f_(env, ##__VA_ARGS__); })
|
||||
// Non-tail call: the compiler folds the function-pointer load into the call.
|
||||
#define JCALLN(j, Fn, ...) ({ JIds *ids = (j)->ids; JNIEnv *env = (j)->env; (*env)->Fn(env, ##__VA_ARGS__); })
|
||||
// Call whose first two arguments after env are cached IDs (class+method, NewObject/CallStatic*):
|
||||
// the original loads both IDs before evaluating the remaining arguments.
|
||||
#define JCALL2(j, Fn, A, B, ...) ({ JIds *ids = (j)->ids; JNIEnv *env = (j)->env; auto vt_ = *env; \
|
||||
asm("" : "+r"(vt_)); auto a_ = (A); auto b_ = (B); \
|
||||
asm("" : "+r"(a_), "+r"(b_)); vt_->Fn(env, a_, b_, ##__VA_ARGS__); })
|
||||
// Call<T>Method(obj, ID, args...) with extra arguments: vtable and ID loaded before the arguments.
|
||||
#define JCALL1(j, Fn, O, A, ...) ({ JIds *ids = (j)->ids; JNIEnv *env = (j)->env; auto vt_ = *env; \
|
||||
asm("" : "+r"(vt_)); auto a_ = (A); asm("" : "+r"(a_)); vt_->Fn(env, O, a_, ##__VA_ARGS__); })
|
||||
@@ -0,0 +1,429 @@
|
||||
// Cached JNI IDs of the engine (filled once by load_all_jni_ids). Generated by tools/gen_jids.py.
|
||||
// Member = <Class>_<member>; the comment gives the kind (cls/m/f/sm/sf) and the JVM signature.
|
||||
#pragma once
|
||||
#include "slinky/jnienv.h"
|
||||
struct JIds {
|
||||
int variant; // 0x0 non-zero: alternate mappings
|
||||
int names; // 0x4 mapping names: 0 obfuscated, 1 MCP, 2 SRG
|
||||
void *hasBlockPos;
|
||||
void *gameClassLoader;
|
||||
void *gameClassLoaderLoadClass;
|
||||
jclass List; // 0x20 cls
|
||||
jmethodID List_size; // 0x28 m ()I
|
||||
jmethodID List_get; // 0x30 m (I)Ljava/lang/Object;
|
||||
jmethodID List_add; // 0x38 m (Ljava/lang/Object;)Z
|
||||
jmethodID List_remove; // 0x40 m (Ljava/lang/Object;)Z
|
||||
jclass Map; // 0x48 cls
|
||||
jmethodID Map_containsKey; // 0x50 m (Ljava/lang/Object;)Z
|
||||
jmethodID Map_get; // 0x58 m (Ljava/lang/Object;)Ljava/lang/Object;
|
||||
jclass Keyboard; // 0x60 cls
|
||||
jmethodID Keyboard_isKeyDown; // 0x68 sm (I)Z
|
||||
jmethodID Keyboard_next; // 0x70 sm ()Z
|
||||
jmethodID Keyboard_getEventKey; // 0x78 sm ()I
|
||||
jmethodID Keyboard_getEventKeyState; // 0x80 sm ()Z
|
||||
jclass Mouse; // 0x88 cls
|
||||
jmethodID Mouse_isGrabbed; // 0x90 sm ()Z
|
||||
jmethodID Mouse_setGrabbed; // 0x98 sm (Z)V
|
||||
jmethodID Mouse_isButtonDown; // 0xa0 sm (I)Z
|
||||
jmethodID Mouse_next; // 0xa8 sm ()Z
|
||||
jmethodID Mouse_setCursorPosition; // 0xb0 sm (II)V
|
||||
jclass Display; // 0xb8 cls
|
||||
jmethodID Display_update; // 0xc0 sm ()V
|
||||
jmethodID Display_isActive; // 0xc8 sm ()Z
|
||||
jfieldID Display_width; // 0xd0 sf I
|
||||
jfieldID Display_height; // 0xd8 sf I
|
||||
jfieldID Display_framebufferWidth; // 0xe0 sf I
|
||||
jfieldID Display_framebufferHeight; // 0xe8 sf I
|
||||
jclass Object; // 0xf0 cls
|
||||
jmethodID Object_hashCode; // 0xf8 m ()I
|
||||
jclass SecureClassLoader; // 0x100 cls
|
||||
jmethodID SecureClassLoader__init_; // 0x108 m (Ljava/lang/ClassLoader;)V
|
||||
jclass Channel; // 0x110 cls
|
||||
jmethodID Channel_pipeline; // 0x118 m ()Lio/netty/channel/ChannelPipeline;
|
||||
jclass ChannelPipeline; // 0x120 cls
|
||||
jmethodID ChannelPipeline_addBefore; // 0x128 m
|
||||
jmethodID ChannelPipeline_get; // 0x130 m (Ljava/lang/Class;)Lio/netty/channel/ChannelHandler;
|
||||
jmethodID ChannelPipeline_remove; // 0x138 m (Ljava/lang/Class;)Lio/netty/channel/ChannelHandler;
|
||||
jclass Enum; // 0x140 cls
|
||||
jmethodID Enum_ordinal; // 0x148 m ()I
|
||||
jclass Minecraft; // 0x150 cls
|
||||
jmethodID Minecraft_getNetHandler; // 0x158 m
|
||||
void *unused_slot_160;
|
||||
jmethodID Minecraft_addScheduledTask; // 0x168 m (Ljava/lang/Runnable;)Lcom/google/common/util/concurrent/ListenableFuture;
|
||||
jmethodID Minecraft_clickMouse; // 0x170 m ()V
|
||||
jmethodID Minecraft_rightClickMouse; // 0x178 m ()V
|
||||
jfieldID Minecraft_theMinecraft; // 0x180 sf
|
||||
void *Minecraft_thePlayer;
|
||||
jfieldID Minecraft_theWorld; // 0x190 f
|
||||
jfieldID Minecraft_timer; // 0x198 f
|
||||
jfieldID Minecraft_gameSettings; // 0x1a0 f
|
||||
jfieldID Minecraft_inGameHasFocus; // 0x1a8 f Z
|
||||
jfieldID Minecraft_objectMouseOver; // 0x1b0 f
|
||||
jfieldID Minecraft_leftClickCounter; // 0x1b8 f I
|
||||
jfieldID Minecraft_rightClickDelayTimer; // 0x1c0 f I
|
||||
jfieldID Minecraft_currentScreen; // 0x1c8 f
|
||||
jfieldID Minecraft_ingameGUI; // 0x1d0 f
|
||||
jfieldID Minecraft_displayWidth; // 0x1d8 f I
|
||||
jfieldID Minecraft_displayHeight; // 0x1e0 f I
|
||||
jfieldID Minecraft_renderEngine; // 0x1e8 f
|
||||
jfieldID Minecraft_renderManager; // 0x1f0 f
|
||||
jfieldID Minecraft_renderViewEntity; // 0x1f8 f
|
||||
jfieldID Minecraft_renderGlobal; // 0x200 f
|
||||
jfieldID Minecraft_renderItem; // 0x208 f
|
||||
jfieldID Minecraft_entityRenderer; // 0x210 f
|
||||
jfieldID Minecraft_playerController; // 0x218 f
|
||||
jclass Entity; // 0x220 cls
|
||||
jmethodID Entity_isSprinting; // 0x228 m ()Z
|
||||
jmethodID Entity_setSprinting; // 0x230 m (Z)V
|
||||
jmethodID Entity_isSneaking; // 0x238 m ()Z
|
||||
jmethodID Entity_getFormattedCommandSenderName; // 0x240 m
|
||||
jmethodID Entity_getCommandSenderName; // 0x248 m ()Ljava/lang/String;
|
||||
jmethodID Entity_setAngles; // 0x250 m (FF)V
|
||||
jmethodID Entity_moveFlying; // 0x258 m (FFF)V
|
||||
jmethodID Entity_canBeCollidedWith; // 0x260 m ()Z
|
||||
jfieldID Entity_posX; // 0x268 f D
|
||||
jfieldID Entity_posY; // 0x270 f D
|
||||
jfieldID Entity_posZ; // 0x278 f D
|
||||
jfieldID Entity_prevPosX; // 0x280 f D
|
||||
jfieldID Entity_prevPosY; // 0x288 f D
|
||||
jfieldID Entity_prevPosZ; // 0x290 f D
|
||||
jfieldID Entity_rotationYaw; // 0x298 f F
|
||||
jfieldID Entity_rotationPitch; // 0x2a0 f F
|
||||
jfieldID Entity_prevRotationYaw; // 0x2a8 f F
|
||||
jfieldID Entity_prevRotationPitch; // 0x2b0 f F
|
||||
jfieldID Entity_motionX; // 0x2b8 f D
|
||||
jfieldID Entity_motionY; // 0x2c0 f D
|
||||
jfieldID Entity_motionZ; // 0x2c8 f D
|
||||
jfieldID Entity_boundingBox; // 0x2d0 f
|
||||
jfieldID Entity_ticksExisted; // 0x2d8 f I
|
||||
jfieldID Entity_entityId; // 0x2e0 f I
|
||||
jfieldID Entity_uniqueId; // 0x2e8 f Ljava/util/UUID;
|
||||
jfieldID Entity_onGround; // 0x2f0 f Z
|
||||
jfieldID Entity_isDead; // 0x2f8 f Z
|
||||
jfieldID Entity_fallDistance; // 0x300 f F
|
||||
jfieldID Entity_ridingEntity; // 0x308 f
|
||||
jclass World; // 0x310 cls
|
||||
jmethodID World_getEntityByID; // 0x318 m
|
||||
void *World_getBlock;
|
||||
void *World_getBlockState;
|
||||
jmethodID World_rayTraceBlocks; // 0x330 m
|
||||
jmethodID World_updateEntities; // 0x338 m ()V
|
||||
jmethodID World_getChunkFromChunkCoords; // 0x340 m
|
||||
jmethodID World_markBlockRangeForRenderUpdate; // 0x348 m (IIIIII)V
|
||||
jmethodID World_setBlock; // 0x350 m
|
||||
jmethodID World_setBlockState; // 0x358 m
|
||||
jfieldID World_playerEntities; // 0x360 f Ljava/util/List;
|
||||
jfieldID World_loadedEntityList; // 0x368 f Ljava/util/List;
|
||||
jfieldID World_loadedTileEntityList; // 0x370 f Ljava/util/List;
|
||||
jfieldID World_chunkProvider; // 0x378 f
|
||||
jclass Timer; // 0x380 cls
|
||||
jfieldID Timer_renderPartialTicks; // 0x388 f F
|
||||
jfieldID Timer_timerSpeed; // 0x390 f F
|
||||
jfieldID Timer_elapsedPartialTicks; // 0x398 f F
|
||||
jfieldID Timer_elapsedTicks; // 0x3a0 f I
|
||||
jclass GameSettings; // 0x3a8 cls
|
||||
jfieldID GameSettings_mouseSensitivity; // 0x3b0 f F
|
||||
jfieldID GameSettings_keyBindings; // 0x3b8 f
|
||||
jfieldID GameSettings_thirdPersonView; // 0x3c0 f I
|
||||
jclass MovingObjectPosition; // 0x3c8 cls
|
||||
jmethodID MovingObjectPosition__init_; // 0x3d0 m (Lnet/minecraft/entity/Entity;Lnet/minecraft/util/Vec3;)V
|
||||
jfieldID MovingObjectPosition_typeOfHit; // 0x3d8 f
|
||||
jfieldID MovingObjectPosition_hitVec; // 0x3e0 f
|
||||
void *MovingObjectPosition_sideHitIndex;
|
||||
void *MovingObjectPosition_sideHit;
|
||||
jfieldID MovingObjectPosition_blockX; // 0x3f8 f
|
||||
jfieldID MovingObjectPosition_blockY; // 0x400 f
|
||||
jfieldID MovingObjectPosition_blockZ; // 0x408 f
|
||||
jfieldID MovingObjectPosition_blockPos; // 0x410 f
|
||||
jfieldID MovingObjectPosition_entityHit; // 0x418 f
|
||||
jclass _init_; // 0x420 cls
|
||||
jmethodID _init__getBlock; // 0x428 m
|
||||
jclass Block; // 0x430 cls
|
||||
jmethodID Block_getIdFromBlock; // 0x438 sm
|
||||
jmethodID Block_getBlockFromItem; // 0x440 sm
|
||||
jclass BlockPos; // 0x448 cls
|
||||
jmethodID BlockPos__init_; // 0x450 m (III)V
|
||||
jfieldID BlockPos_a; // 0x458 f
|
||||
jfieldID BlockPos_c; // 0x460 f
|
||||
jfieldID BlockPos_d; // 0x468 f
|
||||
jclass KeyBinding; // 0x470 cls
|
||||
jfieldID KeyBinding_pressed; // 0x478 f Z
|
||||
jfieldID KeyBinding_pressTime; // 0x480 f I
|
||||
jfieldID KeyBinding_keyCode; // 0x488 f I
|
||||
jclass AxisAlignedBB; // 0x490 cls
|
||||
jmethodID AxisAlignedBB__init_; // 0x498 m (DDDDDD)V
|
||||
jmethodID AxisAlignedBB_calculateIntercept; // 0x4a0 m
|
||||
jfieldID AxisAlignedBB_minX; // 0x4a8 f D
|
||||
jfieldID AxisAlignedBB_minY; // 0x4b0 f D
|
||||
jfieldID AxisAlignedBB_minZ; // 0x4b8 f D
|
||||
jfieldID AxisAlignedBB_maxX; // 0x4c0 f D
|
||||
jfieldID AxisAlignedBB_maxY; // 0x4c8 f D
|
||||
jfieldID AxisAlignedBB_maxZ; // 0x4d0 f D
|
||||
jclass GuiContainer; // 0x4d8 cls
|
||||
jmethodID GuiContainer_handleMouseClick; // 0x4e0 m
|
||||
jfieldID GuiContainer_theSlot; // 0x4e8 f
|
||||
jfieldID GuiContainer_lastClickTime; // 0x4f0 f J
|
||||
jclass EntityLivingBase; // 0x4f8 cls
|
||||
void *EntityLivingBase_rayTrace;
|
||||
jmethodID EntityLivingBase_getPosition; // 0x508 m
|
||||
jmethodID EntityLivingBase_getHealth; // 0x510 m ()F
|
||||
jmethodID EntityLivingBase_getTeam; // 0x518 m
|
||||
jmethodID EntityLivingBase_swingItem; // 0x520 m ()V
|
||||
jmethodID EntityLivingBase_getMaxHealth; // 0x528 m ()F
|
||||
jmethodID EntityLivingBase_getActivePotionEffect; // 0x530 m
|
||||
jmethodID EntityLivingBase_jump; // 0x538 m ()V
|
||||
jfieldID EntityLivingBase_moveForward; // 0x540 f F
|
||||
jfieldID EntityLivingBase_moveStrafing; // 0x548 f F
|
||||
jfieldID EntityLivingBase_maxHurtTime; // 0x550 f I
|
||||
jfieldID EntityLivingBase_hurtTime; // 0x558 f I
|
||||
jfieldID EntityLivingBase_lastAttackerTime; // 0x560 f I
|
||||
jfieldID EntityLivingBase_landMovementFactor; // 0x568 f F
|
||||
jfieldID EntityLivingBase_jumpTicks; // 0x570 f I
|
||||
jclass EntityPlayer; // 0x578 cls
|
||||
jmethodID EntityPlayer_isInvisibleToPlayer; // 0x580 m
|
||||
jmethodID EntityPlayer_isUsingItem; // 0x588 m ()Z
|
||||
jmethodID EntityPlayer_getAbsorptionAmount; // 0x590 m ()F
|
||||
jmethodID EntityPlayer_getEquipmentInSlot; // 0x598 m
|
||||
jfieldID EntityPlayer_inventory; // 0x5a0 f
|
||||
jfieldID EntityPlayer_itemInUseCount; // 0x5a8 f I
|
||||
jfieldID EntityPlayer_inventoryContainer; // 0x5b0 f
|
||||
jfieldID EntityPlayer_sleeping; // 0x5b8 f Z
|
||||
jfieldID EntityPlayer_speedOnGround; // 0x5c0 f F
|
||||
jclass InventoryPlayer; // 0x5c8 cls
|
||||
jfieldID InventoryPlayer_mainInventory; // 0x5d0 f
|
||||
jfieldID InventoryPlayer_currentItem; // 0x5d8 f I
|
||||
jfieldID InventoryPlayer_itemStack; // 0x5e0 f
|
||||
jclass ItemStack; // 0x5e8 cls
|
||||
jmethodID ItemStack__init_; // 0x5f0 m
|
||||
jmethodID ItemStack_getItem; // 0x5f8 m
|
||||
jmethodID ItemStack_getStrVsBlock; // 0x600 m
|
||||
jmethodID ItemStack_getEnchantmentTagList; // 0x608 m
|
||||
jmethodID ItemStack_getMaxStackSize; // 0x610 m ()I
|
||||
jmethodID ItemStack_areItemStackTagsEqual; // 0x618 sm
|
||||
jmethodID ItemStack_hasDisplayName; // 0x620 m ()Z
|
||||
jfieldID ItemStack_stackSize; // 0x628 f I
|
||||
jfieldID ItemStack_metadata; // 0x630 f I
|
||||
jclass Item; // 0x638 cls
|
||||
jmethodID Item_getIdFromItem; // 0x640 sm
|
||||
jmethodID Item_getItemById; // 0x648 sm
|
||||
jclass Vec3; // 0x650 cls
|
||||
jmethodID Vec3__init_; // 0x658 m (DDD)V
|
||||
jfieldID Vec3_xCoord; // 0x660 f D
|
||||
jfieldID Vec3_yCoord; // 0x668 f D
|
||||
jfieldID Vec3_zCoord; // 0x670 f D
|
||||
jclass ScorePlayerTeam; // 0x678 cls
|
||||
jfieldID ScorePlayerTeam_Ljava_lang_String_; // 0x680 f Ljava/lang/String;
|
||||
jclass NetHandlerPlayClient; // 0x688 cls
|
||||
jfieldID NetHandlerPlayClient_playerInfoMap; // 0x690 f Ljava/util/Map;
|
||||
jfieldID NetHandlerPlayClient_netManager; // 0x698 f
|
||||
jclass IChatComponent; // 0x6a0 cls
|
||||
jmethodID IChatComponent_getFormattedText; // 0x6a8 m ()Ljava/lang/String;
|
||||
jclass IChatComponent_Serializer; // 0x6b0 cls
|
||||
jmethodID IChatComponent_Serializer_jsonToComponent; // 0x6b8 sm
|
||||
jclass Slot; // 0x6c0 cls
|
||||
jfieldID Slot_slotNumber; // 0x6c8 f I
|
||||
jmethodID Slot_getStack; // 0x6d0 m
|
||||
jclass IInventory; // 0x6d8 cls
|
||||
jmethodID IInventory_getStackInSlot; // 0x6e0 m
|
||||
jclass NetworkManager; // 0x6e8 cls
|
||||
jfieldID NetworkManager_Lio_netty_channel_Channel_; // 0x6f0 f Lio/netty/channel/Channel;
|
||||
void *NetworkManager_scheduleOutboundPacket;
|
||||
void *NetworkManager_sendPacket;
|
||||
jclass C03PacketPlayer; // 0x708 cls
|
||||
jfieldID C03PacketPlayer_moving; // 0x710 f Z
|
||||
jfieldID C03PacketPlayer_onGround; // 0x718 f Z
|
||||
jfieldID C03PacketPlayer_a; // 0x720 f D
|
||||
jfieldID C03PacketPlayer_b; // 0x728 f D
|
||||
jfieldID C03PacketPlayer_c; // 0x730 f D
|
||||
jclass C07PacketPlayerDigging; // 0x738 cls
|
||||
jfieldID C07PacketPlayerDigging_status; // 0x740 f
|
||||
jclass C08PacketPlayerBlockPlacement; // 0x748 cls
|
||||
jfieldID C08PacketPlayerBlockPlacement_stack; // 0x750 f
|
||||
jclass TileEntity; // 0x758 cls
|
||||
jfieldID TileEntity_blockType; // 0x760 f
|
||||
void *TileEntity_pos;
|
||||
void *TileEntity_xCoord;
|
||||
jfieldID TileEntity_yCoord; // 0x778 f
|
||||
jfieldID TileEntity_zCoord; // 0x780 f
|
||||
jclass S12PacketEntityVelocity; // 0x788 cls
|
||||
jfieldID S12PacketEntityVelocity_entityID; // 0x790 f I
|
||||
jfieldID S12PacketEntityVelocity_motionX; // 0x798 f I
|
||||
jfieldID S12PacketEntityVelocity_motionY; // 0x7a0 f I
|
||||
jfieldID S12PacketEntityVelocity_motionZ; // 0x7a8 f I
|
||||
jclass RenderManager; // 0x7b0 cls
|
||||
jfieldID RenderManager_instance; // 0x7b8 sf
|
||||
jfieldID RenderManager_playerViewX; // 0x7c0 f F
|
||||
jfieldID RenderManager_playerViewY; // 0x7c8 f F
|
||||
jfieldID RenderManager_textRenderer; // 0x7d0 f
|
||||
jclass S14PacketEntity; // 0x7d8 cls
|
||||
jfieldID S14PacketEntity_entityId; // 0x7e0 f I
|
||||
jfieldID S14PacketEntity_posX; // 0x7e8 f B
|
||||
jfieldID S14PacketEntity_posY; // 0x7f0 f B
|
||||
jfieldID S14PacketEntity_posZ; // 0x7f8 f B
|
||||
jfieldID S14PacketEntity_yaw; // 0x800 f B
|
||||
jfieldID S14PacketEntity_pitch; // 0x808 f B
|
||||
jfieldID S14PacketEntity_g; // 0x810 f Z
|
||||
jclass S18PacketEntityTeleport; // 0x818 cls
|
||||
jfieldID S18PacketEntityTeleport_entityId; // 0x820 f I
|
||||
jfieldID S18PacketEntityTeleport_posX; // 0x828 f I
|
||||
jfieldID S18PacketEntityTeleport_posY; // 0x830 f I
|
||||
jfieldID S18PacketEntityTeleport_posZ; // 0x838 f I
|
||||
jfieldID S18PacketEntityTeleport_yaw; // 0x840 f B
|
||||
jfieldID S18PacketEntityTeleport_pitch; // 0x848 f B
|
||||
jclass S19PacketEntityStatus; // 0x850 cls
|
||||
jfieldID S19PacketEntityStatus_entityId; // 0x858 f I
|
||||
jclass S29PacketSoundEffect; // 0x860 cls
|
||||
jclass S06PacketUpdateHealth; // 0x868 cls
|
||||
jclass EntityOtherPlayerMP; // 0x870 cls
|
||||
jfieldID EntityOtherPlayerMP_otherPlayerMPPosRotationIncrements; // 0x878 f I
|
||||
jfieldID EntityOtherPlayerMP_otherPlayerMPX; // 0x880 f D
|
||||
jfieldID EntityOtherPlayerMP_otherPlayerMPY; // 0x888 f D
|
||||
jfieldID EntityOtherPlayerMP_otherPlayerMPZ; // 0x890 f D
|
||||
jfieldID EntityOtherPlayerMP_otherPlayerMPYaw; // 0x898 f D
|
||||
jclass GuiInventory; // 0x8a0 cls
|
||||
jclass EntityPlayerSP; // 0x8a8 cls
|
||||
jfieldID EntityPlayerSP_renderArmYaw; // 0x8b0 f F
|
||||
jfieldID EntityPlayerSP_renderArmPitch; // 0x8b8 f F
|
||||
jfieldID EntityPlayerSP_prevRenderArmYaw; // 0x8c0 f F
|
||||
jfieldID EntityPlayerSP_prevRenderArmPitch; // 0x8c8 f F
|
||||
jfieldID EntityPlayerSP_timeInPortal; // 0x8d0 f F
|
||||
jfieldID EntityPlayerSP_prevTimeInPortal; // 0x8d8 f F
|
||||
jmethodID EntityPlayerSP_addChatMessage; // 0x8e0 m
|
||||
jclass EntityRenderer; // 0x8e8 cls
|
||||
jmethodID EntityRenderer_getMouseOver; // 0x8f0 m (F)V
|
||||
jmethodID EntityRenderer_renderHand; // 0x8f8 m (FI)V
|
||||
jmethodID EntityRenderer_orientCamera; // 0x900 m (F)V
|
||||
jmethodID EntityRenderer_getFOVModifier; // 0x908 m (FZ)F
|
||||
void *EntityRenderer_updateCameraAndRender;
|
||||
jclass Framebuffer; // 0x918 cls
|
||||
jmethodID Framebuffer_bindFramebuffer; // 0x920 m (Z)V
|
||||
jclass RenderGlobal; // 0x928 cls
|
||||
jfieldID RenderGlobal_displayListEntitiesDirty; // 0x930 f Z
|
||||
jclass ActiveRenderInfo; // 0x938 cls
|
||||
jmethodID ActiveRenderInfo_updateRenderInfo; // 0x940 sm
|
||||
jclass RendererLivingEntity; // 0x948 cls
|
||||
void *RendererLivingEntity_renderNameMethodName;
|
||||
void *RendererLivingEntity_renderNameMethodSignature;
|
||||
jmethodID RendererLivingEntity_func_177067_a; // 0x960 m (Lpr;DDD)V
|
||||
void *RendererLivingEntity_canRenderNameMethodName;
|
||||
void *RendererLivingEntity_canRenderNameMethodSignature;
|
||||
jmethodID RendererLivingEntity_canRenderName; // 0x978 m
|
||||
void *RendererLivingEntity_doRenderMethodName;
|
||||
void *RendererLivingEntity_doRenderMethodSignature;
|
||||
jmethodID RendererLivingEntity___2; // 0x990 m
|
||||
jclass FontRenderer; // 0x998 cls
|
||||
jmethodID FontRenderer_getStringWidth; // 0x9a0 m (Ljava/lang/String;)I
|
||||
void *FontRenderer_drawString;
|
||||
jclass GlStateManager; // 0x9b0 cls
|
||||
jmethodID GlStateManager_enableDepth; // 0x9b8 sm
|
||||
jmethodID GlStateManager_disableDepth; // 0x9c0 sm
|
||||
jmethodID GlStateManager_enableLighting; // 0x9c8 sm
|
||||
jmethodID GlStateManager_disableLighting; // 0x9d0 sm
|
||||
jmethodID GlStateManager_enableTexture2D; // 0x9d8 sm
|
||||
jmethodID GlStateManager_disableTexture2D; // 0x9e0 sm
|
||||
jmethodID GlStateManager_enableBlend; // 0x9e8 sm
|
||||
jmethodID GlStateManager_disableBlend; // 0x9f0 sm
|
||||
jmethodID GlStateManager_enableCull; // 0x9f8 sm
|
||||
jmethodID GlStateManager_disableCull; // 0xa00 sm
|
||||
jmethodID GlStateManager_enableAlpha; // 0xa08 sm
|
||||
jmethodID GlStateManager_disableAlpha; // 0xa10 sm
|
||||
jmethodID GlStateManager_blendFunc; // 0xa18 sm
|
||||
jmethodID GlStateManager_color; // 0xa20 sm
|
||||
jclass C02PacketUseEntity; // 0xa28 cls
|
||||
jclass C0BPacketEntityAction; // 0xa30 cls
|
||||
jfieldID C0BPacketEntityAction_Lis_a_; // 0xa38 f
|
||||
jclass S08PacketPlayerPosLook; // 0xa40 cls
|
||||
jclass S27PacketExplosion; // 0xa48 cls
|
||||
jfieldID S27PacketExplosion_f; // 0xa50 f F
|
||||
jfieldID S27PacketExplosion_g; // 0xa58 f F
|
||||
jfieldID S27PacketExplosion_h; // 0xa60 f F
|
||||
jclass S00PacketKeepAlive; // 0xa68 cls
|
||||
jclass C00PacketKeepAlive; // 0xa70 cls
|
||||
jclass Potion; // 0xa78 cls
|
||||
jfieldID Potion_potionTypes; // 0xa80 sf
|
||||
jclass RenderPlayer; // 0xa88 cls
|
||||
void *RenderArrow_doRenderMethodName;
|
||||
void *RenderArrow_doRenderMethodSignature;
|
||||
jmethodID RenderPlayer__L_s_DDDFF_V; // 0xaa0 m
|
||||
jclass RenderItem; // 0xaa8 cls
|
||||
jfieldID RenderItem_zLevel; // 0xab0 f F
|
||||
void *RenderItem_init;
|
||||
jmethodID RenderItem__init_; // 0xac0 m
|
||||
jmethodID RenderItem_renderItemOverlayIntoGUI; // 0xac8 m
|
||||
jclass RenderHelper; // 0xad0 cls
|
||||
jmethodID RenderHelper_enableStandardItemLighting; // 0xad8 sm ()V
|
||||
jmethodID RenderHelper_disableStandardItemLighting; // 0xae0 sm ()V
|
||||
jclass EntityList; // 0xae8 cls
|
||||
jmethodID EntityList_getEntityID; // 0xaf0 sm
|
||||
jclass Chunk; // 0xaf8 cls
|
||||
jfieldID Chunk_storageArrays; // 0xb00 f
|
||||
jfieldID Chunk_xPosition; // 0xb08 f I
|
||||
jfieldID Chunk_zPosition; // 0xb10 f I
|
||||
jclass ExtendedBlockStorage; // 0xb18 cls
|
||||
void *ExtendedBlockStorage_blockLSBArray;
|
||||
jclass WorldClient; // 0xb28 cls
|
||||
jclass ChunkProviderClient; // 0xb30 cls
|
||||
jfieldID ChunkProviderClient_chunkMapping; // 0xb38 f Ljava/util/List;
|
||||
jmethodID ChunkProviderClient_unloadChunk; // 0xb40 m (II)V
|
||||
jclass EntityItem; // 0xb48 cls
|
||||
jmethodID EntityItem_getEntityItem; // 0xb50 m
|
||||
jmethodID EntityItem_searchForOtherItemsNearby; // 0xb58 m ()V
|
||||
jclass S3FPacketCustomPayload; // 0xb60 cls
|
||||
jfieldID S3FPacketCustomPayload_Ljava_lang_String_; // 0xb68 f Ljava/lang/String;
|
||||
jfieldID S3FPacketCustomPayload_data; // 0xb70 f
|
||||
jclass PacketBuffer; // 0xb78 cls
|
||||
jmethodID PacketBuffer_readableBytes; // 0xb80 m ()I
|
||||
jmethodID PacketBuffer_readerIndex; // 0xb88 m ()I
|
||||
jmethodID PacketBuffer_getBytes; // 0xb90 m (I[B)Lio/netty/buffer/ByteBuf;
|
||||
jclass UUID; // 0xb98 cls
|
||||
jmethodID UUID_getLeastSignificantBits; // 0xba0 m ()J
|
||||
jmethodID UUID_getMostSignificantBits; // 0xba8 m ()J
|
||||
jclass ChatComponentText; // 0xbb0 cls
|
||||
jmethodID ChatComponentText__init_; // 0xbb8 m (Ljava/lang/String;)V
|
||||
jclass PlayerControllerMP; // 0xbc0 cls
|
||||
jfieldID PlayerControllerMP_curBlockDamageMP; // 0xbc8 f F
|
||||
jfieldID PlayerControllerMP_blockHitDelay; // 0xbd0 f I
|
||||
jfieldID PlayerControllerMP_isHittingBlock; // 0xbd8 f Z
|
||||
jmethodID PlayerControllerMP_updateController; // 0xbe0 m ()V
|
||||
jclass C0EPacketClickWindow; // 0xbe8 cls
|
||||
jclass NBTTagList; // 0xbf0 cls
|
||||
jmethodID NBTTagList_tagCount; // 0xbf8 m ()I
|
||||
jmethodID NBTTagList_getCompoundTagAt; // 0xc00 m
|
||||
jclass NBTTagCompound; // 0xc08 cls
|
||||
jmethodID NBTTagCompound_getShort; // 0xc10 m (Ljava/lang/String;)S
|
||||
jclass EntityArrow; // 0xc18 cls
|
||||
void *unused_slot_c20;
|
||||
jfieldID EntityArrow_inGround; // 0xc28 f Z
|
||||
jclass PotionEffect; // 0xc30 cls
|
||||
jfieldID PotionEffect_duration; // 0xc38 f I
|
||||
jclass NetworkPlayerInfo; // 0xc40 cls
|
||||
jfieldID NetworkPlayerInfo_displayName; // 0xc48 f
|
||||
jmethodID NetworkPlayerInfo_getPlayerTeam; // 0xc50 m
|
||||
jclass GenericFutureListener; // 0xc58 cls
|
||||
jclass C16PacketClientStatus; // 0xc60 cls
|
||||
jfieldID C16PacketClientStatus_status; // 0xc68 f
|
||||
void *C16PacketClientStatus_init;
|
||||
jclass C16PacketClientStatus_EnumState; // 0xc78 cls
|
||||
void *C16PacketClientStatus_EnumState_openInventory;
|
||||
jclass c; // 0xc88 cls
|
||||
jmethodID c__init_; // 0xc90 m (I)V
|
||||
jclass ContainerPlayer; // 0xc98 cls
|
||||
jfieldID ContainerPlayer_craftMatrix; // 0xca0 f
|
||||
jclass GuiScreen; // 0xca8 cls
|
||||
jmethodID GuiScreen_keyTyped; // 0xcb0 m (CI)V
|
||||
jclass GuiChest; // 0xcb8 cls
|
||||
jfieldID GuiChest_lowerChestInventory; // 0xcc0 f
|
||||
jclass InventoryBasic; // 0xcc8 cls
|
||||
jfieldID InventoryBasic_Ljava_lang_String_; // 0xcd0 f Ljava/lang/String;
|
||||
jclass StatCollector; // 0xcd8 cls
|
||||
jmethodID StatCollector_translateToLocal; // 0xce0 sm (Ljava/lang/String;)Ljava/lang/String;
|
||||
jclass C01PacketChatMessage; // 0xce8 cls
|
||||
jfieldID C01PacketChatMessage_Ljava_lang_String_; // 0xcf0 f Ljava/lang/String;
|
||||
jclass C14PacketTabComplete; // 0xcf8 cls
|
||||
jfieldID C14PacketTabComplete_Ljava_lang_String_; // 0xd00 f Ljava/lang/String;
|
||||
jclass S2APacketParticles; // 0xd08 cls
|
||||
};
|
||||
|
||||
// The handle every engine call receives: ID table + JNIEnv.
|
||||
struct Jvm { JIds *ids; JNIEnv *env; };
|
||||
#define JNI(j) (*(j)->env)
|
||||
@@ -0,0 +1,252 @@
|
||||
// JNIEnv function table in JNI ABI order (index = offset / 8), generated from a JDK jni.h.
|
||||
// Object handles are plain pointers; only the layout matters to the recoded engine.
|
||||
#pragma once
|
||||
typedef void *jobject, *jclass, *jstring, *jarray, *jobjectArray, *jthrowable, *jweak, *jmethodID, *jfieldID;
|
||||
typedef void *jbooleanArray, *jbyteArray, *jcharArray, *jshortArray, *jintArray, *jlongArray, *jfloatArray, *jdoubleArray;
|
||||
typedef unsigned char jboolean; typedef signed char jbyte; typedef unsigned short jchar; typedef short jshort;
|
||||
typedef int jint; typedef long long jlong; typedef float jfloat; typedef double jdouble; typedef jint jsize;
|
||||
typedef union jvalue { jboolean z; jbyte b; jchar c; jshort s; jint i; jlong j; jfloat f; jdouble d; jobject l; } jvalue;
|
||||
typedef struct { char *name; char *signature; void *fnPtr; } JNINativeMethod;
|
||||
typedef int jobjectRefType;
|
||||
struct JNIEnv_;
|
||||
typedef const struct JNINativeInterface_ *JNIEnv;
|
||||
struct JavaVM_; typedef struct JavaVM_ JavaVM;
|
||||
#include <stdarg.h>
|
||||
struct JNINativeInterface_ {
|
||||
void *reserved0; // 0x0
|
||||
void *reserved1; // 0x8
|
||||
void *reserved2; // 0x10
|
||||
void *reserved3; // 0x18
|
||||
jint (*GetVersion)(JNIEnv *env); // 0x20
|
||||
jclass (*DefineClass)(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len); // 0x28
|
||||
jclass (*FindClass)(JNIEnv *env, const char *name); // 0x30
|
||||
jmethodID (*FromReflectedMethod)(JNIEnv *env, jobject method); // 0x38
|
||||
jfieldID (*FromReflectedField)(JNIEnv *env, jobject field); // 0x40
|
||||
jobject (*ToReflectedMethod)(JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic); // 0x48
|
||||
jclass (*GetSuperclass)(JNIEnv *env, jclass sub); // 0x50
|
||||
jboolean (*IsAssignableFrom)(JNIEnv *env, jclass sub, jclass sup); // 0x58
|
||||
jobject (*ToReflectedField)(JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic); // 0x60
|
||||
jint (*Throw)(JNIEnv *env, jthrowable obj); // 0x68
|
||||
jint (*ThrowNew)(JNIEnv *env, jclass clazz, const char *msg); // 0x70
|
||||
jthrowable (*ExceptionOccurred)(JNIEnv *env); // 0x78
|
||||
void (*ExceptionDescribe)(JNIEnv *env); // 0x80
|
||||
void (*ExceptionClear)(JNIEnv *env); // 0x88
|
||||
void (*FatalError)(JNIEnv *env, const char *msg); // 0x90
|
||||
jint (*PushLocalFrame)(JNIEnv *env, jint capacity); // 0x98
|
||||
jobject (*PopLocalFrame)(JNIEnv *env, jobject result); // 0xa0
|
||||
jobject (*NewGlobalRef)(JNIEnv *env, jobject lobj); // 0xa8
|
||||
void (*DeleteGlobalRef)(JNIEnv *env, jobject gref); // 0xb0
|
||||
void (*DeleteLocalRef)(JNIEnv *env, jobject obj); // 0xb8
|
||||
jboolean (*IsSameObject)(JNIEnv *env, jobject obj1, jobject obj2); // 0xc0
|
||||
jobject (*NewLocalRef)(JNIEnv *env, jobject ref); // 0xc8
|
||||
jint (*EnsureLocalCapacity)(JNIEnv *env, jint capacity); // 0xd0
|
||||
jobject (*AllocObject)(JNIEnv *env, jclass clazz); // 0xd8
|
||||
jobject (*NewObject)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0xe0
|
||||
jobject (*NewObjectV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0xe8
|
||||
jobject (*NewObjectA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0xf0
|
||||
jclass (*GetObjectClass)(JNIEnv *env, jobject obj); // 0xf8
|
||||
jboolean (*IsInstanceOf)(JNIEnv *env, jobject obj, jclass clazz); // 0x100
|
||||
jmethodID (*GetMethodID)(JNIEnv *env, jclass clazz, const char *name, const char *sig); // 0x108
|
||||
jobject (*CallObjectMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x110
|
||||
jobject (*CallObjectMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x118
|
||||
jobject (*CallObjectMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); // 0x120
|
||||
jboolean (*CallBooleanMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x128
|
||||
jboolean (*CallBooleanMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x130
|
||||
jboolean (*CallBooleanMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); // 0x138
|
||||
jbyte (*CallByteMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x140
|
||||
jbyte (*CallByteMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x148
|
||||
jbyte (*CallByteMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x150
|
||||
jchar (*CallCharMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x158
|
||||
jchar (*CallCharMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x160
|
||||
jchar (*CallCharMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x168
|
||||
jshort (*CallShortMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x170
|
||||
jshort (*CallShortMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x178
|
||||
jshort (*CallShortMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x180
|
||||
jint (*CallIntMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x188
|
||||
jint (*CallIntMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x190
|
||||
jint (*CallIntMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x198
|
||||
jlong (*CallLongMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x1a0
|
||||
jlong (*CallLongMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x1a8
|
||||
jlong (*CallLongMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x1b0
|
||||
jfloat (*CallFloatMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x1b8
|
||||
jfloat (*CallFloatMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x1c0
|
||||
jfloat (*CallFloatMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x1c8
|
||||
jdouble (*CallDoubleMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x1d0
|
||||
jdouble (*CallDoubleMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x1d8
|
||||
jdouble (*CallDoubleMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args); // 0x1e0
|
||||
void (*CallVoidMethod)(JNIEnv *env, jobject obj, jmethodID methodID, ...); // 0x1e8
|
||||
void (*CallVoidMethodV)(JNIEnv *env, jobject obj, jmethodID methodID, va_list args); // 0x1f0
|
||||
void (*CallVoidMethodA)(JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args); // 0x1f8
|
||||
jobject (*CallNonvirtualObjectMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x200
|
||||
jobject (*CallNonvirtualObjectMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x208
|
||||
jobject (*CallNonvirtualObjectMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args); // 0x210
|
||||
jboolean (*CallNonvirtualBooleanMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x218
|
||||
jboolean (*CallNonvirtualBooleanMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x220
|
||||
jboolean (*CallNonvirtualBooleanMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args); // 0x228
|
||||
jbyte (*CallNonvirtualByteMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x230
|
||||
jbyte (*CallNonvirtualByteMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x238
|
||||
jbyte (*CallNonvirtualByteMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x240
|
||||
jchar (*CallNonvirtualCharMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x248
|
||||
jchar (*CallNonvirtualCharMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x250
|
||||
jchar (*CallNonvirtualCharMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x258
|
||||
jshort (*CallNonvirtualShortMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x260
|
||||
jshort (*CallNonvirtualShortMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x268
|
||||
jshort (*CallNonvirtualShortMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x270
|
||||
jint (*CallNonvirtualIntMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x278
|
||||
jint (*CallNonvirtualIntMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x280
|
||||
jint (*CallNonvirtualIntMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x288
|
||||
jlong (*CallNonvirtualLongMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x290
|
||||
jlong (*CallNonvirtualLongMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x298
|
||||
jlong (*CallNonvirtualLongMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x2a0
|
||||
jfloat (*CallNonvirtualFloatMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x2a8
|
||||
jfloat (*CallNonvirtualFloatMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x2b0
|
||||
jfloat (*CallNonvirtualFloatMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x2b8
|
||||
jdouble (*CallNonvirtualDoubleMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x2c0
|
||||
jdouble (*CallNonvirtualDoubleMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x2c8
|
||||
jdouble (*CallNonvirtualDoubleMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue *args); // 0x2d0
|
||||
void (*CallNonvirtualVoidMethod)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...); // 0x2d8
|
||||
void (*CallNonvirtualVoidMethodV)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, va_list args); // 0x2e0
|
||||
void (*CallNonvirtualVoidMethodA)(JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, const jvalue * args); // 0x2e8
|
||||
jfieldID (*GetFieldID)(JNIEnv *env, jclass clazz, const char *name, const char *sig); // 0x2f0
|
||||
jobject (*GetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x2f8
|
||||
jboolean (*GetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x300
|
||||
jbyte (*GetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x308
|
||||
jchar (*GetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x310
|
||||
jshort (*GetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x318
|
||||
jint (*GetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x320
|
||||
jlong (*GetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x328
|
||||
jfloat (*GetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x330
|
||||
jdouble (*GetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID); // 0x338
|
||||
void (*SetObjectField)(JNIEnv *env, jobject obj, jfieldID fieldID, jobject val); // 0x340
|
||||
void (*SetBooleanField)(JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val); // 0x348
|
||||
void (*SetByteField)(JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val); // 0x350
|
||||
void (*SetCharField)(JNIEnv *env, jobject obj, jfieldID fieldID, jchar val); // 0x358
|
||||
void (*SetShortField)(JNIEnv *env, jobject obj, jfieldID fieldID, jshort val); // 0x360
|
||||
void (*SetIntField)(JNIEnv *env, jobject obj, jfieldID fieldID, jint val); // 0x368
|
||||
void (*SetLongField)(JNIEnv *env, jobject obj, jfieldID fieldID, jlong val); // 0x370
|
||||
void (*SetFloatField)(JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val); // 0x378
|
||||
void (*SetDoubleField)(JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val); // 0x380
|
||||
jmethodID (*GetStaticMethodID)(JNIEnv *env, jclass clazz, const char *name, const char *sig); // 0x388
|
||||
jobject (*CallStaticObjectMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x390
|
||||
jobject (*CallStaticObjectMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x398
|
||||
jobject (*CallStaticObjectMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x3a0
|
||||
jboolean (*CallStaticBooleanMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x3a8
|
||||
jboolean (*CallStaticBooleanMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x3b0
|
||||
jboolean (*CallStaticBooleanMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x3b8
|
||||
jbyte (*CallStaticByteMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x3c0
|
||||
jbyte (*CallStaticByteMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x3c8
|
||||
jbyte (*CallStaticByteMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x3d0
|
||||
jchar (*CallStaticCharMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x3d8
|
||||
jchar (*CallStaticCharMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x3e0
|
||||
jchar (*CallStaticCharMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x3e8
|
||||
jshort (*CallStaticShortMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x3f0
|
||||
jshort (*CallStaticShortMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x3f8
|
||||
jshort (*CallStaticShortMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x400
|
||||
jint (*CallStaticIntMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x408
|
||||
jint (*CallStaticIntMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x410
|
||||
jint (*CallStaticIntMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x418
|
||||
jlong (*CallStaticLongMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x420
|
||||
jlong (*CallStaticLongMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x428
|
||||
jlong (*CallStaticLongMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x430
|
||||
jfloat (*CallStaticFloatMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x438
|
||||
jfloat (*CallStaticFloatMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x440
|
||||
jfloat (*CallStaticFloatMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x448
|
||||
jdouble (*CallStaticDoubleMethod)(JNIEnv *env, jclass clazz, jmethodID methodID, ...); // 0x450
|
||||
jdouble (*CallStaticDoubleMethodV)(JNIEnv *env, jclass clazz, jmethodID methodID, va_list args); // 0x458
|
||||
jdouble (*CallStaticDoubleMethodA)(JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args); // 0x460
|
||||
void (*CallStaticVoidMethod)(JNIEnv *env, jclass cls, jmethodID methodID, ...); // 0x468
|
||||
void (*CallStaticVoidMethodV)(JNIEnv *env, jclass cls, jmethodID methodID, va_list args); // 0x470
|
||||
void (*CallStaticVoidMethodA)(JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args); // 0x478
|
||||
jfieldID (*GetStaticFieldID)(JNIEnv *env, jclass clazz, const char *name, const char *sig); // 0x480
|
||||
jobject (*GetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x488
|
||||
jboolean (*GetStaticBooleanField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x490
|
||||
jbyte (*GetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x498
|
||||
jchar (*GetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4a0
|
||||
jshort (*GetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4a8
|
||||
jint (*GetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4b0
|
||||
jlong (*GetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4b8
|
||||
jfloat (*GetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4c0
|
||||
jdouble (*GetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID); // 0x4c8
|
||||
void (*SetStaticObjectField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value); // 0x4d0
|
||||
void (*SetStaticBooleanField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value); // 0x4d8
|
||||
void (*SetStaticByteField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value); // 0x4e0
|
||||
void (*SetStaticCharField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value); // 0x4e8
|
||||
void (*SetStaticShortField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value); // 0x4f0
|
||||
void (*SetStaticIntField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jint value); // 0x4f8
|
||||
void (*SetStaticLongField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value); // 0x500
|
||||
void (*SetStaticFloatField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value); // 0x508
|
||||
void (*SetStaticDoubleField)(JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value); // 0x510
|
||||
jstring (*NewString)(JNIEnv *env, const jchar *unicode, jsize len); // 0x518
|
||||
jsize (*GetStringLength)(JNIEnv *env, jstring str); // 0x520
|
||||
const jchar * (*GetStringChars)(JNIEnv *env, jstring str, jboolean *isCopy); // 0x528
|
||||
void (*ReleaseStringChars)(JNIEnv *env, jstring str, const jchar *chars); // 0x530
|
||||
jstring (*NewStringUTF)(JNIEnv *env, const char *utf); // 0x538
|
||||
jsize (*GetStringUTFLength)(JNIEnv *env, jstring str); // 0x540
|
||||
const char* (*GetStringUTFChars)(JNIEnv *env, jstring str, jboolean *isCopy); // 0x548
|
||||
void (*ReleaseStringUTFChars)(JNIEnv *env, jstring str, const char* chars); // 0x550
|
||||
jsize (*GetArrayLength)(JNIEnv *env, jarray array); // 0x558
|
||||
jobjectArray (*NewObjectArray)(JNIEnv *env, jsize len, jclass clazz, jobject init); // 0x560
|
||||
jobject (*GetObjectArrayElement)(JNIEnv *env, jobjectArray array, jsize index); // 0x568
|
||||
void (*SetObjectArrayElement)(JNIEnv *env, jobjectArray array, jsize index, jobject val); // 0x570
|
||||
jbooleanArray (*NewBooleanArray)(JNIEnv *env, jsize len); // 0x578
|
||||
jbyteArray (*NewByteArray)(JNIEnv *env, jsize len); // 0x580
|
||||
jcharArray (*NewCharArray)(JNIEnv *env, jsize len); // 0x588
|
||||
jshortArray (*NewShortArray)(JNIEnv *env, jsize len); // 0x590
|
||||
jintArray (*NewIntArray)(JNIEnv *env, jsize len); // 0x598
|
||||
jlongArray (*NewLongArray)(JNIEnv *env, jsize len); // 0x5a0
|
||||
jfloatArray (*NewFloatArray)(JNIEnv *env, jsize len); // 0x5a8
|
||||
jdoubleArray (*NewDoubleArray)(JNIEnv *env, jsize len); // 0x5b0
|
||||
jboolean * (*GetBooleanArrayElements)(JNIEnv *env, jbooleanArray array, jboolean *isCopy); // 0x5b8
|
||||
jbyte * (*GetByteArrayElements)(JNIEnv *env, jbyteArray array, jboolean *isCopy); // 0x5c0
|
||||
jchar * (*GetCharArrayElements)(JNIEnv *env, jcharArray array, jboolean *isCopy); // 0x5c8
|
||||
jshort * (*GetShortArrayElements)(JNIEnv *env, jshortArray array, jboolean *isCopy); // 0x5d0
|
||||
jint * (*GetIntArrayElements)(JNIEnv *env, jintArray array, jboolean *isCopy); // 0x5d8
|
||||
jlong * (*GetLongArrayElements)(JNIEnv *env, jlongArray array, jboolean *isCopy); // 0x5e0
|
||||
jfloat * (*GetFloatArrayElements)(JNIEnv *env, jfloatArray array, jboolean *isCopy); // 0x5e8
|
||||
jdouble * (*GetDoubleArrayElements)(JNIEnv *env, jdoubleArray array, jboolean *isCopy); // 0x5f0
|
||||
void (*ReleaseBooleanArrayElements)(JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode); // 0x5f8
|
||||
void (*ReleaseByteArrayElements)(JNIEnv *env, jbyteArray array, jbyte *elems, jint mode); // 0x600
|
||||
void (*ReleaseCharArrayElements)(JNIEnv *env, jcharArray array, jchar *elems, jint mode); // 0x608
|
||||
void (*ReleaseShortArrayElements)(JNIEnv *env, jshortArray array, jshort *elems, jint mode); // 0x610
|
||||
void (*ReleaseIntArrayElements)(JNIEnv *env, jintArray array, jint *elems, jint mode); // 0x618
|
||||
void (*ReleaseLongArrayElements)(JNIEnv *env, jlongArray array, jlong *elems, jint mode); // 0x620
|
||||
void (*ReleaseFloatArrayElements)(JNIEnv *env, jfloatArray array, jfloat *elems, jint mode); // 0x628
|
||||
void (*ReleaseDoubleArrayElements)(JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode); // 0x630
|
||||
void (*GetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf); // 0x638
|
||||
void (*GetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf); // 0x640
|
||||
void (*GetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf); // 0x648
|
||||
void (*GetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf); // 0x650
|
||||
void (*GetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf); // 0x658
|
||||
void (*GetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf); // 0x660
|
||||
void (*GetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf); // 0x668
|
||||
void (*GetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf); // 0x670
|
||||
void (*SetBooleanArrayRegion)(JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf); // 0x678
|
||||
void (*SetByteArrayRegion)(JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf); // 0x680
|
||||
void (*SetCharArrayRegion)(JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf); // 0x688
|
||||
void (*SetShortArrayRegion)(JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf); // 0x690
|
||||
void (*SetIntArrayRegion)(JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf); // 0x698
|
||||
void (*SetLongArrayRegion)(JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf); // 0x6a0
|
||||
void (*SetFloatArrayRegion)(JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf); // 0x6a8
|
||||
void (*SetDoubleArrayRegion)(JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf); // 0x6b0
|
||||
jint (*RegisterNatives)(JNIEnv *env, jclass clazz, const JNINativeMethod *methods, jint nMethods); // 0x6b8
|
||||
jint (*UnregisterNatives)(JNIEnv *env, jclass clazz); // 0x6c0
|
||||
jint (*MonitorEnter)(JNIEnv *env, jobject obj); // 0x6c8
|
||||
jint (*MonitorExit)(JNIEnv *env, jobject obj); // 0x6d0
|
||||
jint (*GetJavaVM)(JNIEnv *env, JavaVM **vm); // 0x6d8
|
||||
void (*GetStringRegion)(JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf); // 0x6e0
|
||||
void (*GetStringUTFRegion)(JNIEnv *env, jstring str, jsize start, jsize len, char *buf); // 0x6e8
|
||||
void * (*GetPrimitiveArrayCritical)(JNIEnv *env, jarray array, jboolean *isCopy); // 0x6f0
|
||||
void (*ReleasePrimitiveArrayCritical)(JNIEnv *env, jarray array, void *carray, jint mode); // 0x6f8
|
||||
const jchar * (*GetStringCritical)(JNIEnv *env, jstring string, jboolean *isCopy); // 0x700
|
||||
void (*ReleaseStringCritical)(JNIEnv *env, jstring string, const jchar *cstring); // 0x708
|
||||
jweak (*NewWeakGlobalRef)(JNIEnv *env, jobject obj); // 0x710
|
||||
void (*DeleteWeakGlobalRef)(JNIEnv *env, jweak ref); // 0x718
|
||||
jboolean (*ExceptionCheck)(JNIEnv *env); // 0x720
|
||||
jobject (*NewDirectByteBuffer)(JNIEnv* env, void* address, jlong capacity); // 0x728
|
||||
void* (*GetDirectBufferAddress)(JNIEnv* env, jobject buf); // 0x730
|
||||
jlong (*GetDirectBufferCapacity)(JNIEnv* env, jobject buf); // 0x738
|
||||
jobjectRefType (*GetObjectRefType)(JNIEnv* env, jobject obj); // 0x740
|
||||
jobject (*GetModule)(JNIEnv* env, jclass clazz); // 0x748
|
||||
jboolean (*IsVirtualThread)(JNIEnv* env, jobject obj); // 0x750
|
||||
jlong (*GetStringUTFLengthAsLong)(JNIEnv *env, jstring str); // 0x758
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
// What the portable client code needs from the operating system (implemented in src/platform/<os>/).
|
||||
#pragma once
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
// ---- implemented by the platform layer ----
|
||||
void *slinky_gl_get_proc(const char *name); // OpenGL entry point by name (needs a current context)
|
||||
void slinky_log_write(const char *line); // one line of diagnostics (stderr / debug output), no newline
|
||||
// ---- implemented by the client (src/engine/protected/init.cpp), called by the platform layer ----
|
||||
int slinky_setup(void *self); // start-up; runs on its own thread. 0 = ok, else an error code
|
||||
int slinky_teardown(void); // frees everything slinky_setup built; 0 = hooks still live, keep the DLL loaded
|
||||
void slinky_logf(const char *fmt, ...); // printf-style diagnostics via slinky_log_write
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,82 @@
|
||||
// Minimal Win32 declarations for the readable reimplementations in src/engine/protected/.
|
||||
// (The image calls these through the protector's encrypted import slots; here they are ordinary imports.)
|
||||
#pragma once
|
||||
#include <stddef.h>
|
||||
|
||||
typedef void *HANDLE, *HWND, *HMODULE, *HINSTANCE, *LPVOID;
|
||||
typedef int BOOL;
|
||||
typedef unsigned long DWORD;
|
||||
typedef long long LONG_PTR, LRESULT;
|
||||
typedef unsigned long long ULONG_PTR, WPARAM;
|
||||
typedef long long LPARAM;
|
||||
typedef unsigned int UINT;
|
||||
typedef unsigned short WCHAR;
|
||||
typedef long long LARGE_INTEGER_QUAD;
|
||||
typedef LRESULT (*WNDPROC)(HWND, UINT, WPARAM, LPARAM);
|
||||
typedef DWORD (*THREAD_START)(LPVOID);
|
||||
|
||||
struct FILETIME { DWORD lo, hi; };
|
||||
struct WIN32_FIND_DATAW {
|
||||
DWORD attributes;
|
||||
FILETIME created, accessed, written;
|
||||
DWORD size_hi, size_lo, reserved0, reserved1;
|
||||
wchar_t name[260];
|
||||
wchar_t alt_name[14];
|
||||
};
|
||||
|
||||
#define WINAPI __stdcall
|
||||
#define INVALID_HANDLE ((HANDLE)(LONG_PTR)-1)
|
||||
#define GENERIC_READ 0x80000000u
|
||||
#define GENERIC_WRITE 0x40000000u
|
||||
#define FILE_SHARE_READ 1u
|
||||
#define CREATE_NEW 1u
|
||||
#define CREATE_ALWAYS 2u
|
||||
#define OPEN_EXISTING 3u
|
||||
#define FILE_ATTRIBUTE_NORMAL 0x80u
|
||||
#define FILE_ATTRIBUTE_DIRECTORY 0x10u
|
||||
#define INVALID_FILE_SIZE 0xffffffffu
|
||||
#define ERROR_FILE_NOT_FOUND 2u
|
||||
#define ERROR_NO_MORE_FILES 0x12u
|
||||
#define ERROR_FILE_EXISTS 0x50u
|
||||
#define ERROR_ALREADY_EXISTS 0xb7u
|
||||
#define GWLP_WNDPROC (-4)
|
||||
#define SW_SHOWNORMAL 1
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllimport) BOOL WINAPI QueryPerformanceCounter(long long *count);
|
||||
__declspec(dllimport) BOOL WINAPI QueryPerformanceFrequency(long long *freq);
|
||||
__declspec(dllimport) DWORD WINAPI GetLastError();
|
||||
__declspec(dllimport) BOOL WINAPI CreateDirectoryW(const wchar_t *path, void *security);
|
||||
__declspec(dllimport) BOOL WINAPI DeleteFileW(const wchar_t *path);
|
||||
__declspec(dllimport) HANDLE WINAPI CreateFileW(const wchar_t *path, DWORD access, DWORD share, void *security,
|
||||
DWORD disposition, DWORD flags, HANDLE templ);
|
||||
__declspec(dllimport) DWORD WINAPI GetFileSize(HANDLE h, DWORD *high);
|
||||
__declspec(dllimport) BOOL WINAPI ReadFile(HANDLE h, void *buf, DWORD n, DWORD *done, void *overlapped);
|
||||
__declspec(dllimport) BOOL WINAPI WriteFile(HANDLE h, const void *buf, DWORD n, DWORD *done, void *overlapped);
|
||||
__declspec(dllimport) BOOL WINAPI CloseHandle(HANDLE h);
|
||||
__declspec(dllimport) HANDLE WINAPI FindFirstFileW(const wchar_t *pattern, WIN32_FIND_DATAW *fd);
|
||||
__declspec(dllimport) BOOL WINAPI FindNextFileW(HANDLE h, WIN32_FIND_DATAW *fd);
|
||||
__declspec(dllimport) BOOL WINAPI FindClose(HANDLE h);
|
||||
__declspec(dllimport) void WINAPI GetSystemTimeAsFileTime(FILETIME *ft);
|
||||
__declspec(dllimport) HINSTANCE WINAPI ShellExecuteW(HWND hwnd, const wchar_t *op, const wchar_t *file,
|
||||
const wchar_t *params, const wchar_t *dir, int show);
|
||||
__declspec(dllimport) HMODULE WINAPI GetModuleHandleA(const char *name);
|
||||
__declspec(dllimport) void *WINAPI GetProcAddress(HMODULE m, const char *name);
|
||||
__declspec(dllimport) HWND WINAPI GetForegroundWindow();
|
||||
__declspec(dllimport) BOOL WINAPI IsWindowUnicode(HWND hwnd);
|
||||
__declspec(dllimport) DWORD WINAPI GetWindowThreadProcessId(HWND hwnd, DWORD *pid);
|
||||
__declspec(dllimport) DWORD WINAPI GetCurrentProcessId();
|
||||
__declspec(dllimport) HANDLE WINAPI CreateThread(void *security, size_t stack, THREAD_START start, LPVOID param,
|
||||
DWORD flags, DWORD *id);
|
||||
__declspec(dllimport) void WINAPI Sleep(DWORD ms);
|
||||
__declspec(dllimport) void WINAPI FreeLibraryAndExitThread(HMODULE m, DWORD code);
|
||||
__declspec(dllimport) int WINAPI WideCharToMultiByte(UINT codepage, DWORD flags, const wchar_t *src, int n, char *dst,
|
||||
int dst_size, const char *def, BOOL *used_def);
|
||||
__declspec(dllimport) int WINAPI MultiByteToWideChar(UINT codepage, DWORD flags, const char *src, int n, wchar_t *dst,
|
||||
int dst_size);
|
||||
__declspec(dllimport) HANDLE WINAPI GetStdHandle(DWORD which);
|
||||
__declspec(dllimport) void WINAPI OutputDebugStringA(const char *text);
|
||||
__declspec(dllimport) HMODULE WINAPI LoadLibraryA(const char *name);
|
||||
__declspec(dllimport) BOOL WINAPI DisableThreadLibraryCalls(HMODULE m);
|
||||
wchar_t *_wgetenv(const wchar_t *name);
|
||||
}
|
||||
Reference in new issue
Block a user