├── .github └── ISSUE_TEMPLATE │ ├── bug-report.md │ └── issue--task-template.md ├── LICENSE ├── README.md ├── apk └── gta_vc.apk ├── scripts ├── main.scm └── main.txt └── src ├── Android.mk ├── Application.mk ├── game ├── camera.cpp ├── camera.h ├── game.cpp ├── game.h ├── hooks.cpp ├── patches.cpp ├── patches.h ├── scripting.cpp └── scripting.h ├── main.cpp ├── main.h └── util ├── address.h ├── memory.cpp ├── memory.h ├── util.cpp └── util.h /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug 4 | title: 'BUG: bug name' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | # Description 11 | 12 | # Device information 13 | **OS:** 14 | **Device name:** 15 | **Additional tools:** 16 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue--task-template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 'Issue: Task template' 3 | about: Ready to work task issue. 4 | title: 'TASK-TAG: Task Title' 5 | labels: "\U0001F527 DEV-Task" 6 | assignees: '' 7 | 8 | --- 9 | 10 | # Description 11 | Full description of task 12 | 13 | # List of functionality requirements 14 | - [ ] Task No. 1 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2024-present Evstegneev (fet1sov) Konstantin 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #  Vice City Multiplayer for Android OS 2 |  3 | #### The open source multiplayer modification of GTA:VC on Android OS 4 | #### © fet1sov 5 | 6 | 7 | 8 | # How to build: 9 | 1. [Download a NDK](https://developer.android.com/ndk/downloads) 10 | 2. Unzip a NDK in folder 11 | 3. In NDK folder create folder "jni" 12 | 4. Download a sources from GitHub 13 | 5. Unzip sources in folder "jni" 14 | 6. Start the ndk-build.bat 15 | 7. After library was built go to: "libs/armeabi-v7a" 16 | 8. Insert the libVCMP.so in APK from sources (Its important cause original APK doenst work properly) 17 | 9. Install APK 18 | 10. Enjoy :) 19 | 20 | # ScreenShots 21 |
22 |
23 |
First day of Developing
25 | -------------------------------------------------------------------------------- /apk/gta_vc.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fet1sov/VCMP-Android/b342a5701c0f0603c818877d5699b385cfa1cfb9/apk/gta_vc.apk -------------------------------------------------------------------------------- /scripts/main.scm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fet1sov/VCMP-Android/b342a5701c0f0603c818877d5699b385cfa1cfb9/scripts/main.scm -------------------------------------------------------------------------------- /scripts/main.txt: -------------------------------------------------------------------------------- 1 | DEFINE OBJECTS 1 2 | DEFINE OBJECT SANNY BUILDER 3.2.2 3 | 4 | DEFINE MISSIONS 0 5 | 6 | //============== MAIN ================= 7 | 03A4: name_thread 'MAIN' 8 | fade 0 0 9 | 042C: set_total_missions_to 0 10 | 030D: set_total_mission_points_to 0 11 | 01F0: set_max_wanted_level_to 6 12 | 02ED: set_total_hidden_packages_to 0 13 | 0111: set_wasted_busted_check_to 0 14 | 00C0: set_current_time 12 0 15 | 01EB: set_traffic_density_multiplier_to 0.0 16 | 03DE: set_pedestrians_density_multiplier_to 0.0 17 | 04E4: unknown_refresh_game_renderer_at 468.7745 -1298.623 18 | 03CB: set_camera 468.7745 -1298.623 11.0712 19 | 0053: $PLAYER_CHAR = create_player #NULL at 468.7745 -1298.623 11.0712 20 | 01F5: $PLAYER_ACTOR = create_emulated_actor_from_player $PLAYER_CHAR 21 | 0180: set_on_mission_flag_to $ONMISSION 22 | fade 1 0 23 | wait 0 24 | if 25 | Player.Defined($PLAYER_CHAR) 26 | jf @MAIN_188 27 | set_weather 0 28 | 01B5: force_weather 0 29 | if 30 | not Actor.Dead($PLAYER_ACTOR) 31 | jf @MAIN_188 32 | 0352: set_actor $PLAYER_ACTOR skin_to 'PLAYER' 33 | 038B: load_requested_models 34 | if 35 | not Actor.Dead($PLAYER_ACTOR) 36 | jf @MAIN_188 37 | 0353: refresh_actor $PLAYER_ACTOR 38 | 39 | :MAIN_188 40 | wait 0 41 | select_interior 0 42 | Player.CanMove($PLAYER_CHAR) = False 43 | Camera.SetPosition(-1000.0, 191.5, 12.0, 0.0, 0.0, 0.0) 44 | Camera.PointAt(-1000.0, 185.5, 11.5, 2) 45 | 46 | :MAIN_203 47 | wait 1500 48 | jump @MAIN_203 49 | 50 | end_thread 51 | return 52 | //==================================== -------------------------------------------------------------------------------- /src/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := VCMP 6 | LOCAL_LDLIBS := -llog -lEGL -lGLESv2 7 | FILE_LIST := $(wildcard $(LOCAL_PATH)/*.cpp) 8 | FILE_LIST += $(wildcard $(LOCAL_PATH)/game/*.cpp) 9 | FILE_LIST += $(wildcard $(LOCAL_PATH)/util/*.cpp) 10 | 11 | LOCAL_SRC_FILES += $(FILE_LIST:$(LOCAL_PATH)/%=%) 12 | 13 | LOCAL_CPPFLAGS += -D_ARM_ -D_RAKNET_THREADSAFE 14 | LOCAL_CPPFLAGS += -w -pthread -fpack-struct=1 -Wall -fdiagnostics-color=auto -O2 -ffast-math -std=c++11 15 | include $(BUILD_SHARED_LIBRARY) 16 | -------------------------------------------------------------------------------- /src/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := armeabi-v7a arm64-v8a 2 | APP_PLATFORM := android-16 3 | APP_MODULES := VCMP 4 | APP_STL := c++_static -------------------------------------------------------------------------------- /src/game/camera.cpp: -------------------------------------------------------------------------------- 1 | #include "../main.h" 2 | #include "camera.h" 3 | 4 | void CCamera::SetBehindPlayer() 5 | { 6 | ScriptCommand(&set_camera_behind_player); 7 | } -------------------------------------------------------------------------------- /src/game/camera.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CCamera 4 | { 5 | public: 6 | CCamera() { } 7 | ~CCamera() {} 8 | 9 | void SetBehindPlayer(); 10 | }; -------------------------------------------------------------------------------- /src/game/game.cpp: -------------------------------------------------------------------------------- 1 | #include "../main.h" 2 | #include "game.h" 3 | 4 | void InitScripting(); 5 | void InstallHooks(); 6 | 7 | CGame::CGame() 8 | { 9 | m_pGameCamera = new CCamera(); 10 | } 11 | 12 | void CGame::InitGame() 13 | { 14 | LOGI("libGTAVC.so: Game has been inited!"); 15 | 16 | ApplyPatches(); 17 | InitScripting(); 18 | 19 | InstallHooks(); 20 | } -------------------------------------------------------------------------------- /src/game/game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "camera.h" 4 | 5 | class CGame 6 | { 7 | public: 8 | CGame(); 9 | ~CGame() {}; 10 | 11 | void InitGame(); 12 | void StartGame(); 13 | private: 14 | CCamera* m_pGameCamera; 15 | }; -------------------------------------------------------------------------------- /src/game/hooks.cpp: -------------------------------------------------------------------------------- 1 | #include "../main.h" 2 | 3 | void (*TouchEvent)(int, int, int posX, int posY); 4 | void TouchEvent_hook(int type, int num, int posX, int posY) 5 | { 6 | bool bRet; 7 | 8 | if(bRet) 9 | return TouchEvent(type, num, posX, posY); 10 | } 11 | 12 | void InstallHooks() 13 | { 14 | InstallHook(g_libGTAVC+HOOK_TOUCHEVENT, (uintptr_t)TouchEvent_hook, (uintptr_t*)&TouchEvent); 15 | } -------------------------------------------------------------------------------- /src/game/patches.cpp: -------------------------------------------------------------------------------- 1 | #include "../main.h" 2 | #include "patches.h" 3 | 4 | void ApplyPatches() 5 | { 6 | LOGI("libGTAVC.so: Patching the game..."); 7 | 8 | WriteMemory(g_libGTAVC+CLOCK_DATA, "VC:MP", 6); 9 | } -------------------------------------------------------------------------------- /src/game/patches.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void ApplyPatches(); -------------------------------------------------------------------------------- /src/game/scripting.cpp: -------------------------------------------------------------------------------- 1 | #include "../main.h" 2 | #include "scripting.h" 3 | 4 | GAME_SCRIPT_THREAD *gst; 5 | uint8_t ScriptBuf[255]; 6 | uint32_t *pdwParamVars[18]; 7 | 8 | uint8_t ExecuteScriptBuf() 9 | { 10 | gst->dwScriptIP = (uintptr_t)ScriptBuf; 11 | 12 | #if defined(__aarch64__) 13 | (( void (*)(GAME_SCRIPT_THREAD*))(g_libGTAVC+0x19D1A4))(gst); 14 | #else 15 | (( void (*)(GAME_SCRIPT_THREAD*))(g_libGTAVC+0x144B14))(gst); 16 | #endif 17 | 18 | return gst->condResult; 19 | } 20 | 21 | int ScriptCommand(const SCRIPT_COMMAND *pScriptCommand, ...) 22 | { 23 | va_list ap; 24 | const char* p = pScriptCommand->Params; 25 | va_start(ap, pScriptCommand); 26 | memcpy(&ScriptBuf, &pScriptCommand->OpCode, 2); 27 | int buf_pos = 2; 28 | uint16_t var_pos = 0; 29 | 30 | for(int i = 0; i < 18; i++) 31 | gst->dwLocalVar[i] = 0; 32 | 33 | while(*p) 34 | { 35 | switch(*p) 36 | { 37 | case 'i': 38 | { 39 | int i = va_arg(ap, int); 40 | ScriptBuf[buf_pos] = 0x01; 41 | buf_pos++; 42 | memcpy(&ScriptBuf[buf_pos], &i, 4); 43 | buf_pos += 4; 44 | break; 45 | } 46 | case 'f': 47 | { 48 | float f = (float)va_arg(ap, double); 49 | ScriptBuf[buf_pos] = 0x06; 50 | buf_pos++; 51 | memcpy(&ScriptBuf[buf_pos], &f, 4); 52 | buf_pos += 4; 53 | break; 54 | } 55 | case 'v': 56 | { 57 | uint32_t *v = va_arg(ap, uint32_t*); 58 | ScriptBuf[buf_pos] = 0x03; 59 | buf_pos++; 60 | pdwParamVars[var_pos] = v; 61 | gst->dwLocalVar[var_pos] = *v; 62 | memcpy(&ScriptBuf[buf_pos], &var_pos, 2); 63 | buf_pos += 2; 64 | var_pos++; 65 | break; 66 | } 67 | case 's': 68 | { 69 | char* sz = va_arg(ap, char*); 70 | unsigned char aLen = strlen(sz); 71 | ScriptBuf[buf_pos] = 0x0E; 72 | buf_pos++; 73 | ScriptBuf[buf_pos] = aLen; 74 | buf_pos++; 75 | memcpy(&ScriptBuf[buf_pos],sz,aLen); 76 | buf_pos += aLen; 77 | break; 78 | } 79 | case 'z': 80 | { 81 | ScriptBuf[buf_pos] = 0x00; 82 | buf_pos++; 83 | break; 84 | } 85 | default: 86 | { 87 | return 0; 88 | } 89 | } 90 | ++p; 91 | } 92 | va_end(ap); 93 | 94 | int result = ExecuteScriptBuf(); 95 | if (var_pos) 96 | { 97 | for (int i=0; i < var_pos; i++) 98 | *pdwParamVars[i] = gst->dwLocalVar[i]; 99 | } 100 | 101 | return result; 102 | } 103 | 104 | void InitScripting() 105 | { 106 | gst = new GAME_SCRIPT_THREAD; 107 | memset(gst, 0, sizeof(GAME_SCRIPT_THREAD)); 108 | LOGI("Script: Inited!"); 109 | } 110 | -------------------------------------------------------------------------------- /src/game/scripting.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define MAX_SCRIPT_VARS 16 4 | #define MAX_SCRIPT_SIZE 255 5 | 6 | struct GAME_SCRIPT_THREAD 7 | { 8 | uint8_t Pad1[20]; // +00 9 | uintptr_t dwScriptIP; // +20 10 | uint8_t Pad2[36]; // +24 11 | uint32_t dwLocalVar[32]; // +60 12 | uint32_t dwTimers[2]; // +188 13 | uint8_t Pad3[33]; // +196 14 | uint8_t condResult; // +229 15 | uint8_t Pad4[10]; // +230 16 | uint16_t logicalOp; // +240 17 | uint8_t notFlag; // +242 18 | uint8_t Pad5[13]; // +243 19 | }; 20 | 21 | struct SCRIPT_COMMAND 22 | { 23 | uint32_t OpCode; 24 | char Params[MAX_SCRIPT_VARS]; 25 | }; 26 | 27 | int ScriptCommand(const SCRIPT_COMMAND* ScriptCommand, ...); 28 | 29 | const SCRIPT_COMMAND set_camera_behind_player = { 0x0373, "" }; 30 | const SCRIPT_COMMAND toggle_player_controllable = { 0x01B4, "ii" }; 31 | const SCRIPT_COMMAND set_camera = { 0x03CB, "fff" }; -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | #include