Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Commit 76ff34d

Browse files
author
Checkium
committed
First Pre-Release
1 parent 06813f8 commit 76ff34d

27 files changed

+1391
-0
lines changed

.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="lib" path="C:/Users/Public/json-20160810.jar"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

.project

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>vHackAPI</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>

src/examples/ChatExample.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package examples;
2+
3+
import me.checkium.vhackapi.vHackAPI;
4+
import me.checkium.vhackapi.vHackAPIBuilder;
5+
import me.checkium.vhackapi.chat.ChatListener;
6+
import me.checkium.vhackapi.chat.ChatMessage;
7+
8+
public class ChatExample implements ChatListener {
9+
10+
vHackAPI api = new vHackAPIBuilder().password("pass").username("user").getAPI();
11+
12+
public void onChatMessage(ChatMessage message) {
13+
if (message.getMessage().contains("!test")) {
14+
api.getChat().sendChatMessage("@" + message.getAuthor() + " Testing");
15+
}
16+
}
17+
18+
}

src/examples/ConsoleExample.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package examples;
2+
3+
import java.util.ArrayList;
4+
5+
import me.checkium.vhackapi.vHackAPI;
6+
import me.checkium.vhackapi.vHackAPIBuilder;
7+
import me.checkium.vhackapi.console.ScanResult;
8+
import me.checkium.vhackapi.console.TransferResult;
9+
10+
public class ConsoleExample {
11+
public void hackExample(){
12+
vHackAPI api = new vHackAPIBuilder().password("pass").username("user").getAPI();
13+
ArrayList<String> ip = api.getConsole().getIPs(1, false, false);
14+
ArrayList<ScanResult> stats = api.getConsole().scanIPs(ip);
15+
16+
if(stats.get(0).getSuccessRate() <= 90 && stats.get(0).anonymous()) {
17+
ArrayList<TransferResult> transfer = api.getConsole().trTransferIPs(ip);
18+
if(transfer.get(0).getSuccess()){
19+
System.out.println("Got $" + transfer.get(0).getMoneyAmount());
20+
System.out.println("Gained " + transfer.get(0).getRepGained() + " rep.");
21+
}
22+
if(api.getAdwareManager().uploadAdware(ip.get(0))){
23+
System.out.println("Adware uploaded successfully.");
24+
}
25+
else{
26+
System.out.println("Failed to upload Adware.");
27+
}
28+
29+
}
30+
31+
32+
}
33+
}

src/examples/PackageExample.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package examples;
2+
3+
import me.checkium.vhackapi.vHackAPI;
4+
import me.checkium.vhackapi.vHackAPIBuilder;
5+
import me.checkium.vhackapi.others.PackageResult;
6+
7+
public class PackageExample {
8+
9+
vHackAPI api = new vHackAPIBuilder().password("pass").username("user").getAPI();
10+
11+
public void openPackage() {
12+
PackageResult openresult = api.getOthers().openPackage();
13+
System.out.println("Got " + openresult.getResultAmount() + api.humanizeString(openresult.getResultType().toString()));
14+
}
15+
}

src/examples/UpgradeExample.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package examples;
2+
3+
import me.checkium.vhackapi.vHackAPI;
4+
import me.checkium.vhackapi.vHackAPIBuilder;
5+
import me.checkium.vhackapi.upgrades.Task;
6+
import me.checkium.vhackapi.upgrades.UpgradeResult;
7+
import me.checkium.vhackapi.upgrades.UpgradeType;
8+
9+
public class UpgradeExample {
10+
11+
vHackAPI api = new vHackAPIBuilder().password("pass").username("user").getAPI();
12+
13+
public void addUpgrade() {
14+
UpgradeResult upgrade = api.getUpgradeManager().addUpdate(UpgradeType.adw);
15+
16+
if (upgrade == UpgradeResult.NoMoney || upgrade == UpgradeResult.Invalid || upgrade == UpgradeResult.NoMemory) {
17+
System.out.println("Fail");
18+
}
19+
if (upgrade == UpgradeResult.Success) {
20+
System.out.println("Success");
21+
}
22+
}
23+
24+
public void finishUpgrade() {
25+
Task task = api.getUpgradeManager().getTasks().get(0);
26+
if (api.getUpgradeManager().finishTask(task)) {
27+
System.out.println("Task finished with netcoins successfully");
28+
}
29+
}
30+
31+
public void abortUpgrade() {
32+
Task task = api.getUpgradeManager().getTasks().get(0);
33+
if (api.getUpgradeManager().abortTask(task)) {
34+
System.out.println("Task aborted successfully");
35+
}
36+
}
37+
}

src/me/checkium/vhackapi/Stats.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package me.checkium.vhackapi;
2+
3+
public enum Stats {
4+
5+
money, ip, inet, hdd, cpu, ram, fw, av, sdk, ipsp, spam, scan, adw, netcoins, bonus, rank, hash, id
6+
7+
}

