Created
December 17, 2022 15:23
-
-
Save dannycreations/eeebcd1e51ab8f765f373747f983ac8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://reverseengineering.stackexchange.com/a/25183 | |
function byteToHex(byte) { | |
var HexClass = Java.use('org.apache.commons.codec.binary.Hex') | |
var StringClass = Java.use('java.lang.String') | |
var hexChars = HexClass.encodeHex(byte) | |
return StringClass.$new(hexChars).toString() | |
} | |
// https://reverseengineering.stackexchange.com/a/22255 | |
function byteToString(byte) { | |
var result = '' | |
var buffer = Java.array('byte', byte) | |
for (var i = 0; i < buffer.length; ++i) { | |
result += (String.fromCharCode(buffer[i] & 0xff)) | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment