diff --git a/src/gfunction/Traps.go b/src/gfunction/Traps.go index 21274158..d592f31d 100644 --- a/src/gfunction/Traps.go +++ b/src/gfunction/Traps.go @@ -30,6 +30,18 @@ func Load_Traps() { GFunction: trapClass, } + MethodSignatures["java/io/ByteArrayInputStream.()V"] = + GMeth{ + ParamSlots: 0, + GFunction: trapClass, + } + + MethodSignatures["java/io/ByteArrayOutputStream.()V"] = + GMeth{ + ParamSlots: 0, + GFunction: trapClass, + } + MethodSignatures["java/io/CharArrayReader.()V"] = GMeth{ ParamSlots: 0, diff --git a/src/gfunction/javaLangInteger.go b/src/gfunction/javaLangInteger.go index 0b131423..4faf6b79 100644 --- a/src/gfunction/javaLangInteger.go +++ b/src/gfunction/javaLangInteger.go @@ -164,12 +164,14 @@ func integerDecode(params []interface{}) interface{} { } // Replace a leading "#" with "0x" in strArg. + wbase := 10 if strings.HasPrefix(strArg, "#") { - strArg = strings.Replace(strArg, "#", "0x", 1) + wbase = 16 + strArg = strArg[1:] } // Parse the input integer. - int64Value, err := strconv.ParseInt(strArg, 10, 64) + int64Value, err := strconv.ParseInt(strArg, wbase, 64) if err != nil { errMsg := fmt.Sprintf("strconv.ParseInt(%s,10,64) failed, failed, reason: %s", strArg, err.Error()) return getGErrBlk(excNames.NumberFormatException, errMsg)