Skip to content

Commit

Permalink
Merge branch 'ts' of https://github.com/axhlzy/Il2CppHookScripts into ts
Browse files Browse the repository at this point in the history
  • Loading branch information
axhlzy committed Aug 20, 2024
2 parents 2d9a834 + dbd5013 commit 2396c3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Il2cppHook/agent/base/breaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,10 +562,10 @@ globalThis.BFA = (filterStr: string, allImg: boolean = true): void => {
globalThis.getPlatformCtxWithArgV = <T extends CpuContext>(ctx: T, argIndex: number): NativePointer | undefined => {
if ((ctx as ArmCpuContext).r0 != undefined) {
if (argIndex > 15 || argIndex < 0) throw new Error(`ARM32 -> argIndex ${argIndex} is out of range`)
return eval(`((ctx as ArmCpuContext).r${argIndex})`) as NativePointer
return eval(`(ctx as ArmCpuContext).r${argIndex}`) as NativePointer
} else {
if (argIndex > 32 || argIndex < 0) throw new Error(`ARM64 -> argIndex ${argIndex} is out of range`)
return eval(`((ctx as Arm64CpuContext).x${argIndex})`) as NativePointer
return eval(`(ctx as Arm64CpuContext).x${argIndex}`) as NativePointer
}
}

Expand Down
4 changes: 4 additions & 0 deletions Il2cppHook/agent/java/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ globalThis.HookDialog = () => {

/// <reference path="https://cs.android.com/android/platform/superproject/main/+/main:external/javassist/sample/rmi/AlertDialog.java;l=22?q=AlertDialog&ss=android" />
// public void show(String message)
LOGD("[*] HOOK androidx.appcompat.app.AlertDialog")
Java.use("androidx.appcompat.app.AlertDialog").show.implementation = function () {
let params: string = arguments.length == 0 ? '' : JSON.stringify(arguments)
LOGW(`CALLED -> ${this.toString()}`)
Expand All @@ -21,6 +22,7 @@ globalThis.HookDialog = () => {

/// ↓↓↓↓↓↓↓ androidx.fragment.app.DialogFragment ↓↓↓↓↓↓↓

LOGD("[*] HOOK androidx.fragment.app.FragmentTransaction")
/// <reference path="https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/app/DialogFragment.java;l=263?q=DialogFragment&ss=android%2Fplatform%2Fsuperproject" />
// public int show(FragmentTransaction transaction, String tag)
DialogFragment.show.overload('androidx.fragment.app.FragmentTransaction', 'java.lang.String').implementation = function () {
Expand All @@ -46,6 +48,7 @@ globalThis.HookDialog = () => {

/// ↓↓↓↓↓↓↓ android.app.Dialog ↓↓↓↓↓↓↓

LOGD("[*] HOOK android.app.Dialog")
Java.use('android.app.Dialog').show.overload().implementation = function () {
let params: string = arguments.length == 0 ? '' : JSON.stringify(arguments)
LOGW(`CALLED -> ${this.toString()}`)
Expand All @@ -58,6 +61,7 @@ globalThis.HookDialog = () => {

let PopupWindow = Java.use("android.widget.PopupWindow")

LOGD("[*] HOOK android.widget.PopupWindow")
/// <reference path="https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/java/android/widget/PopupWindow.java;l=1361?q=showAsDropDown&ss=android%2Fplatform%2Fsuperproject" />
// public void showAsDropDown(View anchor)
PopupWindow.showAsDropDown.overload('android.view.View').implementation = function () {
Expand Down

0 comments on commit 2396c3f

Please sign in to comment.