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
d0f5ffd7
Commit
d0f5ffd7
authored
Mar 25, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix dead loop when hook "getCallingClassLoader"
parent
17cfb2c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Unsafe.java
hooklib/src/main/java/com/swift/sandhook/utils/Unsafe.java
+5
-3
No files found.
hooklib/src/main/java/com/swift/sandhook/utils/Unsafe.java
View file @
d0f5ffd7
...
...
@@ -34,6 +34,8 @@ public final class Unsafe {
private
volatile
static
boolean
supported
=
false
;
private
static
Class
objectArrayClass
=
Object
[].
class
;
static
{
try
{
unsafeClass
=
Class
.
forName
(
"sun.misc.Unsafe"
);
...
...
@@ -111,10 +113,10 @@ public final class Unsafe {
public
static
long
getObjectAddress
(
Object
obj
)
{
try
{
Object
[]
array
=
new
Object
[]{
obj
};
if
(
arrayIndexScale
(
Object
[].
c
lass
)
==
8
)
{
return
getLong
(
array
,
arrayBaseOffset
(
Object
[].
c
lass
));
if
(
arrayIndexScale
(
objectArrayC
lass
)
==
8
)
{
return
getLong
(
array
,
arrayBaseOffset
(
objectArrayC
lass
));
}
else
{
return
0xffffffff
L
&
getInt
(
array
,
arrayBaseOffset
(
Object
[].
c
lass
));
return
0xffffffff
L
&
getInt
(
array
,
arrayBaseOffset
(
objectArrayC
lass
));
}
}
catch
(
Exception
e
)
{
Log
.
w
(
TAG
,
e
);
...
...
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