求大神帮忙把Python代码转成java代码
本帖最后由 dmvip 于 2023-4-11 17:29 编辑import base64
def ldg_decode(_0x582fe5):
_0x59c006 = 'ItLdg666'
_0x582fe5 = base64.b64decode(_0x582fe5.encode()).decode()
_0x27f6e9 = len(_0x59c006)
_0xeb6bd2 = ''
for i in range(len(_0x582fe5)):
_0x41b975 = i % _0x27f6e9
_0xeb6bd2 += chr(ord(_0x582fe5) ^ ord(_0x59c006))
return base64.b64decode(_0xeb6bd2).decode()
求大神帮忙把Python代码转成java代码
```
import java.nio.charset.StandardCharsets;
import java.util.Base64;
public class LDGDecoder {
private static final String KEY = "ItLdg666";
public static String ldg_decode(String input) {
byte[] decodedBytes = Base64.getDecoder().decode(input.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder(decodedBytes.length);
for (int i = 0; i < decodedBytes.length; i++) {
sb.append((char) (decodedBytes ^ KEY.charAt(i % KEY.length())));
}
byte[] decodedBytes2 = Base64.getDecoder().decode(sb.toString().getBytes(StandardCharsets.UTF_8));
return new String(decodedBytes2, StandardCharsets.UTF_8);
}
}
``` 这个参数是混淆过的 woaixue 发表于 2023-4-11 17:02
```
import java.nio.charset.StandardCharsets;
import java.util.Base64;
感谢大佬,谢谢 public static String ldg_decode(String _0x582fe5) {
String _0x59c006 = "ItLdg666";
_0x582fe5 = new String(Base64.getDecoder().decode(_0x582fe5.getBytes()));
int _0x27f6e9 = _0x59c006.length();
String _0xeb6bd2 = "";
for (int i = 0; i < _0x582fe5.length(); i++) {
int _0x41b975 = i % _0x27f6e9;
_xeb6bd2 += (char) (_0x582fe5.charAt(i) ^ _0x59c006.charAt(_0x41b975));
}
return new String(Base64.getDecoder().decode(_xeb6bd2.getBytes()));
}
public static void main(String[] args) {
String input = "aGVsbG8gd29ybGQ=";
String output = ldg_decode(input);
System.out.println(output);
}
不出意外这个意思
我想求大神把易语言源码转换成C++编译出来{:1_918:}
页:
[1]