Commit Graph

631 Commits

Author SHA1 Message Date
Sude
01eed3ec9e Add language: Arabic, Romanian 2019-02-17 01:19:37 +02:00
Sude
178ca66997 Merge branch 'fix_rhash_memory_corruption' of https://github.com/nathanel23/lgogdownloader 2019-01-06 14:06:31 +02:00
nathanel23
f65599e216 Fix for memory corruption/crash related to rhash
This patch fixes issues with some calls to the rhash C library that
cause subtle memory corruptions. There are two main issues that this
patch addresses:

1) The library init function is called multiple times in various places
within in the Util class. This is not necessary and may cause issues
if the initialization is repeated simultaneously in multiple threads.
Therefore the call was moved to the beginning of the main() function.

2) There is not enough space in the output buffers to store the
terminating NUL character of the hex-formatted hashes. The print
function from the rhash library writes a regular C string to
the output buffer and expects enough space to include the end
marker.

Depending on the memory layout generated by the compiler, this results
in one byte of the stack to be overwritten, which might lead to random
issues that are hard to find. On AArch64 (ARM) with GCC 6.3 the call to
the rhash_print() function happens to destroy the lower byte of the
frame pointer and causes a crash due to an invalid free() operation some
time after the Util::createXML function returned.
2019-01-06 01:06:23 +01:00
Sude
9bd416e3b0 Add support for retry and wait to Galaxy API and downloader API 2018-12-22 11:35:17 +02:00
Sude
df628b2a59 Add option to include hidden products
Adds option --include-hidden-products that allows user to list and download products that have been set hidden in account page.
2018-12-20 13:10:27 +02:00
Sude
f4c8db78ae CMake: Fix compiling when path contains spaces 2018-12-20 11:12:58 +02:00
Sude
f559c6c014 Fix unclosed file handle in Util::createXML
File handle for input file was not closed in case of errors.
Added fclose() to all error cases.
2018-12-20 11:10:42 +02:00
Sude
8683fe0a4e Galaxy: Fix segfault when getting download url fails 2018-09-30 20:05:06 +03:00
Sude
f5afc8957d Version 3.4 2018-09-15 15:22:19 +03:00
Sude
ab84d6f827 Galaxy: Add option to set CDN priority
--galaxy-cdn-priority option allows to set priorities for content delivery networks
2018-09-12 20:07:59 +03:00
Sude
8e55b81ca1 Galaxy: Extend subdir option to work with MojoSetup hack
Extends subdir option introduced in 1b3b04b28c to work with Downloader::galaxyInstallGame_MojoSetupHack
2018-09-12 16:02:34 +03:00
Sude
1b3b04b28c Galaxy: Add option to set subdirectory for installation
New option --subdir-galaxy-install allows user to set installation subdirectory when using --galaxy-install
2018-09-12 15:18:54 +03:00
Sude
6f44277d4c Galaxy: Small optimization to galaxyAPI::getFilteredDepotItemsVectorFromJson
Check if product id exists once instead of checking it again for each item
2018-09-05 18:21:35 +03:00
Sude
05e9409d52 Add separate option to set libcurl to verbose mode
New --curl-verbose option is used to set libcurl to verbose mode.
Old --verbose option is still used to print more information but no longer sets libcurl to verbose mode.
2018-09-05 17:51:03 +03:00
Sude
35b178e674 Galaxy: Add support for downloading dependencies
Adds support for downloading dependencies for a game
Added --galaxy-no-dependencies option to disable downloading dependencies during --galaxy-install
2018-09-05 17:41:43 +03:00
Sude
cae5f80698 Allow saving empty option values to config
Fixes issues caused by boost program options overriding desired value with default value because it wasn't found in config file.

For example using --subdir-extras "" --save-config would erase subdir-extras from config file.
Trying to download something would then cause the downloader to use default value for subdir-extras because it wasn't found in config.
2018-08-23 21:30:24 +03:00
Sude
9804215de8 Add missing include 2018-08-01 11:40:58 +03:00
Sude
8e9c094929 Replace --update-check option and remove --game aliases
Replace --update-check option with --updated and --notifications options
--updated restricts downloader to operate only on games that have update flag set in account page
--notifications shows the number of new forum replies, updates games, unread chat messages and pending friend requests
--clear-update-flags clears update notification flags for all games

