PDA

View Full Version : Godfather Five Fams cheat



Dankness
12-30-2012, 01:21 AM
Just curious if anyone plays or has tried cheating in Kabams Godfather Five Fams, it's a flash based game. Using packet sniffing and curl posting I've managed to queue things like spamming attacks but nothing that useful.
Below is a quick example in PHP of a attack spammer, there are no comments or instructions u'll have to figure it out if u wanna use it.


I cut alot of this out from my version so it might require some adjusts before it will work.




<?php

function http_build_query_for_curl( $arrays, &$new = array(), $prefix = null ) {

if ( is_object( $arrays ) ) {
$arrays = get_object_vars( $arrays );
}

foreach ( $arrays AS $key => $value ) {
$k = isset( $prefix ) ? $prefix . '[' . $key . ']' : $key;
if ( is_array( $value ) OR is_object( $value ) ) {
http_build_query_for_curl( $value, $new, $k );
} else {
$new[$k] = $value;
}
}
}

// time it takes for attack to walk there and back.
$sleep_time = 30;

class City_Spammer {

// your world number
private $_world = 93;
// your city id
private $_city = '';
private $_player_id
private $_gangster_id;
private $_session_id;
private $_url;

public function __construct()
{
$this->_url = "http://realm{$this->_world}.c2.godfather.wonderhill.com/api/cities/{$this->_city}/marches.json";
}

public function send_troops()
{
// the troops u are sending, they have to actually exist in this hood.
$units = json_encode( array(
/*
'Undertaker' => 1265,
"Bruiser" => 2000,
"Doctor" => 1640,
"Smuggler" => 717,
"DeliveryTruck" => 300,
"Thug" => 650,
"Loanshark" => 1417,
"DRC" => 1000,
"Thug" => 1,
*/
"Smuggler" => 400,
"Bruiser" => 55,
"DeliveryTruck" => 300,
"Doctor" => 250,
));

$data = array(
'user_id' => $this->_player_id,
'gangster' => $this->_gangster_id,
'march[x]' => 278, // MI 1 cord X
'march[y]' => 474, // MI 1 cord Y
'city_id' => $this->city,
'march[units]' => $units,
'_session_id' => $this->_session_id, // session id
'march[floor]' => 1,
'_method' => 'post'
);

http_build_query_for_curl($data, $post);

$useragent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11";

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$result= curl_exec ($ch);
curl_close ($ch);

// display result
print $result;
}
}

$attack = new City_Spammer();
for ($i=0; $i < 10; $i++) {
$attack->send_troops();
sleep( $sleep_time );
}

Hazzah
12-31-2012, 07:56 PM
Just wondering, are the values saved on your computer, or are they client sided? If on your computer you can use a flash value editor like cheat engine.

Dankness
12-31-2012, 08:17 PM
Just wondering, are the values saved on your computer, or are they client sided? If on your computer you can use a flash value editor like cheat engine.

I would assume they'd be saved on there server, wouldn't be much of a game other wise lol.

From my tests, you actually have to have the troop values to send them and if u already have something queued in that slot then it will return a error.

One thing I was thinkin, was you could prolly download the SWF file, decompile it, edit it, then when u load the game, use the web inspector to change where it loads the SWF files from.

I was just curious someone asked me if it was possible to do since I do play the game, and I wrote the above script in 30mins or so.

footballjds
12-31-2012, 08:22 PM
Hey dankness! long time no see!

Dankness
12-31-2012, 08:41 PM
Hey dankness! long time no see!

I still lurk around. :spot: You didn't think I would just totally leave the community I worked very hard to build did u?