├── .gitattributes ├── .github └── workflows │ └── ci.yml ├── .gitignore ├── .vs └── slnx.sqlite ├── CMakeLists.txt ├── CMakeSettings.json ├── README.md ├── scripts ├── FindBotan.cmake ├── cpr.cmake ├── json.cmake └── pugixml.cmake └── src ├── AccountInfo.hpp ├── command.cpp ├── command.hpp ├── commands ├── prod.ros.rockstargames.com │ ├── Achievements │ │ ├── AwardAchievement.cpp │ │ ├── AwardAchievementProgress.cpp │ │ ├── GetAchievementDefinitions.cpp │ │ └── GetPlayerAchievements.cpp │ ├── Auth │ │ ├── CreateP2PCertificate.cpp │ │ ├── CreateScAuthToken.cpp │ │ └── CreateTicket.cpp │ ├── Clans │ │ ├── Disband.cpp │ │ ├── GetAll.cpp │ │ ├── GetDesc.cpp │ │ ├── GetDescs.cpp │ │ ├── GetFeudStats.cpp │ │ ├── GetInvites.cpp │ │ ├── GetLeadersForClans.cpp │ │ ├── GetMembers.cpp │ │ ├── GetMembersTitleOnly.cpp │ │ ├── GetMetadataForClan.cpp │ │ ├── GetMine.cpp │ │ ├── GetPrimaryClans.cpp │ │ ├── GetRanks.cpp │ │ ├── GetSentInvites.cpp │ │ ├── GetTopRivals.cpp │ │ ├── GetWallMessages.cpp │ │ ├── JoinClan.cpp │ │ ├── Kick.cpp │ │ ├── Leave.cpp │ │ ├── MemberSetRankByRankOrder.cpp │ │ ├── MemberUpdateRankId.cpp │ │ ├── RankCreate.cpp │ │ ├── RankDelete.cpp │ │ ├── SetPrimaryClan.cpp │ │ └── WriteWallMessage.cpp │ ├── Decrypt.cpp │ ├── Friends │ │ ├── AcceptFriendRequest.cpp │ │ ├── AddFriendByNickname.cpp │ │ ├── AddFriendByRockstarId.cpp │ │ ├── BlockCommunications.cpp │ │ ├── CancelFriendRequest.cpp │ │ ├── CountAll.cpp │ │ ├── DeclineFriendRequest.cpp │ │ ├── GetBlocked.cpp │ │ ├── GetFriendRequestsReceived.cpp │ │ ├── GetFriendRequestsSent.cpp │ │ ├── GetFriends.cpp │ │ ├── GetFriendsAndRequestsSent.cpp │ │ ├── RemoveFriend.cpp │ │ └── UnblockCommunications.cpp │ ├── GeoLocation │ │ ├── GetLocationInfoFromIP.cpp │ │ └── GetRelayServers.cpp │ ├── Inbox │ │ ├── SendAward.cpp │ │ ├── SendBounty.cpp │ │ └── SendEmail.cpp │ ├── Matchmaking │ │ └── Matchmaking.cpp │ ├── Presence │ │ ├── QueryWithMaxRecordLength.cpp │ │ └── SendInvite.cpp │ ├── ProfileStatGroups │ │ └── ReadGameConfig.cpp │ ├── ProfileStats │ │ └── ReadAllStats.cpp │ ├── Socialclub │ │ ├── CreateAccountSc.cpp │ │ ├── GetAccountInfo.cpp │ │ ├── GetScAuthToken.cpp │ │ ├── LinkAccount2.cpp │ │ └── UpdateAccount.cpp │ └── UGC │ │ ├── CheckText.cpp │ │ ├── CopyJob.cpp │ │ ├── CopyLocalContent.cpp │ │ ├── DeleteContent.cpp │ │ ├── QueryContent.cpp │ │ ├── QueryContentCreators.cpp │ │ └── SetBookmarked.cpp └── scapi.rockstargames.com │ ├── Search │ ├── SearchCrew.cpp │ ├── SearchMission.cpp │ ├── SearchPhoto.cpp │ └── SearchVideo.cpp │ └── UGC │ ├── MissionComments.cpp │ └── MissionDetails.cpp ├── common.hpp ├── main.cpp ├── ros_crypt.cpp └── ros_crypt.hpp /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: Build Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | build: 10 | name: Build on Windows and Linux 11 | runs-on: ${{ matrix.os }} 12 | 13 | strategy: 14 | matrix: 15 | os: [windows-latest, ubuntu-latest] 16 | 17 | steps: 18 | - name: Checkout code 19 | uses: actions/checkout@v2 20 | 21 | - name: Configure and Build 22 | run: | 23 | mkdir build 24 | cd build 25 | cmake .. 26 | cmake --build . 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | .vs/ 3 | .vscode/* 4 | !.vscode/launch.json 5 | .cache/ 6 | 7 | # output directory 8 | build/ 9 | out/ 10 | __pycache__/ 11 | 12 | # precompiled headers 13 | *.ipch 14 | *.gch 15 | *.pch -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BugisoftRSG/SCAPI/c59829b7a073aae4c8b5378da13c4d65ebeb96e8/.vs/slnx.sqlite -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | 3 | project(SCAPI CXX ASM_MASM) 4 | 5 | set(SRC_DIR "${PROJECT_SOURCE_DIR}/src") 6 | 7 | # Fetch modules 8 | message("\nFetching modules") 9 | include(scripts/pugixml.cmake) 10 | include(scripts/cpr.cmake) 11 | include(scripts/json.cmake) 12 | 13 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/scripts) 14 | find_package(botan 2.19.3 REQUIRED) 15 | botan_generate(botan sha1 hmac rc4 rng base64 mac stream hash auto_rng win32_stats) 16 | 17 | # SCAPI 18 | message(STATUS "SCAPI") 19 | file(GLOB_RECURSE SRC_MAIN 20 | "${SRC_DIR}/**.hpp" 21 | "${SRC_DIR}/**.h" 22 | "${SRC_DIR}/**.cpp" 23 | "${SRC_DIR}/**.cc" 24 | "${SRC_DIR}/**.cxx" 25 | "${SRC_DIR}/**.asm" 26 | ) 27 | add_executable(SCAPI "${SRC_MAIN}") 28 | 29 | set_property(GLOBAL PROPERTY USE_FOLDERS ON) 30 | set_property(TARGET SCAPI PROPERTY CXX_STANDARD 23) # 23 Because std::format is not avalible in std:c++20 for some reason. Maybe it's because i use v142 toolset. 31 | 32 | source_group(TREE ${SRC_DIR} PREFIX "src" FILES ${SRC_MAIN} ) 33 | 34 | target_include_directories(SCAPI PRIVATE 35 | "${SRC_DIR}" 36 | "${json_SOURCE_DIR}/single_include" 37 | ) 38 | 39 | target_link_libraries(SCAPI PRIVATE botan pugixml cpr json) 40 | 41 | # Warnings as errors 42 | set_property(TARGET SCAPI PROPERTY COMPILE_WARNING_AS_ERROR ON) 43 | 44 | add_compile_definitions(SCAPI 45 | "_CRT_SECURE_NO_WARNINGS" 46 | "NOMINMAX" 47 | "WIN32_LEAN_AND_MEAN" 48 | ) -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Release", 5 | "generator": "Ninja", 6 | "configurationType": "RelWithDebInfo", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "" 13 | } 14 | ] 15 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SCAPI 2 | 3 | This project is designed to better understand the API's from Rockstar Games used in Grand Theft Auto V. 4 | 5 | ## Features 6 | 7 | Listing all commands and keeping them here up-to-date would be pain. Just go to src/commands 8 | 9 | ### Libraries 10 | 11 | This project was builded on Microsoft Visual Studio Community 2022 (64bit) 12 | 13 | Dependencies via CMake: 14 | - [Botan](https://github.com/randombit/botan) 15 | - [cpr](https://github.com/libcpr/cpr) 16 | - [pugixml](https://github.com/libcpr/cpr) 17 | - Python for Botan 18 | 19 | Build Instructions (Win64) 20 | ```bash 21 | git clone https://github.com/BugisoftRSG/SCAPI.git 22 | cd SCAPI 23 | mkdir build && cd build 24 | cmake .. 25 | ``` 26 | 27 | ## Known Issues 28 | - Some endpoints may return an error since they are not available for the platform or no longer used. 29 | -------------------------------------------------------------------------------- /scripts/FindBotan.cmake: -------------------------------------------------------------------------------- 1 | ## This module will automagically download the tarball of the specified Botan version and invoke the configure.py 2 | ## python script to generate the amalgamation files (botan_all.cpp and botan_all.h). 3 | ## 4 | ## Usage: 5 | ## find_package( 6 | ## botan 2.18.2 7 | ## COMPONENTS 8 | ## system_rng 9 | ## argon2 10 | ## sha3 11 | ## REQUIRED 12 | ## ) 13 | ## 14 | ## target_link_libraries( 15 | ## MyTarget 16 | ## PRIVATE 17 | ## botan 18 | ## ) 19 | ## 20 | 21 | cmake_minimum_required(VERSION 3.19) 22 | include(FetchContent) 23 | 24 | # Find python 25 | find_package( 26 | Python 27 | COMPONENTS 28 | Interpreter 29 | REQUIRED 30 | ) 31 | 32 | # Assemble version string 33 | set(Botan_VERSION_STRING "Botan-2.19.3") 34 | 35 | # Assemble download URL 36 | set(DOWNLOAD_URL https://botan.randombit.net/releases/${Botan_VERSION_STRING}.tar.xz) 37 | 38 | # Just do a dummy download to see whether we can download the tarball 39 | file( 40 | DOWNLOAD 41 | ${DOWNLOAD_URL} 42 | STATUS download_status 43 | ) 44 | if (NOT download_status EQUAL 0) 45 | message(FATAL_ERROR "Could not download Botan tarball (status = ${download_status}): ${DOWNLOAD_URL}") 46 | endif() 47 | 48 | # Download the tarball 49 | FetchContent_Declare( 50 | botan_upstream 51 | URL ${DOWNLOAD_URL} 52 | ) 53 | FetchContent_MakeAvailable(botan_upstream) 54 | 55 | # Heavy lifting by cmake 56 | include(FindPackageHandleStandardArgs) 57 | find_package_handle_standard_args(Botan DEFAULT_MSG Botan_VERSION_STRING) 58 | 59 | ## Function to generate a target named 'TARGET_NAME' with specific Botan modules enabled. 60 | function(botan_generate TARGET_NAME MODULES) 61 | # The last N arguments are considered to be the modules list. 62 | # Here, we collect those in a list and join them with a comma separator ready to be passed to the configure.py script. 63 | foreach(module_index RANGE 1 ${ARGC}-2) 64 | list(APPEND modules_list ${ARGV${module_index}}) 65 | 66 | # Check if PKCS11 module is enabled 67 | # Note: This is for a workaround, see further below for more details. 68 | if (ARGV${module_index} STREQUAL "pkcs11") 69 | set(PKCS11_ENABLED ON) 70 | endif() 71 | endforeach() 72 | list(JOIN modules_list "," ENABLE_MODULES_LIST) 73 | 74 | # Determine botan compiler ID (--cc parameter of configure.py) 75 | set(BOTAN_COMPILER_ID ${CMAKE_CXX_COMPILER_ID}) 76 | string(TOLOWER ${BOTAN_COMPILER_ID} BOTAN_COMPILER_ID) 77 | if (BOTAN_COMPILER_ID STREQUAL "gnu") 78 | set(BOTAN_COMPILER_ID "gcc") 79 | endif() 80 | 81 | # Run the configure.py script 82 | add_custom_command( 83 | OUTPUT botan_all.cpp botan_all.h 84 | COMMENT "Generating Botan amalgamation files botan_all.cpp and botan_all.h" 85 | COMMAND ${Python_EXECUTABLE} 86 | ${botan_upstream_SOURCE_DIR}/configure.py 87 | --quiet 88 | --cc-bin=${CMAKE_CXX_COMPILER} 89 | --cc=${BOTAN_COMPILER_ID} 90 | $<$:--os=mingw> 91 | --disable-shared 92 | --amalgamation 93 | --minimized-build 94 | --enable-modules=${ENABLE_MODULES_LIST} 95 | ) 96 | 97 | # Create target 98 | set(TARGET ${TARGET_NAME}) 99 | add_library(${TARGET} STATIC) 100 | target_sources( 101 | ${TARGET} 102 | PUBLIC 103 | ${CMAKE_CURRENT_BINARY_DIR}/botan_all.h 104 | PRIVATE 105 | ${CMAKE_CURRENT_BINARY_DIR}/botan_all.cpp 106 | ) 107 | 108 | target_include_directories( 109 | ${TARGET} 110 | INTERFACE 111 | ${CMAKE_CURRENT_BINARY_DIR} 112 | ) 113 | set_target_properties( 114 | ${TARGET} 115 | PROPERTIES 116 | POSITION_INDEPENDENT_CODE ON 117 | ) 118 | 119 | # 120 | # PKCS11 Workaround 121 | # 122 | # This section is a workaround to handle a "bug" in upstream Botan. 123 | # Basically, the amalgamation build of Botan does not include the necessary PKCS11 headers when the PKCS11 module 124 | # is enabled. 125 | # 126 | # See: 127 | # - https://github.com/randombit/botan/issues/1447 128 | # - https://github.com/randombit/botan/issues/976 129 | # 130 | if (PKCS11_ENABLED) 131 | file(COPY ${botan_upstream_SOURCE_DIR}/src/lib/prov/pkcs11/pkcs11.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 132 | file(COPY ${botan_upstream_SOURCE_DIR}/src/lib/prov/pkcs11/pkcs11f.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 133 | file(COPY ${botan_upstream_SOURCE_DIR}/src/lib/prov/pkcs11/pkcs11t.h DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) 134 | target_include_directories( 135 | ${TARGET} 136 | PRIVATE 137 | ${botan_upstream_SOURCE_DIR}/src/lib/prov/pkcs11 138 | ) 139 | endif() 140 | endfunction() -------------------------------------------------------------------------------- /scripts/cpr.cmake: -------------------------------------------------------------------------------- 1 | include(FetchContent) 2 | 3 | set(BUILD_TESTING_BEFORE ${BUILD_TESTING}) 4 | set(CURL_DISABLE_TESTS OFF) 5 | FetchContent_Declare( 6 | cpr 7 | GIT_REPOSITORY https://github.com/libcpr/cpr.git 8 | GIT_TAG 1986262ba4e0cb052161e9e7919aef5ef08217f0 9 | GIT_PROGRESS TRUE 10 | ) 11 | message("cpr") 12 | FetchContent_MakeAvailable(cpr) 13 | 14 | set(BUILD_TESTING ${BUILD_TESTING_BEFORE} CACHE INTERNAL "" FORCE) -------------------------------------------------------------------------------- /scripts/json.cmake: -------------------------------------------------------------------------------- 1 | include(FetchContent) 2 | 3 | FetchContent_Declare( 4 | json 5 | GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git 6 | GIT_TAG 67e6070f9d9a44b4dec79ebe6b591f39d2285593 7 | GIT_PROGRESS TRUE 8 | ) 9 | message("json") 10 | FetchContent_MakeAvailable(json) -------------------------------------------------------------------------------- /scripts/pugixml.cmake: -------------------------------------------------------------------------------- 1 | include(FetchContent) 2 | 3 | FetchContent_Declare( 4 | pugixml 5 | GIT_REPOSITORY https://github.com/zeux/pugixml.git 6 | GIT_TAG a0e064336317c9347a91224112af9933598714e9 7 | GIT_PROGRESS TRUE 8 | ) 9 | message("pugixml") 10 | FetchContent_MakeAvailable(pugixml) 11 | set_property(TARGET pugixml PROPERTY CXX_STANDARD 23) 12 | -------------------------------------------------------------------------------- /src/AccountInfo.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | class AccountInfo 5 | { 6 | public: 7 | uint64_t m_rockstar_id; 8 | int m_age; 9 | string m_avatar_url; 10 | string m_country_code; 11 | string m_date_of_birth; 12 | string m_email; 13 | bool m_is_approx_dob; 14 | string m_language_code; 15 | string m_nickname; 16 | string m_last_portal_login_date; 17 | }; -------------------------------------------------------------------------------- /src/command.cpp: -------------------------------------------------------------------------------- 1 | #include "command.hpp" 2 | #include "ros_crypt.hpp" 3 | #include 4 | 5 | ROSCrypt* command::m_launcher_ros = nullptr; 6 | ROSCrypt* command::m_ros = nullptr; 7 | 8 | command::command(const string& name) : m_name(name) 9 | { 10 | m_launcher_ros = new ROSCrypt(true); 11 | m_ros = new ROSCrypt(false); 12 | 13 | g_commands[hash()(name)] = this; 14 | } 15 | 16 | command* command::get(int command) 17 | { 18 | return g_commands[command]; 19 | } 20 | 21 | string command::run_raw(const string url, const string queryString, bool launcher) 22 | { 23 | auto api = launcher ? m_launcher_ros : m_ros; 24 | 25 | string absolutePath = url.substr(url.find('/', url.find("://") + 3)); 26 | 27 | Botan::AutoSeeded_RNG rng; 28 | auto challenge = rng.random_vec(8); 29 | 30 | cpr::Response response = cpr::Post( 31 | cpr::Url{ url }, 32 | cpr::Header 33 | { 34 | {"ros-SecurityFlags", "239" }, 35 | {"ros-SessionTicket", SESSION_TICKET}, 36 | {"ros-Challenge", Botan::base64_encode(challenge)}, 37 | {"ros-HeadersHmac", Botan::base64_encode(api->HeadersHmac(challenge, "POST", absolutePath, SESSION_KEY, SESSION_TICKET)) }, 38 | {"Content-Type", "application/x-www-form-urlencoded; charset=utf-8"}, 39 | {"User-Agent", api->GetROSVersionString()}, 40 | }, 41 | cpr::Body{ queryString }); 42 | 43 | return response.text; 44 | } 45 | 46 | string command::run(const string url, map map) 47 | { 48 | auto service_type = this->get_service_type(); 49 | 50 | if (service_type == PROD_ROS || service_type == PROD_ROS_LAUNCHER) 51 | { 52 | auto api = service_type == SERVICE_TYPE::PROD_ROS_LAUNCHER ? m_launcher_ros : m_ros; 53 | 54 | auto params = api->BuildPostString(map); 55 | 56 | string queryString = api->EncryptROSData(params, SESSION_KEY); 57 | 58 | string response = run_raw(url, queryString, service_type == SERVICE_TYPE::PROD_ROS_LAUNCHER); 59 | 60 | if (!response.contains("Internal server error")) 61 | return api->DecryptROSData(response.c_str(), response.size(), SESSION_KEY); 62 | else { 63 | return response; 64 | } 65 | } 66 | else if (service_type == PROD_SCAPI_AMC) 67 | { 68 | cpr::Parameters params; 69 | for (const auto& entry : map) { 70 | params.Add(cpr::Parameter(entry.first, entry.second)); 71 | } 72 | 73 | cpr::Response response = cpr::Get( 74 | cpr::Url{ url }, 75 | cpr::Header 76 | { 77 | {"Content-Type", "application/x-www-form-urlencoded; charset=utf-8"}, 78 | {"X-AMC", "true"}, 79 | {"X-Requested-With", "XMLHttpRequest"} 80 | }, 81 | cpr::Parameters{ params }); 82 | 83 | return response.text; 84 | } 85 | 86 | return ""; 87 | } 88 | 89 | string command::run(const string url, string params) 90 | { 91 | string queryString = m_ros->EncryptROSData(params, SESSION_KEY); 92 | 93 | string response = run_raw(url, queryString); 94 | 95 | if (!response.contains("Internal server error")) 96 | return m_ros->DecryptROSData(response.c_str(), response.size(), SESSION_KEY); 97 | else { 98 | return response; 99 | } 100 | } 101 | 102 | string command::run_anonymous(const string& url, map map) 103 | { 104 | string queryString = m_ros->EncryptROSData(m_ros->BuildPostString(map)); 105 | 106 | cpr::Response response = cpr::Post( 107 | cpr::Url{ url }, 108 | cpr::Header 109 | { 110 | {"Content-Type", "application/x-www-form-urlencoded; charset=utf-8"}, 111 | {"User-Agent", m_ros->GetROSVersionString()} 112 | }, 113 | cpr::Body{ queryString }); 114 | 115 | return m_ros->DecryptROSData(response.text.c_str(), response.text.size(), ""); 116 | } -------------------------------------------------------------------------------- /src/command.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "ros_crypt.hpp" 8 | 9 | using namespace std; 10 | 11 | inline string TICKET; 12 | inline string SESSION_TICKET; 13 | inline string SESSION_KEY; 14 | 15 | enum SERVICE_TYPE 16 | { 17 | UNKNOWN, 18 | PROD_ROS, 19 | PROD_ROS_LAUNCHER, 20 | PROD_SCAPI_AMC, 21 | PROD_CLOUD 22 | }; 23 | 24 | class command 25 | { 26 | protected: 27 | string m_name; 28 | 29 | string run_raw(const string url, const string queryString, bool launcher = false); 30 | string run(const string url, map map); 31 | string run(const string url, string params); 32 | string run_anonymous(const string& url, map map); 33 | public: 34 | 35 | command(const string& name); 36 | inline const string& get_name() { return m_name; } 37 | static command* get(int command); 38 | virtual string execute(const vector& args) = 0; 39 | virtual SERVICE_TYPE get_service_type() = 0; 40 | 41 | inline string get_category() 42 | { 43 | switch (get_service_type()) 44 | { 45 | case PROD_ROS: 46 | return "prod.ros"; 47 | break; 48 | case PROD_ROS_LAUNCHER: 49 | return "prod.ros (launcher)"; 50 | break; 51 | case PROD_SCAPI_AMC: 52 | return "SCAPI"; 53 | break; 54 | case PROD_CLOUD: 55 | return "cloud"; 56 | break; 57 | default: 58 | return "unknown"; 59 | break; 60 | } 61 | } 62 | 63 | static ROSCrypt* m_launcher_ros; 64 | static ROSCrypt* m_ros; 65 | }; 66 | 67 | inline unordered_map g_commands; -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Achievements/AwardAchievement.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class AwardAchievement : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the achievementId:" << endl; 13 | string achievementId; 14 | cin >> achievementId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["achievementId"] = achievementId; 19 | map["achievedOffline"] = "False"; 20 | 21 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/achievements.asmx/AwardAchievement", map); 22 | } 23 | }; 24 | 25 | AwardAchievement g_award_achievement("awardachievement"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Achievements/AwardAchievementProgress.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class AwardAchievementProgress : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the achievementId:" << endl; 13 | string achievementId; 14 | cin >> achievementId; 15 | 16 | cout << "Specify the achievementProgress:" << endl; 17 | string achievementProgress; 18 | cin >> achievementProgress; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["achievementId"] = achievementId; 23 | map["achievedOffline"] = "False"; 24 | 25 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/achievements.asmx/AwardAchievementProgress", map); 26 | } 27 | }; 28 | 29 | AwardAchievementProgress g_award_achievement_progress("awardachievementprogress"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Achievements/GetAchievementDefinitions.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetAchievementDefinitions : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string firstAchievementId; 14 | cin >> firstAchievementId; 15 | 16 | cout << "Specify the maxDefinitions:" << endl; 17 | string maxDefinitions; 18 | cin >> maxDefinitions; 19 | 20 | cout << "Specify the locale (ex. en-US):" << endl; 21 | string locale; 22 | cin >> locale; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["firstAchievementId"] = firstAchievementId; 27 | map["maxDefinitions"] = maxDefinitions; 28 | map["locale"] = locale; 29 | 30 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/achievements.asmx/GetAchievementDefinitions", map); 31 | } 32 | }; 33 | 34 | GetAchievementDefinitions g_get_achievement_definitions("getachievementdefinitions"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Achievements/GetPlayerAchievements.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetPlayerAchievements : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstarId:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["playerRockstarId"] = rockstarId; 19 | map["crossTitleId"] = "11"; 20 | map["crossTitleName"] = "gta5"; 21 | map["crossTitlePlatformName"] = "pcros"; 22 | 23 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/achievements.asmx/GetPlayerAchievements", map); 24 | } 25 | }; 26 | 27 | GetPlayerAchievements g_get_player_achievements("getplayerachievements"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Auth/CreateP2PCertificate.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | 3 | class CreateP2PCertificate : command 4 | { 5 | using command::command; 6 | 7 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 8 | 9 | virtual string execute(const vector& args) 10 | { 11 | cout << "Specify the pubKey" << endl; 12 | string pubKey; 13 | cin >> pubKey; 14 | 15 | cout << "Specify the sig" << endl; 16 | string sig; 17 | cin >> sig; 18 | 19 | map map; 20 | map["ticket"] = TICKET; 21 | map["pubKeyCurve"] = "nistP256"; 22 | map["pubKey"] = pubKey; 23 | map["hashAlg"] = "SHA256"; 24 | map["sig"] = sig; 25 | 26 | return run("https://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/auth.asmx/CreateP2PCertificate", map); 27 | } 28 | }; 29 | 30 | CreateP2PCertificate g_create_p2p_certificate("createp2pcertificate"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Auth/CreateScAuthToken.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CreateScAuthToken : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | 13 | map map; 14 | map["ticket"] = TICKET; 15 | 16 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/auth.asmx/CreateTicketScAuthToken2", map); 17 | } 18 | }; 19 | 20 | CreateScAuthToken g_create_sc_auth_token("createscauthtoken"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Auth/CreateTicket.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include "pugixml.hpp" 3 | #include 4 | #include 5 | #include 6 | 7 | class CreateTicket : command 8 | { 9 | using command::command; 10 | 11 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 12 | 13 | inline void request_socialclub_data(unordered_map& env_vars) 14 | { 15 | cout << "Specify your SocialClub Email" << endl; 16 | string email; 17 | cin >> email; 18 | 19 | cout << "Specify your SocialClub Profile Name" << endl; 20 | string nickname; 21 | cin >> nickname; 22 | 23 | cout << "Specify your SocialClub Password" << endl; 24 | string password; 25 | cin >> password; 26 | 27 | env_vars["EMAIL"] = email; 28 | env_vars["NICKNAME"] = nickname; 29 | env_vars["PASSWORD"] = password; 30 | env_vars["PLATFORM"] = "pcros"; 31 | 32 | ofstream outFile(".env"); 33 | 34 | for (const auto& pair : env_vars) { 35 | outFile << pair.first << "=" << pair.second << "\n"; 36 | } 37 | } 38 | 39 | inline bool request_ticket(string email, string nickname, string password, string platform, string& _response) 40 | { 41 | map map; 42 | map["ticket"] = ""; 43 | map["email"] = email; 44 | map["nickname"] = nickname; 45 | map["password"] = password; 46 | map["platformName"] = platform; 47 | 48 | string response = run_anonymous("https://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/auth.asmx/CreateTicketSc3", map); 49 | 50 | pugi::xml_document doc; 51 | if (!doc.load_string(response.c_str())) return false; 52 | 53 | bool successfully = false; 54 | 55 | ofstream outFile("data.bin"); 56 | 57 | pugi::xml_node xml_response = doc.child("Response"); 58 | 59 | for (pugi::xml_node panel = xml_response.first_child(); panel; panel = panel.next_sibling()) 60 | { 61 | if (strcmp(panel.name(), "Ticket") == 0) 62 | { 63 | TICKET = panel.text().get(); 64 | cout << "Ticket: " << TICKET << endl; 65 | outFile << "TICKET" << "=" << TICKET << "\n"; 66 | successfully = true; 67 | } 68 | else if (strcmp(panel.name(), "SessionKey") == 0) 69 | { 70 | SESSION_KEY = panel.text().get(); 71 | cout << "Session Key: " << SESSION_KEY << endl; 72 | outFile << "SESSION_KEY" << "=" << SESSION_KEY << "\n"; 73 | } 74 | else if (strcmp(panel.name(), "SessionTicket") == 0) 75 | { 76 | SESSION_TICKET = panel.text().get(); 77 | cout << "Session Ticket: " << SESSION_TICKET << endl; 78 | outFile << "SESSION_TICKET" << "=" << SESSION_TICKET << "\n"; 79 | } 80 | } 81 | 82 | _response = response; 83 | 84 | return successfully; 85 | } 86 | 87 | virtual string execute(const vector& args) 88 | { 89 | unordered_map env_vars; 90 | 91 | ifstream infile("data.bin"); 92 | 93 | bool skip; 94 | 95 | if (filesystem::exists("data.bin")) 96 | { 97 | string line; 98 | while (getline(infile, line)) { 99 | size_t equal_pos = line.find('='); 100 | if (equal_pos != string::npos) { 101 | string key = line.substr(0, equal_pos); 102 | string value = line.substr(equal_pos + 1); 103 | 104 | if (key == "TICKET") 105 | TICKET = value; 106 | else if (key == "SESSION_KEY") 107 | SESSION_KEY = value; 108 | else if (key == "SESSION_TICKET") 109 | SESSION_TICKET = value; 110 | } 111 | } 112 | 113 | string data = ""; 114 | if (!TICKET.empty()) 115 | data = command::get(hash()("getaccountinfo"))->execute({}); 116 | 117 | if (data.empty() || data.contains("Internal Server Error") || data.contains("AuthenticationFailed")) 118 | { 119 | cout << "Auth -> Cached session is no longer valid... recreating now." << endl; 120 | 121 | if (filesystem::exists("data.bin")) 122 | { 123 | cout << ".env found at " << filesystem::absolute(".env") << endl; 124 | ifstream infile(".env"); 125 | string line; 126 | while (getline(infile, line)) { 127 | size_t equal_pos = line.find('='); 128 | if (equal_pos != string::npos) { 129 | string key = line.substr(0, equal_pos); 130 | string value = line.substr(equal_pos + 1); 131 | env_vars[key] = value; 132 | } 133 | } 134 | infile.close(); 135 | 136 | bool success; 137 | string response; 138 | do { 139 | success = request_ticket(env_vars.at("EMAIL"), env_vars.at("NICKNAME"), env_vars.at("PASSWORD"), env_vars.at("PLATFORM"), response); 140 | 141 | if (!success) 142 | { 143 | cout << "Auth -> Invalid credentials or rate limited" << endl; 144 | request_socialclub_data(env_vars); 145 | } 146 | } while (!success); 147 | 148 | return response; 149 | } 150 | 151 | } 152 | else if (data.contains("Error Code")) 153 | { 154 | cout << "Auth -> Received Error: " << data << endl; 155 | 156 | bool success; 157 | string response; 158 | do { 159 | request_socialclub_data(env_vars); 160 | success = request_ticket(env_vars.at("EMAIL"), env_vars.at("NICKNAME"), env_vars.at("PASSWORD"), env_vars.at("PLATFORM"), response); 161 | 162 | if (!success) 163 | { 164 | cout << "Auth -> Invalid credentials or rate limited" << endl; 165 | } 166 | } while (!success); 167 | 168 | return response; 169 | } 170 | else 171 | { 172 | return "Auth -> Using cached session"; 173 | } 174 | } 175 | else if (!filesystem::exists(".env") || !filesystem::exists("data.bin")) 176 | { 177 | request_socialclub_data(env_vars); 178 | 179 | bool success; 180 | string response; 181 | do { 182 | success = request_ticket(env_vars.at("EMAIL"), env_vars.at("NICKNAME"), env_vars.at("PASSWORD"), env_vars.at("PLATFORM"), response); 183 | 184 | if (!success) 185 | { 186 | cout << "Auth -> Invalid credentials or rate limited" << endl; 187 | request_socialclub_data(env_vars); 188 | } 189 | } while (!success); 190 | 191 | return response; 192 | } 193 | 194 | return "error"; 195 | } 196 | }; 197 | 198 | CreateTicket g_create_ticket("createticket"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/Disband.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class Disband : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanId"] = clanId; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/Disband", map); 21 | } 22 | }; 23 | 24 | Disband g_disband("disbandcrew"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetAll.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetAll : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | cout << "Specify if isSystemClan (0 = no/1 = yes, -1 = any):" << endl; 21 | string isSystemClan; 22 | cin >> isSystemClan; 23 | 24 | cout << "Specify if isOpenClan (0 = no/1 = yes, -1 = any):" << endl; 25 | string isOpenClan; 26 | cin >> isOpenClan; 27 | 28 | cout << "Specify the search (Can be 0):" << endl; 29 | string search; 30 | cin >> search; 31 | 32 | cout << "Specify the sortMode (Can be 0, other values unknown yet):" << endl; 33 | string sortMode; 34 | cin >> sortMode; 35 | 36 | map map; 37 | map["ticket"] = TICKET; 38 | map["pageIndex"] = pageIndex; 39 | map["pageSize"] = pageSize; 40 | map["isSystemClan"] = isSystemClan; 41 | map["isOpenClan"] = isOpenClan; 42 | map["search"] = search; 43 | map["sortMode"] = sortMode; 44 | 45 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetAll", map); 46 | } 47 | }; 48 | 49 | GetAll g_get_all("getallcrews"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetDesc.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetDesc : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanId"] = clanId; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetDesc", map); 21 | } 22 | }; 23 | 24 | GetDesc g_get_desc("getcrewdesc"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetDescs.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetDescs : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanIdsCsv (ex.: 12345,56789):" << endl; 13 | string clanIdsCsv; 14 | cin >> clanIdsCsv; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanIdsCsv"] = clanIdsCsv; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetDescs", map); 21 | } 22 | }; 23 | 24 | GetDescs g_get_descs("getcrewdescs"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetFeudStats.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetFeudStats : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the since ((lastday, lastweek, last2weeks, lastmonth, last3months, last6months, alltime) / 0):" << endl; 17 | string since; 18 | cin >> since; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["clanId"] = clanId; 23 | map["since"] = since; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetFeudStats", map); // TODO Internal Server Error (no longer in use?) 26 | } 27 | }; 28 | 29 | GetFeudStats g_get_feud_stats("getfeudstats"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetInvites.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetInvites : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetInvites", map); 26 | } 27 | }; 28 | 29 | GetInvites g_get_invites("getcrewinvites"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetLeadersForClans.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetLeadersForClans : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanIdsCsv (ex.: 123456,789801):" << endl; 13 | string clanIdsCsv; 14 | cin >> clanIdsCsv; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanIdsCsv"] = clanIdsCsv; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetLeadersForClans", map); 21 | } 22 | }; 23 | 24 | GetLeadersForClans g_get_leaders_for_clans("getleadersforclans"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetMembers.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetCrewMembers : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | cout << "Specify the clanId:" << endl; 21 | string clanId; 22 | cin >> clanId; 23 | 24 | cout << "Specify the clanName:" << endl; 25 | string clanName; 26 | cin >> clanName; 27 | 28 | map map; 29 | map["ticket"] = TICKET; 30 | map["pageIndex"] = pageIndex; 31 | map["pageSize"] = pageSize; 32 | map["clanId"] = clanId; 33 | map["clanName"] = clanName; 34 | 35 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetMembers", map); 36 | } 37 | }; 38 | 39 | GetCrewMembers g_get_crew_members("getcrewmembers"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetMembersTitleOnly.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetCrewMembersTitleOnly : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | cout << "Specify the clanId:" << endl; 21 | string clanId; 22 | cin >> clanId; 23 | 24 | cout << "Specify the clanName:" << endl; 25 | string clanName; 26 | cin >> clanName; 27 | 28 | map map; 29 | map["ticket"] = TICKET; 30 | map["pageIndex"] = pageIndex; 31 | map["pageSize"] = pageSize; 32 | map["clanId"] = clanId; 33 | map["clanName"] = clanName; 34 | 35 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetMembersTitleOnly", map); 36 | } 37 | }; 38 | 39 | GetCrewMembersTitleOnly g_get_crew_members_title_only("getcrewmemberstitleonly"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetMetadataForClan.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetMetadataForClan : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | cout << "Specify the clanId:" << endl; 21 | string clanId; 22 | cin >> clanId; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["pageIndex"] = pageIndex; 27 | map["pageSize"] = pageSize; 28 | map["clanId"] = clanId; 29 | 30 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetMetadataForClan", map); 31 | } 32 | }; 33 | 34 | GetMetadataForClan g_get_metadata_for_clan("getcrewmetadata"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetMine.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetMine : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetMine", map); 26 | } 27 | }; 28 | 29 | GetMine g_get_mine("getmycrew"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetPrimaryClans.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetPrimaryClans : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the gamerHandlesCsv (ex.: 123456,789900):" << endl; 13 | string gamerHandlesCsv; 14 | cin >> gamerHandlesCsv; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["gamerHandlesCsv"] = gamerHandlesCsv; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetPrimaryClans", map); // Exception, no further info 21 | } 22 | }; 23 | 24 | GetPrimaryClans g_get_primary_clans("getprimaryclans"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetRanks.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetRanks : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the pageIndex:" << endl; 17 | string pageIndex; 18 | cin >> pageIndex; 19 | 20 | cout << "Specify the pageSize:" << endl; 21 | string pageSize; 22 | cin >> pageSize; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["clanId"] = clanId; 27 | map["pageIndex"] = pageIndex; 28 | map["pageSize"] = pageSize; 29 | 30 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetRanks", map); 31 | } 32 | }; 33 | 34 | GetRanks g_get_ranks("getcrewranks"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetSentInvites.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetSentInvites : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetSentInvites", map); 26 | } 27 | }; 28 | 29 | GetSentInvites g_get_sent_invites("getsentcrewinvites"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetTopRivals.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetTopRivals : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the since ((lastday, lastweek, last2weeks, lastmonth, last3months, last6months, alltime) / 0):" << endl; 17 | string since; 18 | cin >> since; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["clanId"] = clanId; 23 | map["since"] = since; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetTopRivals1", map); // Internal Error, no longer used? 26 | } 27 | }; 28 | 29 | GetTopRivals g_get_top_rivals("gettoprivals"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/GetWallMessages.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetWallMessages : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the pageIndex:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the pageSize:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | cout << "Specify the clanId:" << endl; 21 | string clanId; 22 | cin >> clanId; 23 | 24 | 25 | map map; 26 | map["ticket"] = TICKET; 27 | map["pageIndex"] = pageIndex; 28 | map["pageSize"] = pageSize; 29 | map["clanId"] = clanId; 30 | 31 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/GetWallMessages", map); // Internal Server Error, great 32 | } 33 | }; 34 | 35 | GetWallMessages g_get_wall_messages("getwallmessages"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/JoinClan.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class JoinCrew : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanId"] = clanId; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/Join", map); 21 | } 22 | }; 23 | 24 | JoinCrew g_join_crew("joincrew"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/Kick.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class Kick : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the targetGamerHandle:" << endl; 17 | string targetGamerHandle; 18 | cin >> targetGamerHandle; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["clanId"] = clanId; 23 | map["targetGamerHandle"] = targetGamerHandle; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/Kick", map); 26 | } 27 | }; 28 | 29 | Kick g_kick("kickfromcrew"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/Leave.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class Leave : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanId"] = clanId; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/Leave", map); 21 | } 22 | }; 23 | 24 | Leave g_leave("leavecrew"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/MemberSetRankByRankOrder.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class MemberSetRankByRankOrder : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the targetGamerHandle:" << endl; 13 | string targetGamerHandle; 14 | cin >> targetGamerHandle; 15 | 16 | cout << "Specify the clanId:" << endl; 17 | string clanId; 18 | cin >> clanId; 19 | 20 | cout << "Specify the rankOrder:" << endl; 21 | string rankOrder; 22 | cin >> rankOrder; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["targetGamerHandle"] = targetGamerHandle; 27 | map["clanId"] = clanId; 28 | map["rankOrder"] = rankOrder; 29 | 30 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/MemberSetRankByRankOrder", map); // Title or Environment not supported 31 | } 32 | }; 33 | 34 | MemberSetRankByRankOrder g_member_set_rank_by_rank_order("membersetrankbyrankorder"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/MemberUpdateRankId.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class MemberUpdateRankId : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the targetGamerHandle:" << endl; 13 | string targetGamerHandle; 14 | cin >> targetGamerHandle; 15 | 16 | cout << "Specify the clanId:" << endl; 17 | string clanId; 18 | cin >> clanId; 19 | 20 | cout << "Specify if promote (true/false):" << endl; 21 | string promote; 22 | cin >> promote; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["targetGamerHandle"] = targetGamerHandle; 27 | map["clanId"] = clanId; 28 | map["promote"] = promote; 29 | 30 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/MemberUpdateRankId", map); // Invalid Argument for some reason 31 | } 32 | }; 33 | 34 | MemberUpdateRankId g_member_update_rank_id("memberupdaterankid"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/RankCreate.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class RankCreate : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the rankName (0-4):" << endl; //? 17 | string rankName; 18 | cin >> rankName; 19 | 20 | cout << "Specify the initialSystemFlags:" << endl; 21 | string initialSystemFlags; 22 | cin >> initialSystemFlags; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["clanId"] = clanId; 27 | map["rankName"] = rankName; 28 | map["initialSystemFlags"] = initialSystemFlags; 29 | 30 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/RankCreate", map); // Error: OutOfRange -> ClanRankLength 31 | } 32 | }; 33 | 34 | RankCreate g_rank_create("createcrewrank"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/RankDelete.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class RankDelete : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the rankId:" << endl; 17 | string rankId; 18 | cin >> rankId; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["clanId"] = clanId; 23 | map["rankId"] = rankId; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/RankDelete", map); 26 | } 27 | }; 28 | 29 | RankDelete g_rank_delete("deletecrewrank"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/SetPrimaryClan.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SetPrimaryClan : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["clanId"] = clanId; 19 | 20 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/SetPrimaryClan", map); 21 | } 22 | }; 23 | 24 | SetPrimaryClan g_set_primary_clan("setprimaryclan"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Clans/WriteWallMessage.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class WriteWallMessage : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the clanId:" << endl; 13 | string clanId; 14 | cin >> clanId; 15 | 16 | cout << "Specify the message:" << endl; 17 | string message; 18 | cin >> message; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["clanId"] = clanId; 23 | map["message"] = message; 24 | 25 | return run("http://crews-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Clans.asmx/WriteWallMessage", map); // Internal Server Error, no longer in use? 26 | } 27 | }; 28 | 29 | WriteWallMessage write_wall_message("writecrewwallmessage"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Decrypt.cpp: -------------------------------------------------------------------------------- 1 | #include "../../command.hpp" 2 | #include 3 | #include 4 | #include 5 | #include "../../ros_crypt.hpp" 6 | 7 | class Decrypt : command 8 | { 9 | using command::command; 10 | 11 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 12 | 13 | virtual string execute(const vector& args) 14 | { 15 | ifstream infile(R"(C:\Users\Bugisoft\Downloads\GTA_Reverse\request_content.txt)", ios_base::binary); 16 | 17 | vector bytes((istreambuf_iterator(infile)), (istreambuf_iterator())); 18 | 19 | return m_ros->DecryptROSData(&bytes[0], bytes.size(), SESSION_KEY); 20 | } 21 | }; 22 | 23 | Decrypt g_decrypt("decrypt"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/AcceptFriendRequest.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class AcceptFriendRequest : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstarId:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/AcceptInvite", map); // Missleading name, friend request not session invite 21 | } 22 | }; 23 | 24 | AcceptFriendRequest g_accept_friend_request("acceptfriendrequest"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/AddFriendByNickname.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class InviteByNickname : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the nickname:" << endl; 13 | string nickname; 14 | cin >> nickname; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["nickName"] = nickname; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/InviteByNickname", map); // This name is missleading since you doesnt actually "invite" a friend instead send a friend request 21 | } 22 | }; 23 | 24 | InviteByNickname g_invite_by_nickname("addfriendbyname"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/AddFriendByRockstarId.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class InviteByRockstarId : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstar id:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/InviteByRockstarId", map); // This name is missleading since you doesnt actually "invite" a friend instead send a friend request 21 | } 22 | }; 23 | 24 | InviteByRockstarId g_invite_by_rockstarid("addfriendbyrid"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/BlockCommunications.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class BlockCommunications : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstarId:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/Block", map); // Missleading name, dont have to be a friend 21 | } 22 | }; 23 | 24 | BlockCommunications g_block_communications("blockcoms"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/CancelFriendRequest.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CancelFriendRequest : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstar id:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/CancelInvite", map); 21 | } 22 | }; 23 | 24 | CancelFriendRequest g_cancel_invite("cancelfriendrequest"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/CountAll.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CountAll : command 5 | { 6 | using command::command; 7 | 8 | /* 9 | * Response: 10 | * b -> ? 11 | * f -> Friend Count 12 | * ir -> Friend Requests Received (See: getfriendrequestssent) 13 | * is -> Friend Requests Sent (See: 14 | */ 15 | 16 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 17 | 18 | virtual string execute(const vector& args) 19 | { 20 | map map; 21 | map["ticket"] = TICKET; 22 | 23 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/CountAll", map); 24 | } 25 | }; 26 | 27 | CountAll g_count_all_friends("countallfriends"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/DeclineFriendRequest.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class DeclineFriendRequest : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstarId:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/DeclineInvite", map); // Missleading name, friend request not session invite 21 | } 22 | }; 23 | 24 | DeclineFriendRequest g_decline_friend_request("declinefriendrequest"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/GetBlocked.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetBlocked : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the page index:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the page size:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/GetBlocked", map); // Missleading name, not blocked friends just overall blocked players 26 | } 27 | }; 28 | 29 | GetBlocked g_get_blocked("getblocked"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/GetFriendRequestsReceived.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetFriendRequestsReceived : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the page index:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the page size:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/GetInvitesReceived", map); // Again missleading name 26 | } 27 | }; 28 | 29 | GetFriendRequestsReceived g_get_friend_requests_received("getfriendrequestsreceived"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/GetFriendRequestsSent.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetFriendRequestsSent : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the page index:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the page size:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/GetInvitesSent", map); // Again missleading name 26 | } 27 | }; 28 | 29 | GetFriendRequestsSent g_get_friend_requests("getfriendrequestssent"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/GetFriends.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetFriends : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the page index:" << endl; 13 | string pageIndex; 14 | cin >> pageIndex; 15 | 16 | cout << "Specify the page size:" << endl; 17 | string pageSize; 18 | cin >> pageSize; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["pageIndex"] = pageIndex; 23 | map["pageSize"] = pageSize; 24 | 25 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/GetFriends", map); 26 | } 27 | }; 28 | 29 | GetFriends g_get_friends("getfriends"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/GetFriendsAndRequestsSent.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | // Basically this just also includes the crew name and id 5 | 6 | class GetFriendsAndRequestsSent : command 7 | { 8 | using command::command; 9 | 10 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 11 | 12 | virtual string execute(const vector& args) 13 | { 14 | cout << "Specify the page index:" << endl; 15 | string pageIndex; 16 | cin >> pageIndex; 17 | 18 | cout << "Specify the page size:" << endl; 19 | string pageSize; 20 | cin >> pageSize; 21 | 22 | map map; 23 | map["ticket"] = TICKET; 24 | map["pageIndex"] = pageIndex; 25 | map["pageSize"] = pageSize; 26 | 27 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/GetFriendsAndInvitesSent", map); // missleading name 28 | } 29 | }; 30 | 31 | GetFriendsAndRequestsSent g_get_friends_and_requests_sent("getfriendsandrequestssent"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/RemoveFriend.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class RemoveFriend : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstar id:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/RemoveFriend", map); 21 | } 22 | }; 23 | 24 | RemoveFriend g_remove_friend("removefriend"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Friends/UnblockCommunications.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class UnblockCommunications : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the rockstarId:" << endl; 13 | string rockstarId; 14 | cin >> rockstarId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["rockstarId"] = rockstarId; 19 | 20 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Friends.asmx/Unblock", map); // Missleading name, dont have to be a friend 21 | } 22 | }; 23 | 24 | UnblockCommunications g_unblock_communications("unblockcoms"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/GeoLocation/GetLocationInfoFromIP.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | 3 | class GetLocationInfoFromIP : command 4 | { 5 | using command::command; 6 | 7 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 8 | 9 | virtual string execute(const vector& args) 10 | { 11 | cout << "Specify the ip:" << endl; 12 | string target_rid; 13 | cin >> target_rid; 14 | 15 | map map; 16 | map["ticket"] = TICKET; 17 | map["ipAddrStr"] = target_rid; 18 | 19 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/GeoLocation.asmx/GetLocationInfoFromIP", map); 20 | } 21 | }; 22 | 23 | GetLocationInfoFromIP g_get_location_info_from_ip("getlocationinfofromip"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/GeoLocation/GetRelayServers.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetRelayServers : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the ipAddrStr:" << endl; 13 | string ipAddrStr; 14 | cin >> ipAddrStr; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["ipAddrStr"] = ipAddrStr; 19 | map["secure"] = "false"; 20 | 21 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/GeoLocation.asmx/GetRelayServers", map); 22 | } 23 | }; 24 | 25 | GetRelayServers g_get_relay_servers("getrelayservers"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Inbox/SendAward.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | #include 4 | 5 | class SendAwardMsg : command 6 | { 7 | using command::command; 8 | 9 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 10 | 11 | virtual string execute(const vector& args) 12 | { 13 | cout << "Specify the target rid:" << endl; 14 | string target_rid; 15 | cin >> target_rid; 16 | 17 | cout << "Specify the sender name:" << endl; 18 | string senderGamerTag; 19 | cin >> senderGamerTag; 20 | 21 | map map; 22 | map["ticket"] = TICKET; 23 | map["recipientsCsv"] = target_rid; 24 | map["message"] = format(R"("ros.publish":{{"channel":"friends","msg":{{"gm.evt":{{"e":"StatUpdate","d":{{"stat":1488317176,"from":"{}","ival":100}}}}}}}})", senderGamerTag); 25 | map["ttlSeconds"] = "0"; 26 | 27 | return run("http://prs-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Presence.asmx/MultiPostMessage", map); 28 | } 29 | }; 30 | 31 | SendAwardMsg g_send_award_msg("sendawardmessage"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Inbox/SendBounty.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class BountyCompletedMsg : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the target rid:" << endl; 13 | string target_rid; 14 | cin >> target_rid; 15 | 16 | cout << "Specify the tl31FromGamerTag:" << endl; 17 | string tl31FromGamerTag; 18 | cin >> tl31FromGamerTag; 19 | 20 | cout << "Specify the tl31TargetGamerTag:" << endl; 21 | string tl31TargetGamerTag; 22 | cin >> tl31TargetGamerTag; 23 | 24 | cout << "Specify the iOutcome:" << endl; 25 | string iOutcome; 26 | cin >> iOutcome; 27 | 28 | cout << "Specify the iCash:" << endl; 29 | string iCash; 30 | cin >> iCash; 31 | 32 | cout << "Specify the iRank:" << endl; 33 | string iRank; 34 | cin >> iRank; 35 | 36 | map map; 37 | map["ticket"] = TICKET; 38 | map["userIds"] = target_rid; 39 | map["message"] = format(R"({{"gm.evt":{{"e":"bounty","d":{{"Ft":"{}","Tt":"{}","o":{},"c":{},"r":{},"t":1690670145566}}}}}})", tl31FromGamerTag, tl31TargetGamerTag, iOutcome, iCash, iRank); 40 | map["tagsCsv"] = "gta5"; 41 | map["ttlSeconds"] = "1800"; 42 | 43 | return run("http://inbox-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Inbox.asmx/PostMessageToRecipients", map); 44 | } 45 | }; 46 | 47 | BountyCompletedMsg g_send_bounty_completed_msg("sendbountycompletedmsg"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Inbox/SendEmail.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SendEmail : command 5 | { 6 | using command::command; 7 | 8 | class rlGamerHandle 9 | { 10 | public: 11 | uint64_t m_rockstar_id; //0x0000 12 | uint8_t m_platform = 3; //0x0008 13 | uint8_t unk_0009; //0x0009 14 | }; //Size: 0x0010 15 | static_assert(sizeof(rlGamerHandle) == 0x10); 16 | 17 | string rlGamerHandleToBase64(const rlGamerHandle& handle) 18 | { 19 | const char* base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 20 | 21 | vector bytes(sizeof(rlGamerHandle)); 22 | memcpy(bytes.data(), &handle, sizeof(rlGamerHandle)); 23 | 24 | string result; 25 | size_t paddingCount = (3 - bytes.size() % 3) % 3; 26 | 27 | for (size_t i = 0; i < bytes.size(); i += 3) 28 | { 29 | uint32_t value = (bytes[i] << 16) | ((i + 1 < bytes.size() ? bytes[i + 1] : 0) << 8) | ((i + 2 < bytes.size() ? bytes[i + 2] : 0)); 30 | result += base64Chars[(value >> 18) & 0x3F]; 31 | result += base64Chars[(value >> 12) & 0x3F]; 32 | result += (i + 1 < bytes.size() || paddingCount < 2) ? base64Chars[(value >> 6) & 0x3F] : '='; 33 | result += (i + 2 < bytes.size() || paddingCount < 1) ? base64Chars[value & 0x3F] : '='; 34 | } 35 | 36 | return result; 37 | } 38 | 39 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 40 | 41 | virtual string execute(const vector& args) 42 | { 43 | cout << "Specify the sender rid:" << endl; 44 | string sender_rid; 45 | cin >> sender_rid; 46 | 47 | cout << "Specify the target rid:" << endl; 48 | string target_rid; 49 | cin >> target_rid; 50 | 51 | cin.ignore(1000000, '\n'); 52 | 53 | cout << "Specify the subject:" << endl; 54 | string subject; 55 | getline(cin, subject); 56 | 57 | cin.ignore(1000000, '\n'); 58 | 59 | cout << "Specify the content:" << endl; 60 | string content; 61 | getline(cin, content); 62 | 63 | rlGamerHandle handle = rlGamerHandle(stoull(sender_rid)); 64 | 65 | map map; 66 | map["ticket"] = TICKET; 67 | map["userIds"] = target_rid; 68 | map["message"] = format(R"({{"email":{{"gh":"{}","sb":"{}","cn":"{}"}}}})", rlGamerHandleToBase64(handle), subject, content); 69 | map["tagsCsv"] = "gta5email"; // gta5marketing 70 | map["ttlSeconds"] = "2592000"; // 1800 71 | 72 | return run("http://inbox-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Inbox.asmx/PostMessageToRecipients", map); 73 | } 74 | }; 75 | 76 | SendEmail g_send_email("sendemail"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Matchmaking/Matchmaking.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class Matchmaking : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["ticket"] = TICKET; 14 | map["availableSlots"] = "1"; 15 | map["filterName"] = "Group"; 16 | // filterParamsJson={"GAME_MODE":0,"MMATTR_REGION":0} 17 | map["filterParamsJson"] = R"({"GAME_MODE":0,"MMATTR_MM_GROUP_2":30,"MMATTR_REGION":3})"; 18 | map["maxResults"] = "999999"; 19 | 20 | return run("http://mm-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/matchmaking.asmx/Find", map); 21 | } 22 | }; 23 | 24 | Matchmaking g_matchmaking("matchmaking"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Presence/QueryWithMaxRecordLength.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | #include 4 | 5 | class QueryWithMaxRecordLength : command 6 | { 7 | using command::command; 8 | 9 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 10 | 11 | virtual string execute(const vector& args) 12 | { 13 | cout << "Specify the target rid:" << endl; 14 | string target_rid; 15 | cin >> target_rid; 16 | 17 | map map; 18 | map["ticket"] = TICKET; 19 | map["queryName"] = "SessionByGamerHandle"; 20 | map["paramNameValueCsv"] = format(R"(@ghandle,"SC+{}")", target_rid); 21 | map["offset"] = "0"; 22 | map["count"] = "20"; 23 | map["maxQueryBufferSize"] = "7680"; 24 | 25 | return run("http://prs-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Presence.asmx/QueryWithMaxRecordLength", map); 26 | } 27 | }; 28 | 29 | QueryWithMaxRecordLength query_with_max_record_length("querywithmaxrecordlength"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Presence/SendInvite.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SendInvite : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the sender rid:" << endl; 13 | string sender_rid; 14 | cin >> sender_rid; 15 | cout << "Specify the sender name:" << endl; 16 | string sender_name; 17 | cin >> sender_name; 18 | cout << "Specify the target rid:" << endl; 19 | string target_rid; 20 | cin >> target_rid; 21 | cout << "Specify the session info:" << endl; 22 | string session_info; 23 | cin >> session_info; 24 | 25 | map map; 26 | map["ticket"] = TICKET; 27 | map["recipientsCsv"] = "SC+" + target_rid; 28 | map["message"] = format(R"("ros.mp.invite":{{"h":"SC+{}","n":"{}","s":"{}"}})", sender_rid, sender_name, session_info); 29 | map["ttlSeconds"] = "0"; 30 | 31 | return run("http://prs-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/Presence.asmx/MultiPostMessage", map); 32 | } 33 | }; 34 | 35 | SendInvite g_send_invite("sendinvite"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/ProfileStatGroups/ReadGameConfig.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | //#include 4 | 5 | class ReadGameConfig : command 6 | { 7 | using command::command; 8 | 9 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 10 | 11 | virtual string execute(const vector& args) 12 | { 13 | map map; 14 | map["ticket"] = TICKET; 15 | 16 | //ofstream of("readgameconfig.txt"); 17 | //of << run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ProfileStatGroups.asmx/ReadGameConfig", map); 18 | 19 | return run("http://gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ProfileStatGroups.asmx/ReadGameConfig", map); // Response text is too large for console 20 | } 21 | }; 22 | 23 | ReadGameConfig g_read_game_config("readgameconfig"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/ProfileStats/ReadAllStats.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class ReadAllStats : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["ticket"] = TICKET; 14 | 15 | return run("https://ps-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/ReadAllStats", map); // loads infinite? 16 | } 17 | }; 18 | 19 | ReadAllStats g_read_all_stats("readallstats"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Socialclub/CreateAccountSc.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CreateAccountSc : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the country code" << endl; 13 | string countryCode; 14 | cin >> countryCode; 15 | 16 | cout << "Specify the date of bearth (dd/mm/yyyy)" << endl; 17 | string dob; 18 | cin >> dob; 19 | 20 | cout << "Specify the email" << endl; 21 | string email; 22 | cin >> email; 23 | 24 | cout << "Specify the language code" << endl; 25 | string languageCode; 26 | cin >> languageCode; 27 | 28 | cout << "Specify the nickname" << endl; 29 | string nickname; 30 | cin >> nickname; 31 | 32 | cout << "Specify the password" << endl; 33 | string password; 34 | cin >> password; 35 | 36 | map map; 37 | map["acceptNewsletter"] = "false"; 38 | map["avatarUrl"] = "https://prod-avatars.akamaized.net/stock-avatars/n/GTAO/CASINO_2.png"; 39 | map["countryCode"] = countryCode; 40 | map["dob"] = dob; 41 | map["email"] = email; 42 | map["isApproxDob"] = "False"; 43 | map["languageCode"] = languageCode; 44 | map["nickname"] = nickname; 45 | map["password"] = password; 46 | map["phone"] = ""; 47 | map["platform"] = "pcros"; 48 | map["zipCode"] = "1379800"; 49 | 50 | 51 | return run("http://prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/CreateAccountSc", map); 52 | } 53 | }; 54 | 55 | CreateAccountSc g_create_account_sc("createaccountsc"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Socialclub/GetAccountInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetAccountInfo : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["ticket"] = TICKET; 14 | 15 | return run("http://prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/GetAccountInfo", map); 16 | } 17 | }; 18 | 19 | GetAccountInfo g_get_account_info("getaccountinfo"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Socialclub/GetScAuthToken.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class GetScAuthToken : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["ticket"] = TICKET; 14 | 15 | return run("http://prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/GetScAuthToken", map); 16 | } 17 | }; 18 | 19 | GetScAuthToken g_get_sc_auth_token("getscauthtoken"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Socialclub/LinkAccount2.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class LinkAccount2 : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the email:" << endl; 13 | string email; 14 | cin >> email; 15 | 16 | cout << "Specify the nickname:" << endl; 17 | string nickname; 18 | cin >> nickname; 19 | 20 | cout << "Specify the password:" << endl; 21 | string password; 22 | cin >> password; 23 | 24 | map map; 25 | map["ticket"] = TICKET; 26 | map["email"] = email; 27 | map["nickname"] = nickname; 28 | map["password"] = password; 29 | 30 | return run("http://prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/LinkAccount2", map); 31 | } 32 | }; 33 | 34 | LinkAccount2 g_link_account_2("linkaccount2"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/Socialclub/UpdateAccount.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | #include "AccountInfo.hpp" 4 | 5 | class UpdateAccount : command 6 | { 7 | using command::command; 8 | 9 | inline AccountInfo GetAccountInfo() 10 | { 11 | string data = command::get(hash()("getaccountinfo"))->execute({}); 12 | pugi::xml_document doc; 13 | AccountInfo accountInfo{}; 14 | 15 | if (doc.load_string(data.c_str())) 16 | { 17 | auto path = doc.select_node("//Response/RockstarAccount"); 18 | auto node = path.node(); 19 | 20 | accountInfo.m_rockstar_id = node.child("RockstarId").text().as_uint(); 21 | accountInfo.m_age = node.child("Age").text().as_int(); 22 | accountInfo.m_avatar_url = node.child("AvatarUrl").text().as_string(); 23 | accountInfo.m_country_code = node.child("CountryCode").text().as_string(); 24 | accountInfo.m_date_of_birth = node.child("Dob").text().as_string(); 25 | accountInfo.m_email = node.child("Email").text().as_string(); 26 | accountInfo.m_is_approx_dob = node.child("IsApproxDob").text().as_bool(); // TODO 27 | accountInfo.m_language_code = node.child("LanguageCode").text().as_string(); 28 | accountInfo.m_nickname = node.child("Nickname").text().as_string(); 29 | accountInfo.m_last_portal_login_date = node.child("LastPortalLoginDate").text().as_string(); 30 | } 31 | 32 | return accountInfo; 33 | } 34 | 35 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 36 | 37 | virtual string execute(const vector& args) 38 | { 39 | AccountInfo accountInfo = GetAccountInfo(); 40 | 41 | cout << "Specify the email:" << endl; 42 | string email; 43 | cin >> email; 44 | 45 | map map; 46 | map["ticket"] = TICKET; 47 | map["avatarUrl"] = "null"; // if this invalid, it will be skipped, you can't just put a .jpg or .png there 48 | map["countryCode"] = accountInfo.m_country_code; 49 | map["dob"] = accountInfo.m_date_of_birth; 50 | map["email"] = email; 51 | map["isApproxDob"] = accountInfo.m_is_approx_dob ? "True" : "False"; 52 | map["languageCode"] = accountInfo.m_language_code; 53 | map["nickname"] = accountInfo.m_nickname; 54 | map["phone"] = ""; 55 | map["zipCode"] = ""; 56 | 57 | 58 | return run("http://prod.ros.rockstargames.com/gta5/11/gameservices/socialclub.asmx/UpdateAccount", map); 59 | } 60 | }; 61 | 62 | UpdateAccount g_update_account("updateaccount"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/CheckText.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CheckText : command 5 | { 6 | // Tested from UGC Creator -> Job Title 7 | 8 | using command::command; 9 | 10 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 11 | 12 | virtual string execute(const vector& args) 13 | { 14 | cout << "Specify the text to check:" << endl; 15 | string text; 16 | cin >> text; 17 | 18 | map map; 19 | map["ticket"] = TICKET; 20 | map["languageCode"] = ""; // Can be empty 21 | map["contentName"] = ""; // Can be empty 22 | map["description"] = text; // Text to check 23 | map["tagCsv"] = ""; // Can be empty 24 | 25 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/CheckText", map); 26 | } 27 | }; 28 | 29 | CheckText g_check_text("checktext"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/CopyJob.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | #include "../../../ros_crypt.hpp" 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | class CopyJob : command 11 | { 12 | using command::command; 13 | 14 | inline bool GetJobDetails(string_view content_id, string& title, string& description, string& type, vector& tags, string& image) 15 | { 16 | cpr::Response response = cpr::Get( 17 | cpr::Url{ "https://scapi.rockstargames.com/ugc/mission/details" }, 18 | cpr::Header{ {"X-AMC", "true" }, { "X-Requested-With", "XMLHttpRequest"} }, 19 | cpr::Parameters{ {"title", "gtav"}, {"contentId", content_id.data()} }); 20 | 21 | nlohmann::json job_details = nlohmann::json::parse(string{ response.text }); 22 | 23 | if (job_details["content"].is_object()) 24 | { 25 | nlohmann::json content = job_details["content"]; 26 | 27 | title = content["name"]; 28 | description = content["desc"]; 29 | type = content["type"]; 30 | tags = content["userTags"]; 31 | image = content["imgSrc"]; 32 | 33 | return true; 34 | } 35 | 36 | return false; 37 | } 38 | 39 | inline bool GetJobMetaData(string_view content_id, string& result, string& lang) 40 | { 41 | string data = command::get(hash()("querycontent"))->execute({ "1", content_id.data()}); 42 | pugi::xml_document doc; 43 | int f0 = 0, f1 = 0; 44 | 45 | if (doc.load_string(data.c_str())) 46 | { 47 | auto path = doc.select_node("//Response/Result/r/m"); 48 | auto node = path.node(); 49 | 50 | f1 = node.attribute("f1").as_int(); 51 | f0 = node.attribute("f0").as_int(); 52 | lang = node.attribute("l").as_string(); 53 | } 54 | 55 | cpr::Response response = cpr::Get(cpr::Url{ format("https://prod.cloud.rockstargames.com/ugc/gta5mission/{}/{}_{}_{}.json", content_id, f1 < 0 ? 0 : f1, f0 < 0 ? 0 : f0, lang.empty() ? "en" : lang) }); 56 | 57 | result = response.text; 58 | 59 | return response.status_code == 200; 60 | } 61 | 62 | vector HexToBytes(const string& hex) { 63 | vector bytes; 64 | 65 | for (unsigned int i = 0; i < hex.length(); i += 2) { 66 | string byteString = hex.substr(i, 2); 67 | unsigned char byte = (unsigned char)strtol(byteString.c_str(), NULL, 16); 68 | bytes.push_back(byte); 69 | } 70 | 71 | return bytes; 72 | } 73 | 74 | vector get_data_len(size_t data_len, bool image) 75 | { 76 | stringstream ss; 77 | ss << hex << data_len; 78 | string data_len_hex = ss.str(); 79 | 80 | 81 | if (data_len_hex.length() % 2 != 0) { 82 | data_len_hex = "0" + data_len_hex; 83 | } 84 | 85 | vector data_len_bytes = HexToBytes(data_len_hex); 86 | 87 | switch (data_len_bytes.size()) { 88 | case 1: 89 | data_len_bytes.insert(data_len_bytes.begin(), 3, 0); 90 | break; 91 | case 2: 92 | data_len_bytes.insert(data_len_bytes.begin(), 2, 0); 93 | break; 94 | case 3: 95 | data_len_bytes.insert(data_len_bytes.begin(), 1, 0); 96 | break; 97 | default: 98 | break; 99 | } 100 | 101 | data_len_bytes.insert(data_len_bytes.end(), 3, 0); 102 | if (image) 103 | data_len_bytes.push_back(2); 104 | else 105 | data_len_bytes.push_back(0); 106 | 107 | return data_len_bytes; 108 | } 109 | 110 | string replaceAll(string const& original, string const& from, string const& to) 111 | { 112 | string results; 113 | string::const_iterator end = original.end(); 114 | string::const_iterator current = original.begin(); 115 | string::const_iterator next = search(current, end, from.begin(), from.end()); 116 | while (next != end) { 117 | results.append(current, next); 118 | results.append(to); 119 | current = next + from.size(); 120 | next = search(current, end, from.begin(), from.end()); 121 | } 122 | results.append(current, next); 123 | return results; 124 | } 125 | 126 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 127 | 128 | virtual string execute(const vector& args) 129 | { 130 | cout << "Specify the content id:" << endl; 131 | string content_id; 132 | cin >> content_id; 133 | 134 | string title, description, type, image; 135 | vector tags; 136 | string metadata, lang; 137 | 138 | if (GetJobDetails(content_id, title, description, type, tags, image)) 139 | { 140 | if (!GetJobMetaData(content_id, metadata, lang)) 141 | { 142 | return "Couldn't download job metadata"; 143 | } 144 | } 145 | 146 | map map; 147 | 148 | ofstream of("2_0.jpg", ios::binary); 149 | cpr::Response r = cpr::Download(of, cpr::Url{ image }); 150 | ifstream input("2_0.jpg", ios_base::binary); 151 | vector image_bytes((istreambuf_iterator(input)), (istreambuf_iterator())); 152 | 153 | nlohmann::json meta_json = nlohmann::json::parse(metadata); 154 | 155 | vector data_len = get_data_len(meta_json.dump().size(), false); 156 | vector image_data_len = get_data_len(image_bytes.size(), true); 157 | 158 | nlohmann::json datajson; 159 | datajson["meta"] = meta_json["meta"]; 160 | datajson["mission"] = meta_json["mission"]; 161 | datajson["version"] = 2; 162 | 163 | auto dataJsonDump = datajson.dump(); 164 | 165 | string temp = format("ticket={}&contentType=gta5mission¶msJson=", m_ros->url_encode(TICKET)); 166 | 167 | std::string tagsSep = std::accumulate( 168 | std::begin(tags), 169 | std::end(tags), 170 | std::string(), 171 | [](const std::string& accumulator, const std::string& element) { 172 | return accumulator.empty() ? element : accumulator + "," + element; 173 | } 174 | ); 175 | 176 | nlohmann::json obj; 177 | obj["ContentName"] = title; 178 | obj["DataJson"] = m_ros->ex_url_encode(replaceAll(datajson.dump(), "\"", "\\\"")); 179 | obj["Description"] = description; 180 | obj["Publish"] = "true"; 181 | obj["Language"] = lang.empty() ? "en" : lang; 182 | obj["TagCsv"] = tagsSep; 183 | 184 | temp += obj.dump(); 185 | temp += "&data="; 186 | 187 | for (auto& i : data_len) 188 | { 189 | temp += i; 190 | } 191 | 192 | temp += meta_json.dump(); 193 | 194 | for (auto& i : image_data_len) 195 | { 196 | temp += i; 197 | } 198 | for (auto& i : image_bytes) 199 | { 200 | temp += i; 201 | } 202 | 203 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/CreateContent", temp); 204 | } 205 | }; 206 | 207 | CopyJob g_copy_job("copyjob"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/CopyLocalContent.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class CopyLocalContent : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["ticket"] = TICKET; 14 | map["contentType"] = "gta5mission"; 15 | map["contentId"] = "Qa2frulcv0u2eHmWg7KSHA"; // TODO 16 | 17 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/CopyContent", map); 18 | } 19 | }; 20 | 21 | CopyLocalContent g_copy_local_content("copylocalcontent"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/DeleteContent.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class DeleteContent : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the content id:" << endl; 13 | string contentId; 14 | cin >> contentId; 15 | 16 | map map; 17 | map["ticket"] = TICKET; 18 | map["contentType"] = "gta5mission"; 19 | map["contentId"] = contentId; 20 | map["deleted"] = "true"; 21 | 22 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/SetDeleted", map); 23 | } 24 | }; 25 | 26 | DeleteContent g_delete_content("deletecontent"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/QueryContent.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class QueryContent : command 5 | { 6 | using command::command; 7 | 8 | enum QueryType { 9 | GetLatestVersionByContentId = 1, 10 | GetMyBookmarkedContent, 11 | GetMyContent, 12 | GetRecentlyCreatedContent, 13 | GetMyRecentlyPlayedContent, 14 | GetFriendContent, 15 | GetTopRatedContent 16 | }; 17 | 18 | QueryType getQueryType(const vector& args) { 19 | if (args.empty()) { 20 | cout << "Select one of the following query names:" << endl; 21 | cout << "(1) GetLatestVersionByContentId" << endl; 22 | cout << "(2) GetMyBookmarkedContent" << endl; 23 | cout << "(3) GetMyContent" << endl; 24 | cout << "(4) GetRecentlyCreatedContent" << endl; 25 | cout << "(5) GetMyRecentlyPlayedContent" << endl; 26 | cout << "(6) GetFriendContent" << endl; 27 | cout << "(7) GetTopRatedContent" << endl; 28 | 29 | int type; 30 | cin >> type; 31 | 32 | return static_cast(type); 33 | } 34 | else { 35 | return static_cast(stoi(args[0])); 36 | } 37 | } 38 | 39 | string getQueryName(QueryType type) { 40 | switch (type) { 41 | case GetLatestVersionByContentId: 42 | return "GetLatestVersionByContentId"; 43 | case GetMyBookmarkedContent: 44 | return "GetMyBookmarkedContent"; 45 | case GetMyContent: 46 | return "GetMyContent"; 47 | case GetRecentlyCreatedContent: 48 | return "GetRecentlyCreatedContent"; 49 | case GetMyRecentlyPlayedContent: 50 | return "GetMyRecentlyPlayedContent"; 51 | case GetFriendContent: 52 | return "GetFriendContent"; 53 | case GetTopRatedContent: 54 | return "GetTopRatedContent"; 55 | } 56 | return ""; 57 | } 58 | 59 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 60 | 61 | virtual string execute(const vector& args) 62 | { 63 | string contentId; 64 | string queryName; 65 | string count; 66 | 67 | map params; 68 | params["ticket"] = TICKET; 69 | params["queryName"] = queryName; 70 | 71 | QueryType queryType = getQueryType(args); 72 | params["queryName"] = getQueryName(queryType); 73 | 74 | if (!args.empty()) 75 | contentId = args[1]; 76 | else if (queryType == QueryType::GetLatestVersionByContentId) 77 | { 78 | cout << "Specify the contentId:" << endl; 79 | cin >> contentId; 80 | } 81 | 82 | switch (queryType) { 83 | case GetLatestVersionByContentId: 84 | 85 | params["contentType"] = "gta5mission"; 86 | params["queryParams"] = "{contentids:[\"" + contentId + "\"], lang: ['en', 'fr', 'de', 'it', 'es', 'pt', 'pl', 'ru', 'es-mx'] }"; 87 | params["offset"] = "0"; 88 | params["count"] = "1"; 89 | break; 90 | case GetMyBookmarkedContent: 91 | case GetMyContent: 92 | case GetRecentlyCreatedContent: 93 | case GetMyRecentlyPlayedContent: 94 | case GetFriendContent: 95 | case GetTopRatedContent: 96 | cout << "Specify the count:" << endl; 97 | cin >> count; 98 | 99 | params["contentType"] = "gta5mission"; 100 | params["queryParams"] = "{lang:['de','en','fr','it','es','pt','pl','ru','es-mx']}"; 101 | params["offset"] = "0"; 102 | params["count"] = count; 103 | break; 104 | } 105 | 106 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/QueryContent", params); 107 | } 108 | }; 109 | 110 | QueryContent g_query_content("querycontent"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/QueryContentCreators.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class QueryContentCreators : command 5 | { 6 | // No clue for what this is used and why but GetByUserId seems to be the only queryName 7 | 8 | using command::command; 9 | 10 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 11 | 12 | virtual string execute(const vector& args) 13 | { 14 | cout << "Specify the content creator RID:" << endl; // TODO support multiple 15 | string contentCreators; 16 | cin >> contentCreators; 17 | 18 | map map; 19 | map["ticket"] = TICKET; 20 | map["contentType"] = "gta5mission"; 21 | map["queryName"] = "GetByUserId"; 22 | map["queryParams"] = "{userids:[" + contentCreators + "]}"; // You can input here multiple seperated by a comma 23 | map["offset"] = "0"; 24 | map["count"] = "10"; 25 | 26 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/QueryContentCreators", map); 27 | } 28 | }; 29 | 30 | QueryContentCreators g_query_content_creators("querycontentcreators"); -------------------------------------------------------------------------------- /src/commands/prod.ros.rockstargames.com/UGC/SetBookmarked.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SetBookmarked : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_ROS; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the content id:" << endl; 13 | string contentId; 14 | cin >> contentId; 15 | 16 | cout << "Specify if it should be bookmarked (true/false):" << endl; 17 | string bookmarked; 18 | cin >> bookmarked; 19 | 20 | map map; 21 | map["ticket"] = TICKET; 22 | map["contentType"] = "gta5mission"; 23 | map["contentId"] = contentId; 24 | map["bookmarked"] = bookmarked; 25 | 26 | return run("http://ugc-gta5-prod.ros.rockstargames.com/gta5/11/gameservices/ugc.asmx/SetBookmarked", map); 27 | } 28 | }; 29 | 30 | SetBookmarked g_set_bookmarked("setbookmarked"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/Search/SearchCrew.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SearchCrew : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["title"] = "gtav"; 14 | map["platform"] = "pc"; 15 | map["includeCommentCount"] = "false"; 16 | //map["searchTerm"] = "looping"; 17 | //map["sort"] = "membercount"; 18 | //map["dateRange"] = "any"; 19 | //map["pageSize"] = "1"; 20 | //map["crewtype"] = "rockstar"; 21 | 22 | return run("https://scapi.rockstargames.com/search/crew", map); 23 | } 24 | }; 25 | 26 | SearchCrew g_search_crew("searchcrew"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/Search/SearchMission.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SearchMission : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["title"] = "gtav"; 14 | map["platform"] = "pc"; 15 | map["includeCommentCount"] = "false"; 16 | map["searchTerm"] = "looping"; 17 | //map["sort"] = "date"; 18 | //map["dateRange"] = "any"; 19 | //map["creatorRockstarId"] = "12345678"; 20 | map["pageSize"] = "1"; 21 | //map["filter"] = "friends"; 22 | 23 | return run("https://scapi.rockstargames.com/search/mission", map); 24 | } 25 | }; 26 | 27 | SearchMission g_search_mission("searchmission"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/Search/SearchPhoto.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SearchPhoto : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["title"] = "gtav"; 14 | map["platform"] = "pc"; 15 | map["includeCommentCount"] = "false"; 16 | //map["searchTerm"] = "looping"; 17 | //map["sort"] = "date"; 18 | //map["dateRange"] = "any"; 19 | //map["creatorRockstarId"] = "12345678"; 20 | //map["pageSize"] = "1"; 21 | //map["filter"] = "friends"; 22 | //map["regularPhoto"] = "true"; 23 | //map["selfie"] = "true"; 24 | //map["mugshot"] = "true"; 25 | 26 | return run("https://scapi.rockstargames.com/search/photo", map); 27 | } 28 | }; 29 | 30 | SearchPhoto g_search_photo("searchphoto"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/Search/SearchVideo.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class SearchVideo : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | map map; 13 | map["title"] = "gtav"; 14 | map["platform"] = "pc"; 15 | map["includeCommentCount"] = "false"; 16 | //map["searchTerm"] = "looping"; 17 | //map["sort"] = "date"; 18 | //map["dateRange"] = "any"; 19 | //map["creatorRockstarId"] = "12345678"; 20 | //map["pageSize"] = "1"; 21 | //map["filter"] = "friends"; 22 | 23 | return run("https://scapi.rockstargames.com/search/video", map); 24 | } 25 | }; 26 | 27 | SearchVideo g_search_video("searchvideo"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/UGC/MissionComments.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class MissionComments : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the contentId" << endl; 13 | string contentId; 14 | cin >> contentId; 15 | 16 | map map; 17 | map["title"] = "gtav"; 18 | map["contentId"] = contentId; 19 | 20 | return run("https://scapi.rockstargames.com/ugc/mission/comments", map); 21 | } 22 | }; 23 | 24 | MissionComments g_mission_comments("getmissioncomments"); -------------------------------------------------------------------------------- /src/commands/scapi.rockstargames.com/UGC/MissionDetails.cpp: -------------------------------------------------------------------------------- 1 | #include "../../../command.hpp" 2 | #include 3 | 4 | class MissionDetails : command 5 | { 6 | using command::command; 7 | 8 | SERVICE_TYPE get_service_type() { return SERVICE_TYPE::PROD_SCAPI_AMC; } 9 | 10 | virtual string execute(const vector& args) 11 | { 12 | cout << "Specify the contentId" << endl; 13 | string contentId; 14 | cin >> contentId; 15 | 16 | map map; 17 | map["title"] = "gtav"; 18 | map["contentId"] = contentId; 19 | 20 | return run("https://scapi.rockstargames.com/ugc/mission/details", map); 21 | } 22 | }; 23 | 24 | MissionDetails g_mission_details("getmissiondetails"); -------------------------------------------------------------------------------- /src/common.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "command.hpp" -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include "command.hpp" 7 | #include 8 | #include "cpr/cpr.h" 9 | #include 10 | #include "AccountInfo.hpp" 11 | #include 12 | 13 | #ifdef _WIN32 14 | #include 15 | #include 16 | #endif 17 | 18 | using namespace std; 19 | 20 | #ifdef _WIN32 21 | uintptr_t GetModuleBaseAddress(DWORD procId, const char* modName) 22 | { 23 | uintptr_t modBaseAddr = 0; 24 | HANDLE hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE | TH32CS_SNAPMODULE32, procId); 25 | if (hSnap != INVALID_HANDLE_VALUE) 26 | { 27 | MODULEENTRY32 modEntry; 28 | modEntry.dwSize = sizeof(modEntry); 29 | if (Module32First(hSnap, &modEntry)) 30 | { 31 | do 32 | { 33 | if (!strcmp(modEntry.szModule, modName)) 34 | { 35 | modBaseAddr = (uintptr_t)modEntry.modBaseAddr; 36 | break; 37 | } 38 | } while (Module32Next(hSnap, &modEntry)); 39 | } 40 | } 41 | CloseHandle(hSnap); 42 | return modBaseAddr; 43 | } 44 | #endif 45 | 46 | AccountInfo GetAccountInfo() 47 | { 48 | string data = command::get(hash()("getaccountinfo"))->execute({}); 49 | pugi::xml_document doc; 50 | AccountInfo accountInfo{}; 51 | 52 | if (doc.load_string(data.c_str())) 53 | { 54 | auto path = doc.select_node("//Response/RockstarAccount"); 55 | auto node = path.node(); 56 | 57 | accountInfo.m_rockstar_id = node.child("RockstarId").text().as_uint(); 58 | accountInfo.m_age = node.child("Age").text().as_int(); 59 | accountInfo.m_avatar_url = node.child("AvatarUrl").text().as_string(); 60 | accountInfo.m_country_code = node.child("CountryCode").text().as_string(); 61 | accountInfo.m_date_of_birth = node.child("Dob").text().as_string(); 62 | accountInfo.m_email = node.child("Email").text().as_string(); 63 | accountInfo.m_is_approx_dob = node.child("IsApproxDob").text().as_bool(); // TODO 64 | accountInfo.m_language_code = node.child("LanguageCode").text().as_string(); 65 | accountInfo.m_nickname = node.child("Nickname").text().as_string(); 66 | accountInfo.m_last_portal_login_date = node.child("LastPortalLoginDate").text().as_string(); 67 | } 68 | 69 | return accountInfo; 70 | } 71 | 72 | /* 73 | * 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | */ 88 | 89 | int main() 90 | { 91 | string endpoint; 92 | 93 | #ifdef _WIN64 94 | SetConsoleOutputCP(CP_UTF8); 95 | 96 | HWND hwnd = FindWindowA(NULL, "Grand Theft Auto V"); 97 | if (hwnd) 98 | { 99 | DWORD pid; 100 | GetWindowThreadProcessId(hwnd, &pid); 101 | HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS, 0, pid); 102 | uintptr_t base_address = GetModuleBaseAddress(pid, "GTA5.exe"); 103 | 104 | char ticket[208]{}; 105 | ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380), &ticket, 208, 0); 106 | 107 | char session_ticket[88]{}; 108 | ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380 + 0x200), &session_ticket, 88, 0); 109 | 110 | unsigned char session_key[16]{}; 111 | ReadProcessMemory(phandle, (void*)(base_address + 0x2E7E380 + 0x608), &session_key, 16, 0); 112 | 113 | TICKET = ticket; 114 | SESSION_TICKET = string(session_ticket, 88); 115 | SESSION_KEY = Botan::base64_encode(reinterpret_cast(session_key), sizeof(session_key)); 116 | } 117 | else 118 | { 119 | cout << "GTA5.exe was not found... trying to use cached session."; 120 | } 121 | #endif 122 | 123 | cout << "Help:" << endl; 124 | for (auto& it : g_commands) { 125 | cout << it.second->get_category() << " - " << it.second->get_name() << endl; 126 | } 127 | 128 | if (!TICKET.empty()) 129 | { 130 | cout << "Ticket " << TICKET << endl; 131 | cout << "Session Ticket " << SESSION_TICKET << endl; 132 | cout << "Session Key " << SESSION_KEY << endl; 133 | } 134 | else { 135 | cout << "Do you want to proceed without session credentials? (y/n)" << endl; 136 | cout << "If so you are not able to use most of the prod.ros endpoints" << endl; 137 | 138 | string skipSessionCredentials; 139 | cin >> skipSessionCredentials; 140 | 141 | if (skipSessionCredentials != "y") 142 | { 143 | string _temp = command::get(hash()("createticket"))->execute({}); 144 | 145 | if (TICKET.length() > 20) 146 | { 147 | cout << "Ticket " << TICKET << endl; 148 | cout << "Session Ticket " << SESSION_TICKET << endl; 149 | cout << "Session Key " << SESSION_KEY << endl; 150 | } 151 | } 152 | } 153 | 154 | cout << "Enter the endpoint:" << endl; 155 | cin >> ws >> endpoint; 156 | 157 | while (true) 158 | { 159 | transform(endpoint.begin(), endpoint.end(), endpoint.begin(), ::tolower); 160 | static command* command = command::get(hash()(endpoint)); 161 | 162 | if (command) { 163 | string response = command->execute({ }); 164 | if (command->get_service_type() == SERVICE_TYPE::PROD_SCAPI_AMC && response.starts_with("{") && response.ends_with("}")) 165 | { 166 | response = nlohmann::json::parse(response).dump(4); 167 | } 168 | 169 | cout << response << endl; 170 | } 171 | cout << "Enter the endpoint:" << endl; 172 | cin >> ws >> endpoint; 173 | command = command::get(hash()(endpoint)); 174 | } 175 | } -------------------------------------------------------------------------------- /src/ros_crypt.cpp: -------------------------------------------------------------------------------- 1 | #include "ros_crypt.hpp" 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | ROSCryptoState::ROSCryptoState(const string& platformKey) 9 | { 10 | Botan::secure_vector platformStr = Botan::base64_decode(platformKey); 11 | 12 | memcpy(m_rc4Key, &platformStr[1], sizeof(m_rc4Key)); 13 | memcpy(m_xorKey, &platformStr[33], sizeof(m_xorKey)); 14 | memcpy(m_hashKey, &platformStr[49], sizeof(m_hashKey)); 15 | 16 | m_rc4 = Botan::StreamCipher::create("RC4")->clone(); 17 | m_rc4->set_key(m_rc4Key, sizeof(m_rc4Key)); 18 | m_rc4->cipher1(m_xorKey, sizeof(m_xorKey)); 19 | m_rc4->set_key(m_rc4Key, sizeof(m_rc4Key)); 20 | m_rc4->cipher1(m_hashKey, sizeof(m_hashKey)); 21 | 22 | delete m_rc4; 23 | } 24 | 25 | ROSCryptoState::~ROSCryptoState() 26 | { 27 | delete m_rc4; 28 | } 29 | 30 | const uint8_t* ROSCryptoState::GetXorKey() const 31 | { 32 | return m_xorKey; 33 | } 34 | 35 | const uint8_t* ROSCryptoState::GetHashKey() const 36 | { 37 | return m_hashKey; 38 | } 39 | 40 | string ROSCrypt::DecryptROSData(const char* data, size_t size, const string& sessionKey) 41 | { 42 | auto cryptoState = m_cryptoState.get(); 43 | 44 | uint8_t rc4Key[16]; 45 | 46 | bool hasSecurity = (!sessionKey.empty()); 47 | 48 | uint8_t sessKey[16]; 49 | 50 | if (hasSecurity) 51 | { 52 | auto keyData = Botan::base64_decode(sessionKey.data()); 53 | memcpy(sessKey, keyData.data(), sizeof(sessKey)); 54 | } 55 | 56 | for (int i = 0; i < sizeof(rc4Key); i++) 57 | { 58 | rc4Key[i] = data[i] ^ cryptoState->GetXorKey()[i]; 59 | 60 | if (hasSecurity) 61 | { 62 | rc4Key[i] ^= sessKey[i]; 63 | } 64 | } 65 | 66 | Botan::StreamCipher* rc4 = Botan::StreamCipher::create("RC4")->clone(); 67 | rc4->set_key(rc4Key, sizeof(rc4Key)); 68 | 69 | uint8_t blockSizeData[4]; 70 | uint8_t blockSizeDataLE[4]; 71 | rc4->cipher(reinterpret_cast(&data[16]), blockSizeData, 4); 72 | 73 | blockSizeDataLE[3] = blockSizeData[0]; 74 | blockSizeDataLE[2] = blockSizeData[1]; 75 | blockSizeDataLE[1] = blockSizeData[2]; 76 | blockSizeDataLE[0] = blockSizeData[3]; 77 | 78 | uint32_t blockSize = (*(uint32_t*)&blockSizeDataLE) + 20; 79 | 80 | vector blockData(blockSize); 81 | 82 | stringstream result; 83 | 84 | size_t start = 20; 85 | 86 | while (start < size) 87 | { 88 | int end = min(size, start + blockSize); 89 | 90 | end -= 20; 91 | 92 | int thisLen = end - start; 93 | 94 | if (thisLen < 0) 95 | { 96 | return string{data, size}; 97 | } 98 | 99 | rc4->cipher(reinterpret_cast(&data[start]), &blockData[0], thisLen); 100 | 101 | result << string(reinterpret_cast(&blockData[0]), thisLen); 102 | 103 | start += blockSize; 104 | } 105 | 106 | delete rc4; 107 | 108 | return result.str(); 109 | } 110 | 111 | string ROSCrypt::EncryptROSData(const string& input, const string& sessionKey) 112 | { 113 | auto state = m_cryptoState.get(); 114 | stringstream output; 115 | 116 | bool hasSecurity = (!sessionKey.empty()); 117 | 118 | uint8_t sessKey[16]; 119 | 120 | if (hasSecurity) 121 | { 122 | auto keyData = Botan::base64_decode(sessionKey); 123 | memcpy(sessKey, keyData.data(), sizeof(sessKey)); 124 | } 125 | 126 | uint8_t rc4Key[16]; 127 | 128 | Botan::AutoSeeded_RNG rng; 129 | rng.randomize(rc4Key, sizeof(rc4Key)); 130 | 131 | for (int i = 0; i < sizeof(rc4Key); i++) 132 | { 133 | char thisChar = rc4Key[i] ^ state->GetXorKey()[i]; 134 | 135 | output << string(&thisChar, 1); 136 | 137 | if (hasSecurity) 138 | { 139 | rc4Key[i] ^= sessKey[i]; 140 | } 141 | } 142 | 143 | Botan::StreamCipher* rc4 = Botan::StreamCipher::create("RC4")->clone(); 144 | rc4->set_key(rc4Key, sizeof(rc4Key)); 145 | 146 | vector inData(input.size()); 147 | memcpy(&inData[0], input.c_str(), inData.size()); 148 | 149 | rc4->encipher(inData); 150 | 151 | output << string(reinterpret_cast(&inData[0]), inData.size()); 152 | 153 | string tempContent = output.str(); 154 | 155 | Botan::Buffered_Computation* sha1; 156 | 157 | if (!hasSecurity) 158 | { 159 | sha1 = Botan::HashFunction::create("SHA1")->clone(); 160 | } 161 | else 162 | { 163 | auto hmac = Botan::MessageAuthenticationCode::create("HMAC(SHA1)")->clone(); 164 | hmac->set_key(rc4Key, sizeof(rc4Key)); 165 | 166 | sha1 = hmac; 167 | } 168 | 169 | sha1->update(reinterpret_cast(tempContent.c_str()), tempContent.size()); 170 | sha1->update(state->GetHashKey(), 16); 171 | 172 | auto hashData = sha1->final(); 173 | 174 | delete rc4; 175 | delete sha1; 176 | 177 | return tempContent + string(reinterpret_cast(&hashData[0]), hashData.size()); 178 | } 179 | 180 | string ROSCrypt::url_encode(const string& value) 181 | { 182 | ostringstream escaped; 183 | escaped.fill('0'); 184 | escaped << hex; 185 | 186 | for (string::const_iterator i = value.begin(), n = value.end(); i != n; ++i) 187 | { 188 | string::value_type c = (*i); 189 | if (((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '_' || c == '.' || c == '~') && c != '+') 190 | { 191 | escaped << c; 192 | } 193 | else if (c == ' ') 194 | { 195 | escaped << '+'; 196 | } 197 | else 198 | { 199 | escaped << '%' << setw(2) << ((int)(uint8_t)c) << setw(0); 200 | } 201 | } 202 | 203 | return string(escaped.str().c_str()); 204 | } 205 | 206 | string ROSCrypt::ex_url_encode(const string& value) 207 | { 208 | std::ostringstream escaped; 209 | escaped.fill('0'); 210 | escaped << std::hex; 211 | 212 | for (char c : value) { 213 | if (static_cast(c) <= 127) { 214 | // Encode non-alphanumeric characters except '-' and '_' 215 | if (std::isalnum(c) || c == '-' || c == '_') { 216 | escaped << c; 217 | } 218 | else { 219 | escaped << '%' << std::setw(2) << int(static_cast(c)); 220 | } 221 | } 222 | else { 223 | // Handle non-ASCII characters properly by encoding as UTF-8 224 | std::stringstream utf8Encoded; 225 | utf8Encoded << std::hex << std::setw(2) << std::setfill('0') << static_cast(static_cast(c)); 226 | for (size_t i = 0; i < utf8Encoded.str().size(); ++i) { 227 | escaped << '%' << utf8Encoded.str()[i]; 228 | } 229 | } 230 | } 231 | 232 | return escaped.str(); 233 | } 234 | 235 | string ROSCrypt::BuildPostString(const map& fields) 236 | { 237 | stringstream retval; 238 | 239 | for (auto& field : fields) 240 | { 241 | retval << field.first << "=" << url_encode(field.second) << "&"; 242 | } 243 | 244 | string str = string(retval.str().c_str()); 245 | return str.substr(0, str.length() - 1); 246 | } 247 | 248 | string ROSCrypt::GetROSVersionString() 249 | { 250 | string baseString; 251 | if (m_launcher) 252 | baseString = "e=1,t=launcher,p=pcros,v=11"; 253 | else 254 | baseString = "e=1,t=gta5,p=pcros,v=11"; 255 | 256 | vector xorBuffer(baseString.length() + 4); 257 | 258 | if (m_launcher) 259 | { 260 | *(uint32_t*)&xorBuffer[0] = 0xC5C5C5C5; 261 | 262 | for (int i = 4; i < xorBuffer.size(); i++) 263 | { 264 | xorBuffer[i] = baseString[i - 4] ^ 0xC5; 265 | } 266 | } 267 | else 268 | { 269 | *(uint32_t*)&xorBuffer[0] = 0xCDCDCDCD; 270 | 271 | for (int i = 4; i < xorBuffer.size(); i++) 272 | { 273 | xorBuffer[i] = baseString[i - 4] ^ 0xCD; 274 | } 275 | } 276 | 277 | string base64str = Botan::base64_encode(reinterpret_cast(&xorBuffer[0]), xorBuffer.size()); 278 | 279 | return format("ros {}", base64str); 280 | } 281 | -------------------------------------------------------------------------------- /src/ros_crypt.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "botan_all.h" 10 | 11 | using namespace std; 12 | 13 | class ROSCryptoState 14 | { 15 | private: 16 | Botan::StreamCipher* m_rc4; 17 | uint8_t m_rc4Key[32]; 18 | uint8_t m_xorKey[16]; 19 | uint8_t m_hashKey[16]; 20 | 21 | public: 22 | ROSCryptoState(const string& platformKey); 23 | ~ROSCryptoState(); 24 | 25 | const uint8_t* GetXorKey() const; 26 | const uint8_t* GetHashKey() const; 27 | }; 28 | 29 | class ROSCrypt 30 | { 31 | public: 32 | constexpr ROSCrypt(const bool launcher) : m_launcher(launcher) 33 | { 34 | constexpr const char* launcherPlatformKey = "C6fU6TQTPgUVmy3KIB5g8ElA7DrenVpGogSZjsh+lqJaQHqv4Azoctd/v4trfX6cBjbEitUKBG/hRINF4AhQqcg="; 35 | constexpr const char* platformKey = "C4pWJwWIKGUxcHd69eGl2AOwH2zrmzZAoQeHfQFcMelybd32QFw9s10px6k0o75XZeB5YsI9Q9TdeuRgdbvKsxc="; 36 | 37 | m_cryptoState = make_unique(launcher ? launcherPlatformKey : platformKey); 38 | } 39 | 40 | string EncryptROSData(const string& input, const string& sessionKey = ""); 41 | string DecryptROSData(const char* data, size_t size, const string& sessionKey); 42 | 43 | string url_encode(const string& value); 44 | string ex_url_encode(const string& value); 45 | 46 | string BuildPostString(const map& fields); 47 | 48 | string GetROSVersionString(); 49 | 50 | template 51 | auto HeadersHmac(const vector& challenge, const char* method, const string& path, const string& sessionKey, const string& sessionTicket); 52 | 53 | private: 54 | unique_ptr m_cryptoState; 55 | bool m_launcher; 56 | }; 57 | 58 | // TODO compiler error when in .cpp? 59 | template 60 | inline auto ROSCrypt::HeadersHmac(const vector& challenge, const char* method, const string& path, const string& sessionKey, const string& sessionTicket) 61 | { 62 | auto hmac = unique_ptr(Botan::MessageAuthenticationCode::create("HMAC(SHA1)")->clone()); 63 | 64 | auto cryptoState = m_cryptoState.get(); 65 | 66 | // set the key 67 | uint8_t hmacKey[16]; 68 | 69 | // xor the RC4 key with the platform key (and optionally the session key) 70 | auto rc4Xor = Botan::base64_decode(sessionKey); 71 | 72 | for (int i = 0; i < sizeof(hmacKey); i++) 73 | { 74 | hmacKey[i] = rc4Xor[i] ^ cryptoState->GetXorKey()[i]; 75 | } 76 | 77 | hmac->set_key(hmacKey, sizeof(hmacKey)); 78 | 79 | // method 80 | hmac->update(method); 81 | hmac->update(0); 82 | 83 | // path 84 | hmac->update(path); 85 | hmac->update(0); 86 | 87 | // ros-SecurityFlags 88 | hmac->update("239"); 89 | hmac->update(0); 90 | 91 | // ros-SessionTicket 92 | hmac->update(sessionTicket); 93 | hmac->update(0); 94 | 95 | // ros-Challenge 96 | hmac->update(Botan::base64_encode(challenge)); 97 | hmac->update(0); 98 | 99 | // platform hash key 100 | hmac->update(cryptoState->GetHashKey(), 16); 101 | 102 | // set the request header 103 | auto hmacValue = hmac->final(); 104 | 105 | return hmacValue; 106 | } 107 | --------------------------------------------------------------------------------