Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for v7 #20

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
node_modules/
package-lock.json
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# vHack-MoneyBot
## UPDATE: Outdated, my account got banned, I lost motivation to continue this. If anyone wants to, you are free to fork this project and continue it on your own. Good luck.
## Works with the latest v7

NOTE: I made this bot because I was BORED, NOT because I want to ruin the game. By downloading and using this bot you agree that I, the creator, cannot be held responsible for any action taken against you (getting banned, etc.)

Expand All @@ -12,9 +12,15 @@ In order to install vHack-MoneyBot you must download all of the required modules
```sh
$ npm install md5
$ npm install request
$ npm install chalk
```
Or run the included InstallDependencies files for your operating system.

Or if you're familiar with node just run
```sh
$ npm install
```

### Usage
To use vHack-MoneyBot, you must first put your login credentials into the config.json
![N|Solid](https://i.gyazo.com/d40e8ab9a4a5a36cee6325acd5a7a1d8.png)
Expand Down
6 changes: 1 addition & 5 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
{
"userName": "MyExampleUsername",
"userPass": "MyExamplePassword",
"uHashStr": "7065a44fe0e82d13785d855f03e5e109300cb1cf95c5c59405e5d552856d0590"
}
{"userName":"ChangeMe","userPass":"ChangeMe","uHashStr":"85296c8e73903813d432d7c837250019742093b6b4fb0408a5a1e55285e1c52d"}
31 changes: 31 additions & 0 deletions logger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
let chalk = require('chalk');

class Logger {
constructor(logLevel) {
this.logLevel = logLevel;
}

w(msg) {
console.log(chalk.yellow('[w]') + ' ' + chalk.white(msg));
}

i(msg) {
console.log(chalk.cyan('[i]') + ' ' + chalk.white(msg));
}

e(msg) {
console.log(chalk.red('[e]') + ' ' + chalk.red(msg));
}

s(msg) {
console.log(chalk.green('[s]') + ' ' + chalk.white(msg));
}

d(msg) {
if (this.logLevel > 0) {
console.log(chalk.white('[d]') + ' ' + chalk.white(msg));
}
}
}

module.exports = new Logger(0);
2 changes: 1 addition & 1 deletion methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const fs = require('fs');

class Methods {
constructor() {
this.baseURL = 'https://api.vhack.cc/v/4/'; // Changes with updates
this.baseURL = 'https://api.vhack.cc/v/7/'; // Changes with updates
this.config = this.parseJSON(fs.readFileSync('./config.json'));
}

Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vhack-bot",
"version": "4.0.0",
"version": "7.0.0",
"description": "Automatically hack people in the android game vHack XT",
"main": "vHack.js",
"scripts": {
Expand All @@ -18,13 +18,14 @@
"vhack_cheats"
],
"dependencies": {
"md5": "*",
"request": "*"
"chalk": "^2.0.1",
"md5": "^2.2.1",
"request": "^2.81.0"
},
"author": "MrSonicMaster",
"license": "MIT",
"bugs": {
"url": "https://github.com/MrSonicMaster/vHackXT-MoneyBot/issues"
},
"homepage": "https://github.com/MrSonicMaster/vHackXT-MoneyBot#readme"
}
}
65 changes: 40 additions & 25 deletions vHack.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
const Methods = require('./methods.js');
let chalk = require("chalk");
const log = require('./logger.js');

