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
ee13b7b5
Commit
ee13b7b5
authored
Apr 04, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error covert of Boolean to long
parent
d190d716
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
ParamWrapper.java
.../src/main/java/com/swift/sandhook/utils/ParamWrapper.java
+11
-5
No files found.
hooklib/src/main/java/com/swift/sandhook/utils/ParamWrapper.java
View file @
ee13b7b5
...
...
@@ -4,8 +4,14 @@ import com.swift.sandhook.SandHook;
public
class
ParamWrapper
{
private
static
boolean
is64Bit
;
static
{
is64Bit
=
SandHook
.
is64Bit
();
}
public
static
boolean
support
(
Class
objectType
)
{
if
(
SandHook
.
is64Bit
()
)
{
if
(
is64Bit
)
{
return
objectType
!=
float
.
class
&&
objectType
!=
double
.
class
;
}
else
{
return
objectType
!=
float
.
class
&&
objectType
!=
double
.
class
&&
objectType
!=
long
.
class
;
...
...
@@ -13,7 +19,7 @@ public class ParamWrapper {
}
public
static
Object
addressToObject
(
Class
objectType
,
long
address
)
{
if
(
SandHook
.
is64Bit
()
)
{
if
(
is64Bit
)
{
return
addressToObject64
(
objectType
,
address
);
}
else
{
return
addressToObject32
(
objectType
,
(
int
)
address
);
...
...
@@ -67,7 +73,7 @@ public class ParamWrapper {
}
public
static
long
objectToAddress
(
Class
objectType
,
Object
object
)
{
if
(
SandHook
.
is64Bit
()
)
{
if
(
is64Bit
)
{
return
objectToAddress64
(
objectType
,
object
);
}
else
{
return
objectToAddress32
(
objectType
,
object
);
...
...
@@ -87,7 +93,7 @@ public class ParamWrapper {
}
else
if
(
objectType
==
char
.
class
)
{
return
(
char
)
object
;
}
else
if
(
objectType
==
boolean
.
class
)
{
return
object
==
Boolean
.
TRUE
?
1
:
0
;
return
Boolean
.
TRUE
.
equals
(
object
)
?
1
:
0
;
}
else
{
throw
new
RuntimeException
(
"unknown type: "
+
objectType
.
toString
());
}
...
...
@@ -111,7 +117,7 @@ public class ParamWrapper {
}
else
if
(
objectType
==
char
.
class
)
{
return
(
char
)
object
;
}
else
if
(
objectType
==
boolean
.
class
)
{
return
object
==
Boolean
.
TRUE
?
1
:
0
;
return
Boolean
.
TRUE
.
equals
(
object
)
?
1
:
0
;
}
else
{
throw
new
RuntimeException
(
"unknown type: "
+
objectType
.
toString
());
}
...
...
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