Remove aliases for --game option
"free" could no longer be used as originally intended and "all" was unnecessary because leaving regex empty has the same effect
2018-07-21 23:59:08 +03:00
Sude
9dc5d4124c Add OS and arch to default user agent 2018-07-01 22:51:32 +03:00
Sude
3b733fcb4b Galaxy: Set timestamp for downloaded file 2018-05-29 11:23:51 +03:00
Sude
dd5714690c Galaxy: Use regex for language detection in --galaxy-install
Some builds use different language codes.
It looks like all of them are in format Language-Country/Region.
Added these new codes to regex in GlobalConstants::LANGUAGES.
Use regular expression to detect the language instead of language code.
2018-05-29 09:56:38 +03:00
Sude
463a9c386e Galaxy: Add hack for installing Linux games
Try to use Linux installers as replacement for Galaxy repository.
Linux installers use MojoSetup which means that the installers are Zip files that have bash script and installer binary prepended.
We can get zip file entries from zip central directory and then split the game installer to chunks based on those file entries.
Therefore we can download individual files from the installer.
2018-05-29 08:56:29 +03:00
Sude
7373d357aa Fix -Wcatch-value for GCC 8 2018-05-14 12:29:51 +03:00
Sude
8ca7722853 Skip complete files instead of trying to resume 2018-05-14 12:22:05 +03:00
Sude
04370b8b53 Better help text for galaxy-install and galaxy-show-builds 2018-05-14 11:38:56 +03:00
Sude
c6e5214910 Remove numeric option values from help text 2018-05-14 11:25:52 +03:00
Sude
ef1a344610 Remove cover download support 2018-05-14 11:12:10 +03:00
Sude
d0177031e6 Use std::string instead of JSONCPP_STRING 2018-02-15 19:42:10 +02:00
Sude
553c6dce1c Galaxy: Add support for generation 1 builds to --galaxy-show-builds 2018-02-12 19:03:56 +02:00
Sude
40cbb5fccb Galaxy: Show generation in --galaxy-show-builds output 2018-02-12 18:51:05 +02:00
Sude
e9ac6d072f Galaxy: Make --galaxy-install multithreaded 2018-02-12 18:46:17 +02:00
Sude
b384dfd0c1 Remove unused variable 2018-01-11 10:00:11 +02:00
Sude
b90b7288d4 Merge https://github.com/haphi/lgogdownloader 2018-01-11 09:58:39 +02:00
Hans Philipp Annen
5bf6a9ed97 Remove usage of obsolete Json::StyledStreamWriter class. 2017-12-20 18:17:36 +01:00
Hans Philipp Annen
76d8548fc9 Remove usage of obolete Json::Reader class. 2017-12-20 18:12:59 +01:00
Sude
90dcaf0106 Add options to set low speed timeout values for libcurl 2017-11-08 15:20:03 +02:00
Sude
8cb0b99008 Version 3.3 2017-11-03 16:23:17 +02:00
Sude
8191b9d0a3 Galaxy: Workaround for file name issue 2017-10-18 13:19:25 +03:00
Sude
3f8a8d6b68 Galaxy: Remove duplicate code
Removed duplicate code by unifying various *JsonNodeToGameFileVector functions
2017-10-18 13:13:35 +03:00
Sude
257946dbc1 Workaround for crash with older version of jsoncpp 2017-10-12 00:29:04 +03:00
Sude
b0a90f6c60 Galaxy: Use en-US locale for product info 2017-10-12 00:23:15 +03:00
Sude
eee162177f Galaxy: Fix getting file name (again)
GOG changed the url formatting in "downlink" json response again.
Check which format is in use and select proper method for the format.
2017-10-10 16:53:07 +03:00
Sude
79aa66a2d3 Galaxy: Fix getting file name
GOG changed part of the API which caused lgogdownloader to not get valid file name.
Change galaxyAPI::installerJsonNodeToGameFileVector and galaxyAPI::extraJsonNodeToGameFileVector to get proper file name.
2017-10-10 10:12:18 +03:00
Sude
6c2a3b4392 Save Galaxy tokens in destructor 2017-09-20 07:01:43 +03:00
Sude
257b6b0137 Update login check 2017-09-20 06:59:43 +03:00
Sude
edc6486637 Update login function
Downloader::login will fail if Galaxy API login is not successful.
Exporting cookies no longer works because Galaxy API login is tied to website login.
2017-09-20 06:08:45 +03:00
Sude
2d70bdfacb Galaxy: Add DLC info to game details only if DLC has any files 2017-09-15 13:06:02 +03:00
Sude
fd27b93486 Check and refresh Galaxy login before using Galaxy API handle 2017-09-15 03:11:03 +03:00
Sude
c9b6ea4a52 Galaxy: Add some checks to GalaxyConfig class
Check that json contains the node before trying to get value
2017-09-15 02:17:44 +03:00
Sude
706158d595 Get game details using Galaxy API
Game details are now acquired using Galaxy API.
Allow using most features without valid downloader API login by changing Downloader::isLoggedIn to return false only if website is not logged in.
--download-file still uses old API and will not work without valid API login. Downloader::downloadFileWithId prints error message and exits if user doesn't have valid API login.
Game details cache version is incremented because of changes to gameFile class.
Show product id for DLCs when using --list-details option.
Rewrote Downloader::repair to remove duplicated code.
Fixed serials containing <br> tags.
2017-09-13 16:46:46 +03:00