从聊天程序 [exe 文件] 读取 input/output
Reading input/output from Chatting program[exe file]
我试过的
try {
File fileDir = new File("B:\Palringo\palringo.exe");
BufferedReader in = new BufferedReader(
new InputStreamReader(
new FileInputStream("B:\Palringo\palringo.exe"), "UTF8"));
String str;
while ((str = in.readLine()) != null) {
System.out.println(str);
}
in.close();
}
catch (UnsupportedEncodingException e)
{
System.out.println(e.getMessage());
}
输出 :
unreadable Strings
我想要什么
我想控制 (palringo.exe) 所以我可以为它制作 Bot
什么是palringo.exe?:
这是一个聊天程序,您可以下载它或使用网页版 (palringo.im)。
我打开一个 exe 文件是不是做错了?我应该通过 Connection 类 in java 连接到网站吗?如果是这样,我如何连接它?
这行不通。您无法读取 exe 文件。
您需要有源代码或库才能将该软件添加到您的代码中。您根本无法读取 exe 文件并提取代码,因为 exe 文件将被加密并且将使用较低级别的语言。
但是你可以使用exec()
到运行那个exe文件。
我知道这是一个很晚的答案,如果你想连接和操作 palringo,有几个可用的 API。
https://github.com/calico-crusade/PalringoApi
这个特定的也可以在 Nuget 上找到,尽管它是针对 C# 的。如果您愿意,可以将大部分连接代码复制到 Java。
我试过的
try {
File fileDir = new File("B:\Palringo\palringo.exe");
BufferedReader in = new BufferedReader(
new InputStreamReader(
new FileInputStream("B:\Palringo\palringo.exe"), "UTF8"));
String str;
while ((str = in.readLine()) != null) {
System.out.println(str);
}
in.close();
}
catch (UnsupportedEncodingException e)
{
System.out.println(e.getMessage());
}
输出 :
unreadable Strings
我想要什么
我想控制 (palringo.exe) 所以我可以为它制作 Bot
什么是palringo.exe?:
这是一个聊天程序,您可以下载它或使用网页版 (palringo.im)。
我打开一个 exe 文件是不是做错了?我应该通过 Connection 类 in java 连接到网站吗?如果是这样,我如何连接它?
这行不通。您无法读取 exe 文件。
您需要有源代码或库才能将该软件添加到您的代码中。您根本无法读取 exe 文件并提取代码,因为 exe 文件将被加密并且将使用较低级别的语言。
但是你可以使用exec()
到运行那个exe文件。
我知道这是一个很晚的答案,如果你想连接和操作 palringo,有几个可用的 API。
https://github.com/calico-crusade/PalringoApi
这个特定的也可以在 Nuget 上找到,尽管它是针对 C# 的。如果您愿意,可以将大部分连接代码复制到 Java。