src/me/checkium/vhackapi/Utils.java

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
package me.checkium.vhackapi;
2+
3+
import java.io.BufferedReader;
4+
import java.io.IOException;
5+
import java.io.InputStream;
6+
import java.io.InputStreamReader;
7+
import java.io.Reader;
8+
import java.net.MalformedURLException;
9+
import java.net.URL;
10+
import java.nio.charset.Charset;
11+
import java.security.MessageDigest;
12+
import java.security.NoSuchAlgorithmException;
13+
14+
import org.json.JSONException;
15+
import org.json.JSONObject;
16+
17+
public class Utils {
18+
public static String url;
19+
public static String md5s;
20+
public static String secret;
21+
static final boolean assertionstatus;
22+
private static final byte[] byt;
23+
24+
static {
25+
assertionstatus = !Utils.class.desiredAssertionStatus();
26+
url = "http://api.vhackxt.com/v/8/";
27+
md5s = "MD5";
28+
secret = "aeffl";
29+
byt = new byte[]{(byte) 65, (byte) 66, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 75, (byte) 76, (byte) 77, (byte) 78, (byte) 79, (byte) 80, (byte) 81, (byte) 82, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 97, (byte) 98, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 107, (byte) 108, (byte) 109, (byte) 110, (byte) 111, (byte) 112, (byte) 113, (byte) 114, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 48, (byte) 49, (byte) 50, (byte) 51, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 45, (byte) 95};
30+
}
31+
32+
public static String readJson(Reader rd) throws IOException {
33+
StringBuilder sb = new StringBuilder();
34+
int cp;
35+
while ((cp = rd.read()) != -1) {
36+
sb.append((char) cp);
37+
}
38+
return sb.toString();
39+
}
40+
41+
public static JSONObject JSONRequest(String format, String data, String php){
42+
JSONObject json = null;
43+
InputStream is;
44+
try {
45+
is = new URL(Utils.generateURL(format, data, php)).openStream();
46+
BufferedReader rd = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
47+
String jsonText = Utils.readJson(rd);
48+
if (jsonText.length() == 1) {
49+
return null;
50+
}
51+
json = new JSONObject(jsonText);
52+
53+
} catch (MalformedURLException e) {
54+
// TODO Auto-generated catch block
55+
e.printStackTrace();
56+
} catch (IOException e) {
57+
58+
// TODO Auto-generated catch block
59+
e.printStackTrace();
60+
}
61+
return json;
62+
}
63+
64+
private static byte[] m9179a(byte[] bArr, int i, int i2, byte[] bArr2, int i3, byte[] bArr3) {
65+
int i4 = 0;
66+
int i5 = (i2 > 1 ? (bArr[i + 1] << 24) >>> 16 : 0) | (i2 > 0 ? (bArr[i] << 24) >>> 8 : 0);
67+
if (i2 > 2) {
68+
i4 = (bArr[i + 2] << 24) >>> 24;
69+
}
70+
i4 |= i5;
71+
switch (i2) {
72+
case 1:
73+
bArr2[i3] = bArr3[i4 >>> 18];
74+
bArr2[i3 + 1] = bArr3[(i4 >>> 12) & 63];
75+
bArr2[i3 + 2] = (byte) 61;
76+
bArr2[i3 + 3] = (byte) 61;
77+
break;
78+
case 2:
79+
bArr2[i3] = bArr3[i4 >>> 18];
80+
bArr2[i3 + 1] = bArr3[(i4 >>> 12) & 63];
81+
bArr2[i3 + 2] = bArr3[(i4 >>> 6) & 63];
82+
bArr2[i3 + 3] = (byte) 61;
83+
break;
84+
case 3:
85+
bArr2[i3] = bArr3[i4 >>> 18];
86+
bArr2[i3 + 1] = bArr3[(i4 >>> 12) & 63];
87+
bArr2[i3 + 2] = bArr3[(i4 >>> 6) & 63];
88+
bArr2[i3 + 3] = bArr3[i4 & 63];
89+
break;
90+
}
91+
return bArr2;
92+
}
93+
94+
public static String generateUser(byte[] bArr, int i, int i2, byte[] bArr2, boolean z) {
95+
byte[] a = assertion(bArr, i, i2, bArr2, Integer.MAX_VALUE);
96+
int length = a.length;
97+
while (!z && length > 0 && a[length - 1] == 61) {
98+
length--;
99+
}
100+
return new String(a, 0, length);
101+
}
102+
103+
public static final String encryptString(String str) {
104+
try {
105+
MessageDigest instance = MessageDigest.getInstance(md5s);
106+
instance.update(str.getBytes());
107+
byte[] digest = instance.digest();
108+
StringBuilder stringBuilder = new StringBuilder();
109+
for (byte b : digest) {
110+
String toHexString = Integer.toHexString(b & 255);
111+
while (toHexString.length() < 2) {
112+
toHexString = "0" + toHexString;
113+
}
114+
stringBuilder.append(toHexString);
115+
}
116+
return stringBuilder.toString();
117+
} catch (NoSuchAlgorithmException e) {
118+
e.printStackTrace();
119+
return "";
120+
}
121+
}
122+
123+
public static byte[] assertion(byte[] bArr, int i, int i2, byte[] bArr2, int i3) {
124+
int i4 = ((i2 + 2) / 3) * 4;
125+
byte[] bArr3 = new byte[(i4 + (i4 / i3))];
126+
int i5 = i2 - 2;
127+
int i6 = 0;
128+
int i7 = 0;
129+
int i8 = 0;
130+
while (i8 < i5) {
131+
i4 = (((bArr[i8 + i] << 24) >>> 8) | ((bArr[(i8 + 1) + i] << 24) >>> 16)) | ((bArr[(i8 + 2) + i] << 24) >>> 24);
132+
bArr3[i7] = bArr2[i4 >>> 18];
133+
bArr3[i7 + 1] = bArr2[(i4 >>> 12) & 63];
134+
bArr3[i7 + 2] = bArr2[(i4 >>> 6) & 63];
135+
bArr3[i7 + 3] = bArr2[i4 & 63];
136+
i4 = i6 + 4;
137+
if (i4 == i3) {
138+
bArr3[i7 + 4] = (byte) 10;
139+
i7++;
140+
i4 = 0;
141+
}
142+
i8 += 3;
143+
i7 += 4;
144+
i6 = i4;
145+
}
146+
if (i8 < i2) {
147+
m9179a(bArr, i8 + i, i2 - i8, bArr3, i7, bArr2);
148+
if (i6 + 4 == i3) {
149+
bArr3[i7 + 4] = (byte) 10;
150+
i7++;
151+
}
152+
i7 += 4;
153+
}
154+
if (assertionstatus || i4 == bArr3.length) {
155+
return bArr3;
156+
}
157+
throw new AssertionError();
158+
}
159+
160+
161+
public static String generateURL(String str, String str2, String str3) {
162+
String[] strArr = new String[2];
163+
String[] split = str.split("::::");
164+
String[] split2 = str2.split("::::");
165+
long currentTimeMillis = System.currentTimeMillis() / 1000;
166+
String str4 = "{";
167+
JSONObject jSONObject = new JSONObject();
168+
for (int i = 0; i < split.length; i++) {
169+
try {
170+
jSONObject.put(split[i], split2[i]);
171+
} catch (JSONException e) {
172+
e.printStackTrace();
173+
}
174+
}
175+
try {
176+
jSONObject.put("time", currentTimeMillis + "");
177+
} catch (JSONException e2) {
178+
e2.printStackTrace();
179+
}
180+
str4 = jSONObject.toString();
181+
byte[] bytes = str4.getBytes();
182+
String a = generateUser(bytes, 0, bytes.length, byt, false);
183+
String a2 = encryptString(str4.length() + encryptString(currentTimeMillis + ""));
184+
String str5 = split2[0] + "" + encryptString(encryptString(split2[1]));
185+
str4 = encryptString(currentTimeMillis + "" + str4);
186+
byte[] bytes2 = a2.getBytes();
187+
byte[] bytes3 = str5.getBytes();
188+
byte[] bytes4 = str4.getBytes();
189+
a2 = encryptString(secret + encryptString(encryptString(generateUser(bytes2, 0, bytes2.length, byt, false))));
190+
str5 = generateUser(bytes3, 0, bytes3.length, byt, false);
191+
str4 = encryptString(encryptString(a2 + encryptString(encryptString(str5) + generateUser(bytes4, 0, bytes4.length, byt, false))));
192+
strArr[0] = a;
193+
strArr[1] = str4;
194+
return url + str3 + "?user=" + a + "&pass=" + str4;
195+
}
196+
197+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package me.checkium.vhackapi.chat;
2+
3+
import me.checkium.vhackapi.vHackAPI;
4+
5+
public class Chat {
6+
7+
8+
public void addListener(ChatListener listener, vHackAPI api) {
9+
Initiater ini = new Initiater();
10+
ini.addListener(listener, api);
11+
}
12+
13+
public void sendChatMessage(String message) {
14+
ChatUtils.sendChatMessage(message);
15+
}
16+
17+
public void chatMessage(String raw) {
18+
Initiater ini = new Initiater();
19+
ini.chatMessage(raw);
20+
}
21+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package me.checkium.vhackapi.chat;
2+
3+
public interface ChatListener {
4+
void onChatMessage(ChatMessage message);
5+
}
6+

0 commit comments

Comments
 (0)