class vHackBot { // Due to API update v3, having multiple 'clients' seems to no longer be possible.
constructor(clientID) {
this.delayBetweenActions = 2400; // In milliseconds.
this.delayBetweenActions = Math.random() * 1000 + 2000; // In milliseconds.
log.i('Initialised with a random delay of ' + this.delayBetweenActions);
this.clientID = clientID || 0;
this.isGlobalSearch = 1;
this.debugLevel = 0; // Log level-4 (0=normal, 4=debug)
Expand All @@ -21,19 +24,18 @@ class vHackBot { // Due to API update v3, having multiple 'clients' seems to no
}

login() {
this.log('Starting login...', 0);
Methods.getUserInfo((userInfo) => {
if (userInfo.toString().includes('Fatal')) return this.log(userInfo);
if (!userInfo.ip) return this.log('Fatal Error: Invalid login credentials, script will exit.'), process.exit(0);
this.log(`Logged in; userIP=${userInfo.ip}`);
log.i('Logged in with IP ' + userInfo.ip);
Methods.updateUHashStr(userInfo.uhash);
setTimeout(this.getPlayerList.bind(this), this.delayBetweenActions);
this.log(`Got user data ${JSON.stringify(userInfo)}`, 4);
});
}

getPlayerList() {
this.log('Get new player list.');
log.i('Getting new player list.');
Methods.getPlayerList(this.isGlobalSearch, (playerList) => {
if (playerList.toString().includes('Fatal')) return setTimeout(this.getPlayerList.bind(this), this.delayBetweenActions);
this.parsePlayerList(playerList);
Expand All @@ -50,7 +52,9 @@ class vHackBot { // Due to API update v3, having multiple 'clients' seems to no
const watchedByFBI = Methods.imageToText(player.img, false, (result) => {
if (result.toLowerCase().includes("firewall") && !result.toLowerCase().includes("FBI")) {
this.resolveIPFromHostname(playerHostname);
} else this.log(`Saved from attacking an FBI watched host.`);
} else {
log.w(`Saved from attacking an FBI watched host. (player is protected by firewall or FBI)`);
}
if ((i + 1) == playerList.length) setTimeout(this.getPlayerList.bind(this), this.delayBetweenActions);
});
}, i * this.delayBetweenActions);
Expand All @@ -77,32 +81,43 @@ class vHackBot { // Due to API update v3, having multiple 'clients' seems to no
}

loadRemoteData(playerIP) {
Methods.loadRemoteData(playerIP, (result) => {
if (result.toString().includes('Fatal')) return this.log(result);
if (this.ignoreWhenNotAnonymous && result.anonymous == "NO") return; // We don't want to risk attacking someone who would come back and destroy us.
Methods.imageToText(result.img, true, (password) => {
for (let i = 1; i <= 6; i++) { // 6 is the amount of password choices sent.
const checkPassword = result['p' + i].toString();
const passwordMatched = Methods.checkPassword(checkPassword, password.toString());
this.log(`Checking passord ${checkPassword} with password ${password}, match? ${passwordMatched}.`, 1);
if (passwordMatched) {
setTimeout(() => {
this.hackPlayer(playerIP, i);
}, this.delayBetweenActions);
this.log(`Player queued to hack. userIP=${result.ipaddress}, userName=${result.username}, money=$${result.money.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")}.`, 1);
break; // We got a password match, don't test any other passwords.
}
}
});
});
if (/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(playerIP)) {
log.i("Attacking " + playerIP);
Methods.loadRemoteData(playerIP, (result) => {
if (result.toString().includes('Fatal')) return this.log(result);
// if (this.ignoreWhenNotAnonymous && result.anonymous == "NO") return; // We don't want to risk attacking someone who would come back and destroy us.
Methods.imageToText(result.img, true, (password) => {
for (let i = 1; i <= 6; i++) { // 6 is the amount of password choices sent.
const checkPassword = result['p' + i].toString();
const passwordMatched = Methods.checkPassword(checkPassword, password.toString());
this.log(`Checking passord ${checkPassword} with password ${password}, match? ${passwordMatched}.`, 1);
if (passwordMatched) {
setTimeout(() => {
this.hackPlayer(playerIP, i);
}, this.delayBetweenActions);
this.log(`Player queued to hack. userIP=${result.ipaddress}, userName=${result.username}, money=$${result.money.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")}.`, 1);
break; // We got a password match, don't test any other passwords.
}
}
});
});
} else {
log.w(playerIP + ' is NOT a valid IP address (i have no idea why it\'s returning non valid IP addresses)');
}

}

hackPlayer(playerIP, port) {
Methods.hackPlayer(playerIP, port, (result) => {
if (result.toString().includes('Fatal')) return this.log(result);
this.log(`Hacked player ${playerIP} result ${JSON.stringify(result)}`, 4);
if (result.result == "0") this.log(`Gained: $${result.amount.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")}. New money amount: $${result.newmoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,")}.`);
});
if (result.result == "0") {
let gained = result.amount.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
let total = result.newmoney.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
log.s('Gained $' + gained);
log.s('New total amount $' + total);
}
});
}

log(message, logLevel = 0) {
Expand Down