Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SandHook
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
SandHook
Commits
577759ea
Commit
577759ea
authored
May 16, 2019
by
swift_gan
Committed by
swift_gan
May 16, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix BR
parent
45832ece
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
3 deletions
+27
-3
MyApp.java
app/src/main/java/com/swift/sandhook/MyApp.java
+3
-0
inst_arm64.cpp
nativehook/src/main/cpp/archs/arm/arm64/inst/inst_arm64.cpp
+4
-3
NativeHook.java
...c/main/java/com/swift/sandhook/nativehook/NativeHook.java
+20
-0
No files found.
app/src/main/java/com/swift/sandhook/MyApp.java
View file @
577759ea
...
@@ -5,6 +5,7 @@ import android.app.Application;
...
@@ -5,6 +5,7 @@ import android.app.Application;
import
android.os.Build
;
import
android.os.Build
;
import
android.util.Log
;
import
android.util.Log
;
import
com.swift.sandhook.nativehook.NativeHook
;
import
com.swift.sandhook.test.TestClass
;
import
com.swift.sandhook.test.TestClass
;
import
com.swift.sandhook.testHookers.ActivityHooker
;
import
com.swift.sandhook.testHookers.ActivityHooker
;
import
com.swift.sandhook.testHookers.CtrHook
;
import
com.swift.sandhook.testHookers.CtrHook
;
...
@@ -29,6 +30,8 @@ public class MyApp extends Application {
...
@@ -29,6 +30,8 @@ public class MyApp extends Application {
public
void
onCreate
()
{
public
void
onCreate
()
{
super
.
onCreate
();
super
.
onCreate
();
NativeHook
.
test
();
SandHookConfig
.
DEBUG
=
BuildConfig
.
DEBUG
;
SandHookConfig
.
DEBUG
=
BuildConfig
.
DEBUG
;
if
(
testAndroidQ
)
{
if
(
testAndroidQ
)
{
...
...
nativehook/src/main/cpp/archs/arm/arm64/inst/inst_arm64.cpp
View file @
577759ea
...
@@ -309,12 +309,12 @@ A64_LDR_LIT::A64_LDR_LIT(A64_LDR_LIT::OP op, RegisterA64 &rt, Label& label) : op
...
@@ -309,12 +309,12 @@ A64_LDR_LIT::A64_LDR_LIT(A64_LDR_LIT::OP op, RegisterA64 &rt, Label& label) : op
}
}
Off
A64_LDR_LIT
::
getImmPCOffset
()
{
Off
A64_LDR_LIT
::
getImmPCOffset
()
{
return
signExtend64
(
19
+
2
,
COMBINE
(
get
()
->
imm19
,
0
b00
,
2
)
);
return
DECODE_OFFSET
(
19
,
2
);
}
}
void
A64_LDR_LIT
::
onOffsetApply
(
Off
offset
)
{
void
A64_LDR_LIT
::
onOffsetApply
(
Off
offset
)
{
this
->
offset
=
offset
;
this
->
offset
=
offset
;
get
()
->
imm19
=
TruncateToUint19
(
offset
>>
2
);
ENCODE_OFFSET
(
19
,
2
);
}
}
void
A64_LDR_LIT
::
decode
(
STRUCT_A64
(
LDR_LIT
)
*
inst
)
{
void
A64_LDR_LIT
::
decode
(
STRUCT_A64
(
LDR_LIT
)
*
inst
)
{
...
@@ -331,7 +331,7 @@ void A64_LDR_LIT::assembler() {
...
@@ -331,7 +331,7 @@ void A64_LDR_LIT::assembler() {
SET_OPCODE
(
LDR_LIT
);
SET_OPCODE
(
LDR_LIT
);
get
()
->
rt
=
rt
->
getCode
();
get
()
->
rt
=
rt
->
getCode
();
get
()
->
op
=
op
;
get
()
->
op
=
op
;
get
()
->
imm19
=
TruncateToUint19
(
offset
>>
2
);
ENCODE_OFFSET
(
19
,
2
);
}
}
...
@@ -352,6 +352,7 @@ void A64_BR_BLR_RET::decode(A64_STRUCT_BR_BLR_RET *inst) {
...
@@ -352,6 +352,7 @@ void A64_BR_BLR_RET::decode(A64_STRUCT_BR_BLR_RET *inst) {
void
A64_BR_BLR_RET
::
assembler
()
{
void
A64_BR_BLR_RET
::
assembler
()
{
SET_OPCODE_MULTI
(
BR_BLR_RET
,
1
);
SET_OPCODE_MULTI
(
BR_BLR_RET
,
1
);
SET_OPCODE_MULTI
(
BR_BLR_RET
,
2
);
SET_OPCODE_MULTI
(
BR_BLR_RET
,
2
);
SET_OPCODE_MULTI
(
BR_BLR_RET
,
3
);
ENCODE_RN
;
ENCODE_RN
;
ENCODE_OP
;
ENCODE_OP
;
}
}
...
...
nativehook/src/main/java/com/swift/sandhook/nativehook/NativeHook.java
0 → 100644
View file @
577759ea
package
com
.
swift
.
sandhook
.
nativehook
;
/**
* @author Swift Gan
* Create: 2019/5/10
* Desc:
*/
public
class
NativeHook
{
static
{
System
.
loadLibrary
(
"sandhook-native"
);
}
public
static
void
dosth
()
{}
public
static
native
void
test
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment