Hướng dẫn tạo tweak MobileSubstrate hack game 22nd June 2013, 9:59 pm
Chào các thành viên HiP,
Thể theo y/c của thành viên KizzLil™, nhờ mình viết một bài hướng dẫn về cách h@ck game theo phương pháp tạo tweak của MobileSubstrate
Các h@ck này cũng khá phổ biến trong thời gian gần đây
Yêu cầu iphone phải cài
1. MobileTerminal, APT 0.7 (Strict), BigBoss Recommended Tools Package
2. iFile
3. Perl
4. THEOS
5. SDK
1. Hướng dẫn install MobileTerminal
Vào cydia tìm mobile Terminal,APT 0.7 (Strict), BigBoss Recommended Tools Package để install
2. Hướng dẫn install iFile
Vào cydia tìm iFile để install
3. Hướng dẫn install Perl và THEOS
Vào thư mục /etc/apt/sources.list.d tạo thêm một file coredev.nl.list chứa nội dung bên dưới
Mã:
deb http://coredev.nl/cydia iphone main
Vào thư mục /etc/apt/sources.list.d tạo thêm một file howett.net.list chứa nội dung bên dưới
Mã:
deb http://nix.howett.net/theos ./
Cách 2 có thể mở cydia lên add source http://nix.howett.net/theos tại mình khoái dùng lệnh cách 1 hơn.
Sau đó mở mobile Terminal lên su vào root để update và install gói perl và gói net.howett.theos
Mã:
mobile# su - root
root# apt-get update
root# apt-get install perl net.howett.theos
5. Hướng dẫn install gói SDK
mở mobile Terminal lên su vào root để install
Mã:
installsdk3
Nên nắm vững 5 bước cần thực hiện:
Bước 1: "Dump Class" -> xuất hết các class của file game
Bước 2: Tạo Tweak
Bước 3: Tạo function cần h@ck
Bước 4: Tạo Bundles vd: com.heaveniphone.game1
Bước 5: Biên dịch lại tweak
Mình sẽ làm hướng dẫn h@ck game "Tiny Towers" theo youtube bên dưới nhé, để cho anh em tiện hình dung cách làm
Lên iphone store heaveniphone trên safari tại link http://ipa.heaveniphone.com để install "Tiny Towers"
Bước 1: Vào thư mục /var/mobile/Application/Tiny Towner Copy file Tiny Towner khoảng 3,7M vào thư mục /var/mobile và đổi tên vd thành 1
Bước 2: Đứng tại thư mục /var/mobile tạo một thư mục bất kỳ vd tt thư mục này để chứa các file dump classs
Bước 3: mở terminal su vào root gõ lệnh
Mã:
$THEOS/bin/nic.pl
sau đó số 5 vào để chọn mục 5
Sau đó gõ tên Project là TinyTower
Chú ý thư mục tinytower đang nằm ở thư mục /var/root
vd:
root# $THEOS/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/library
[3.] iphone/preference_bundle
[4.] iphone/tool
[5.] iphone/tweak
Choose a Template (required): 5
Bước 4: Dump tất cả các classe của file 1 bước 1 vào thư mục tt
Mã:
class-dump -H /var/mobile/1 -o /var/mobile/tt/
Sau đó vào thư mục tt tìm file TTGameData.h Chúng ta đoán và thấy có 2 function
- (int)bux;
- (int)coins;
Copy 2 hàm đó lại
Bước 5: Chỉnh sửa lại file /var/root/tinytower/Tweak.xm thêm vào các dòng bên dưới
Mã:
%hook TTGameData
- (int)bux {
return 999999;
}
- (int)coins {
return 999999;
}
%end
Bước 6: Mở thư mục game tìm file info.plist có chứa Bundles vd : com.eeenmachine.tinytowers
Bước 7: copy Bundles vừa tìm được và edit file /var/root/tinytower/TinyTower.plist đúng thông tin
vd:
Mã:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Bundles</key>
<array>
<string>com.eeenmachine.tinytowers</string>
</array>
</dict>
</dict>
</plist>
Bước 8: mở terminal su vào root vào thư mục /var/root/tinytower gõ lệnh make
Mã:
make
Bước 9: Sau khi make xong
copy file 2 file TinyTower.dylib, TinyTower.plist vào thư mục /Library/MobileSubstrate/DynamicLibraries
Bước 10: repring lại hệ thống và kết quả như mong muốn
Click here to view the original image of 640x1136px.
Bài viết này được test trên iphone 5 IOS 6.1.2 nếu gặp lỗi Illegal instruction: 4
vui lòng xem link http://heaveniphone.com/threads/1268...on-4-quot.html để biết cách fix
mọi chi tiết liên hệ nick yahoo 055099 gặp lptrung
Một số lệnh cần tham khảo
Mã:
%hook Header1
- (int)h@ckOne {
return 9999;
}
- (BOOL)h@ckTwo {
return true;
}
- (float)h@ckThree {
return 9999.0f;
}
%end
%hook Header2
- (int)h@ckFour {
return 9999;
}
%hook UIAlertView // The class you will override
-(void)alert { // method to override
[self setTitle:@"new title"]; // write custom code
%orig; // Then call original method to finish the original code
}
%end //end hooking uialertview
======
%hook UserData
- (void)setNextExp(int)fp8;{
fb8=0000;
%orig(fp8);
}
- (int)nextExp;{
return 0000;
}
- (void)setCardMax(int)fp8;{
fb8=9999;
%orig(fb8);
}
- (int)cardMax;{
return 9999
}
%end
Hướng dẫn sử dụng $THEOS trên mac để build Tweak Mobisubtrate
Mã:
export THEOS=/opt/theos
git clone git://github.com/DHowett/theos.git $THEOS
curl -s http://cydia.heaveniphone.com/deb_commands_ios/ldid > $THEOS/bin/ldid; chmod +x $THEOS/bin/ldid
Thể theo y/c của thành viên KizzLil™, nhờ mình viết một bài hướng dẫn về cách h@ck game theo phương pháp tạo tweak của MobileSubstrate
Các h@ck này cũng khá phổ biến trong thời gian gần đây
Yêu cầu iphone phải cài
1. MobileTerminal, APT 0.7 (Strict), BigBoss Recommended Tools Package
2. iFile
3. Perl
4. THEOS
5. SDK
1. Hướng dẫn install MobileTerminal
Vào cydia tìm mobile Terminal,APT 0.7 (Strict), BigBoss Recommended Tools Package để install
2. Hướng dẫn install iFile
Vào cydia tìm iFile để install
3. Hướng dẫn install Perl và THEOS
Vào thư mục /etc/apt/sources.list.d tạo thêm một file coredev.nl.list chứa nội dung bên dưới
Mã:
deb http://coredev.nl/cydia iphone main
Vào thư mục /etc/apt/sources.list.d tạo thêm một file howett.net.list chứa nội dung bên dưới
Mã:
deb http://nix.howett.net/theos ./
Cách 2 có thể mở cydia lên add source http://nix.howett.net/theos tại mình khoái dùng lệnh cách 1 hơn.
Sau đó mở mobile Terminal lên su vào root để update và install gói perl và gói net.howett.theos
Mã:
mobile# su - root
root# apt-get update
root# apt-get install perl net.howett.theos
5. Hướng dẫn install gói SDK
mở mobile Terminal lên su vào root để install
Mã:
installsdk3
Nên nắm vững 5 bước cần thực hiện:
Bước 1: "Dump Class" -> xuất hết các class của file game
Bước 2: Tạo Tweak
Bước 3: Tạo function cần h@ck
Bước 4: Tạo Bundles vd: com.heaveniphone.game1
Bước 5: Biên dịch lại tweak
Mình sẽ làm hướng dẫn h@ck game "Tiny Towers" theo youtube bên dưới nhé, để cho anh em tiện hình dung cách làm
Lên iphone store heaveniphone trên safari tại link http://ipa.heaveniphone.com để install "Tiny Towers"
Bước 1: Vào thư mục /var/mobile/Application/Tiny Towner Copy file Tiny Towner khoảng 3,7M vào thư mục /var/mobile và đổi tên vd thành 1
Bước 2: Đứng tại thư mục /var/mobile tạo một thư mục bất kỳ vd tt thư mục này để chứa các file dump classs
Bước 3: mở terminal su vào root gõ lệnh
Mã:
$THEOS/bin/nic.pl
sau đó số 5 vào để chọn mục 5
Sau đó gõ tên Project là TinyTower
Chú ý thư mục tinytower đang nằm ở thư mục /var/root
vd:
root# $THEOS/bin/nic.pl
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/application
[2.] iphone/library
[3.] iphone/preference_bundle
[4.] iphone/tool
[5.] iphone/tweak
Choose a Template (required): 5
Bước 4: Dump tất cả các classe của file 1 bước 1 vào thư mục tt
Mã:
class-dump -H /var/mobile/1 -o /var/mobile/tt/
Sau đó vào thư mục tt tìm file TTGameData.h Chúng ta đoán và thấy có 2 function
- (int)bux;
- (int)coins;
Copy 2 hàm đó lại
Bước 5: Chỉnh sửa lại file /var/root/tinytower/Tweak.xm thêm vào các dòng bên dưới
Mã:
%hook TTGameData
- (int)bux {
return 999999;
}
- (int)coins {
return 999999;
}
%end
Bước 6: Mở thư mục game tìm file info.plist có chứa Bundles vd : com.eeenmachine.tinytowers
Bước 7: copy Bundles vừa tìm được và edit file /var/root/tinytower/TinyTower.plist đúng thông tin
vd:
Mã:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Filter</key>
<dict>
<key>Bundles</key>
<array>
<string>com.eeenmachine.tinytowers</string>
</array>
</dict>
</dict>
</plist>
Bước 8: mở terminal su vào root vào thư mục /var/root/tinytower gõ lệnh make
Mã:
make
Bước 9: Sau khi make xong
copy file 2 file TinyTower.dylib, TinyTower.plist vào thư mục /Library/MobileSubstrate/DynamicLibraries
Bước 10: repring lại hệ thống và kết quả như mong muốn
Click here to view the original image of 640x1136px.
Bài viết này được test trên iphone 5 IOS 6.1.2 nếu gặp lỗi Illegal instruction: 4
vui lòng xem link http://heaveniphone.com/threads/1268...on-4-quot.html để biết cách fix
mọi chi tiết liên hệ nick yahoo 055099 gặp lptrung
Một số lệnh cần tham khảo
Mã:
%hook Header1
- (int)h@ckOne {
return 9999;
}
- (BOOL)h@ckTwo {
return true;
}
- (float)h@ckThree {
return 9999.0f;
}
%end
%hook Header2
- (int)h@ckFour {
return 9999;
}
%hook UIAlertView // The class you will override
-(void)alert { // method to override
[self setTitle:@"new title"]; // write custom code
%orig; // Then call original method to finish the original code
}
%end //end hooking uialertview
======
%hook UserData
- (void)setNextExp(int)fp8;{
fb8=0000;
%orig(fp8);
}
- (int)nextExp;{
return 0000;
}
- (void)setCardMax(int)fp8;{
fb8=9999;
%orig(fb8);
}
- (int)cardMax;{
return 9999
}
%end
Hướng dẫn sử dụng $THEOS trên mac để build Tweak Mobisubtrate
Mã:
export THEOS=/opt/theos
git clone git://github.com/DHowett/theos.git $THEOS
curl -s http://cydia.heaveniphone.com/deb_commands_ios/ldid > $THEOS/bin/ldid; chmod +x $THEOS/bin/ldid
Message reputation : 100% (1 vote) |