Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/thpatch/thcrap

Touhou Community Reliant Automatic Patcher
https://github.com/thpatch/thcrap

textdisp_CreateFontA(): Only override iCharSet if a face name is given.

e63c33de2c706fdab623bceabcfb5fd28a0be116 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add InsertMenuItem().

7f206f916605f5da9d80060ab27ef15c5c5c05cf authored over 10 years ago by nmlgc <[email protected]>
win32_utf8(): Add WideCharToMultiByte().

df6e55c7443f71b8fde04d2fe110e9d49d80ba8d authored over 10 years ago by nmlgc <[email protected]>
Split off StringToUTF16()'s conversion into a MultiByteToWideChar() detour.

2d00d598531fb77beac7d0bca04e7f3eb0050a6b authored over 10 years ago by nmlgc <[email protected]>
detour_next(): Add error reporting.

2c93b6adaba2b44ea94feb2fa7f8d8deaa0dfd4d authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add LoadString().

fe31606327f2866cd8f2a0e710bbaeb308d030db authored over 10 years ago by nmlgc <[email protected]>
Move the dialog helper functions to a public utility file.

... which once used to be exclusively used for string helper functions.

bc7148524dd31f28777deedde94b93427b7fddd9 authored over 10 years ago by nmlgc <[email protected]>
json_object_get_create(): Create the new object inside the function.

Much nicer than to have the caller allocate it and then delete it if it's not needed.

43c810bf0705e57f88f1d7d5741031dedfd01510 authored over 10 years ago by nmlgc <[email protected]>
Use detour_next() to call the original functions inside detours.

c24a3d6f6dc8affa5f3263bfd49183ba9ccaabcd authored over 10 years ago by nmlgc <[email protected]>
thcrap_loader: Hardcode the detour setup necessary for injection.

c313805a2b6ef093b1935fdcbde5515dc5d5cce2 authored over 10 years ago by nmlgc <[email protected]>
Use the module system for the _detour() functions.

6e813547dd566c7a9fcb5984e1d19e83b54fd6ba authored over 10 years ago by nmlgc <[email protected]>
Implement detour chaining.

Forwards compatible detours! If only thvorbis had thought that far...

d52176df83a37c50f6630119616389740b927a7c authored over 10 years ago by nmlgc <[email protected]>
Build a cache of function detours instead of applying them directly.

Doesn't change anything yet, but prepares the ground for detour chaining.

(Note that calls to i...

89804b795d790582d02005cacac1914e6fe7d22e authored over 10 years ago by nmlgc <[email protected]>
win32_detour(): Add detours for CreateProcess() and LoadLibrary().

Will be necessary for the upcoming detour chaining system.

3e315134cbbb4e5780597f7e6e572b34225d02ae authored over 10 years ago by nmlgc <[email protected]>
Introduce a system for automatic initialization and cleanup of modules.

Such a list of all function pointers across all loaded DLLs can be used for a lot more than what...

5b30fe377e287cd7a2e6c3b75a0c335c1d0e9ed9 authored over 10 years ago by nmlgc <[email protected]>
Detour ExitProcess() to properly shut down any thcrap worker threads.

If the target process terminates using ExitProcess(), any active threads will have most likely a...

88c4bca43a3be041fd691b0befb8a298b24a77d1 authored over 10 years ago by nmlgc <[email protected]>
Add some missing resets for global variables on exiting.

199cc3978c8a34944a29fc7cd0b2acc88aeb2033 authored over 10 years ago by nmlgc <[email protected]>
scripts: Allow to override the JSON loading and dumping parameters.

d0919465239399f1ab6d65bbd8c42b1b9657ddb6 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add GetFileAttributes() and GetFileAttributesEx().

86dca738da3e8c9f93143b8e4d9d118328148c53 authored over 10 years ago by nmlgc <[email protected]>
scripts: Move patch_files_filter() to utils.py.

63d39ea7f7e9428a4efbceab136c19710bc171e8 authored over 10 years ago by nmlgc <[email protected]>
file_read(): Don't set the FILE_SHARE_WRITE flag.

Well, if Windows gives us a way to avoid race conditions, we should make use of it, especially s...

dd2a1998a580234c7a79ea6bdc1826074680c498 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Correctly sort GetPrivateProfileIntU().

aec59243a643401e2c2cb623859afe84925d533b authored over 10 years ago by nmlgc <[email protected]>
Optionally check a binary hack against an expected sequence of bytes.

This can be used to selectively disable certain binary hacks if they would crash a particular va...

1377d719ad800b5e2a04d542b2e4d3be03b32511 authored over 10 years ago by nmlgc <[email protected]>
Rename the *_init_plugin() functions to *_plugin_init().

More consistent with the general function naming.

182ea705a5239ff96cc17937ef1bf8e8f8dddde4 authored over 10 years ago by nmlgc <[email protected]>
binhacks_apply(): Eliminate potential VLA memory leaks.

5558f7eacdf3e7b0aeb5dd118d873582ab8492a4 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add a wrapper for GetCurrentDirectory()-like functions.

ce32307452e87f474dc1bb2e9526c9c3e3fb300c authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add GetTempPath().

eb16651faaecefd4b004fd258ef268da75d8c71b authored over 10 years ago by nmlgc <[email protected]>
TSA layout parser: Parse font-related commands before anything else.

This is to guarantee that any calls to GetTextExtent() return the correct widths.

Also, moving ...

bc6cde0b67c3bb622a87c74f56774af659fd84af authored over 10 years ago by nmlgc <[email protected]>
TSA layout parser: Don't overwrite the current width when defining a tabstop.

This enables us to define a tabstop while simultaneously centering or right-aligning the text in...

88fa8be1e7cca4fdc568fd58006505faf379af36 authored over 10 years ago by nmlgc <[email protected]>
TSA layout parser: Remove a superfluous conditional branch.

5b2c9ab8a387c3eb4d6e1041c0c2eebbb11a47c1 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add a wrapper for functions taking only one string parameter.

I've been thinking for a long time about how to reduce the redundancy in all these wrappers, and...

0bcc40f85454b16460013ddc1f3260802d4cdd73 authored over 10 years ago by nmlgc <[email protected]>
scripts: Use the OrderedDict class for JSON objects.

c11fd9f792afb71e01224f149121bc13a6a9bed8 authored over 10 years ago by nmlgc <[email protected]>
BP_ruby_offset(): Don't enforce the validity of the font pointers.

Since SelectObject() doesn't crash when handing it a null pointer, we don't necessarily have to ...

6d0a2a582691230bc6e3809e640b3c72119dacbd authored over 10 years ago by nmlgc <[email protected]>
BP_ruby_offset(): Fix a crash if "font_dialog" or "font_ruby" are not given.

I must have been terribly asleep when I wrote this. :(

c56c2d65363c223fb9a33a97314d6bb51d9928e3 authored over 10 years ago by nmlgc <[email protected]>
Check for a valid file name pointer when dumping a data file.

Old code, and it turns out that this would indeed cause crashes if BP_file_loaded() was called a...

8ec5006c0f31b32e73e8c004ac18a04aec62d58e authored over 10 years ago by nmlgc <[email protected]>
Add statements for Python and Linux to .gitignore.

54d21cc649b25b5617bb32591516283ca6a0a7d6 authored over 10 years ago by nmlgc <[email protected]>
scripts: Move JSON dump parameters to a global dictionary.

0e07e0127e359cbf6c97d6f470fb51d15d7544bc authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add MoveFile(), MoveFileEx() and MoveFileWithProgress().

aab31b957ae16f52720098a5530be81d5f239b22 authored over 10 years ago by nmlgc <[email protected]>
scripts: Move JSON wrappers into a new utility module.

3abbd567de7d44ded8cc9d1dbf279d77a8f15fb2 authored over 10 years ago by nmlgc <[email protected]>
repo_update.py: Explicitly set UTF-8 encoding for text I/O.

d8e047a75c9c8307403551d02a51b357d6c9b10e authored over 10 years ago by nmlgc <[email protected]>
repo_update.py: Refactor JSON loading into its own helper function.

2a2c14aed6f85817ac7cd84a450298cb4b075160 authored over 10 years ago by nmlgc <[email protected]>
Remove the <f$> ruby layout parser introduced in 2013-08-20.

Well yeah, it *did* work everywhere, but the results were not exactly pretty, and barely legible...

bd25a1be8b4310886d375ce9e99df7e214b237e7 authored over 10 years ago by nmlgc <[email protected]>
PatchRegion(): Make [prev] optional, remove the *NoCheck() function.

012d01f48c14844fb5713b8571e5c570e8e707dd authored over 10 years ago by nmlgc <[email protected]>
func_detour(): Remove duplicated code.

01b2d4d1d3c30881e173add75bf5ef4bc5121356 authored over 10 years ago by nmlgc <[email protected]>
Remove the typed memory patching functions.

They have never been used, will probably never be used (we have binary hacks, you know), and wit...

dd9dd6cef9c7602323a72228ec90ad09d8209da6 authored over 10 years ago by nmlgc <[email protected]>
thcrap_update: Link to the default zlib1.dll instead of zlibwapi.dll.

We've been using a __stdcall build of that library all the time anyway, and it turned out that w...

2f1ee51aba3215438a97925a40dc28ddcd167653 authored over 10 years ago by nmlgc <[email protected]>
Move thcrap updating information from patch.js to the run configuration.

In a time without both global.js and the slightest idea of how popular the engine (not the patch...

05c22dadd2b112a066c7c0d9231bc93facf0217c authored over 10 years ago by nmlgc <[email protected]>
repo_update.py: Dump JSON with Git-compatible whitespace.

8e0e5a9f859dee593e964f6b98d04e3852ef163f authored over 10 years ago by nmlgc <[email protected]>
Add a bidirectional stack+chain iterator.

This removes the final instance of code duplication between stack resolvers!

7d0beb05d3231ef60eefca4cda5bdcd7573a6a6b authored over 10 years ago by nmlgc <[email protected]>
Use a custom resolving chain for global.js and the game's main JSON files.

Previously, game-specific settings from patches at a lower position in the stack would overwrite...

1d816c149d17b67f5b15c790e6e2dd8a4c492304 authored over 10 years ago by nmlgc <[email protected]>
Add a function to create a resolving chain based on a game-local file name.

91a63f19d7d736ab66da629d2c3a801685d8d692 authored over 10 years ago by nmlgc <[email protected]>
Introduce a system to allow customization of files loaded during resolving.

Previously, the sequence of generic and build-specific files had to be hardcoded into every sing...

6f949fd6be250e25ebc1d2a5e8792c72e7d3018b authored over 10 years ago by nmlgc <[email protected]>
Cleanup: Const-correctness

7648d9f904336ae7fd8741c954a2ed7744e5f0af authored over 10 years ago by nmlgc <[email protected]>
Cleanup: Random fixes

cefb7149f9308be83f5eaacb15baa87aa2ae9f7b authored over 10 years ago by nmlgc <[email protected]>
Cleanup: Fix some comments.

747175eda2a730c62e1c74c1ad4d840e66e953eb authored over 10 years ago by nmlgc <[email protected]>
Remove superfluous CRT debug calls in thcrap's DLL initialization.

Memory leaks are dumped to the on-screen console just fine without them.

813417f20a937e19ffeccdd8f81b056910574303 authored over 10 years ago by nmlgc <[email protected]>
MSG patching: Increment the line counter correctly to repair hard line patching.

What the hell?!? Dialog patching in th06, th07 and parts of th08 was completely broken as a resu...

44831376f08eb4cb9f96bc3dc88b27e711912a49 authored over 10 years ago by nmlgc <[email protected]>
Use the flexible array loop for dependencies.

Should have done this before changing the CSV parser on the server!

a659bdb79624b06959c3159159c2139aad47422a authored over 10 years ago by nmlgc <[email protected]>
Rename stack_json_load() to the new, public patch_json_merge().

113c7019ea6e5d82d2da749efe4372bb2f635b3c authored over 10 years ago by nmlgc <[email protected]>
Bump version number to 2014-01-27.

136f9136704323c2f154a19e3f5a21c18965cce0 authored over 10 years ago by nmlgc <[email protected]>
Fix a reference counting issue that broke update notifications in 2014-01-03.

Luckily, this is thcrap and there is still the possibility for nifty workarounds to deal with th...

6c022374cbdad132f62ac6a89585bc8297aa9c05 authored over 10 years ago by nmlgc <[email protected]>
Bump version number to 2014-01-26.

61fd5d386dd1e0bdc2ef2575bf2ec3ba620e46d6 authored over 10 years ago by nmlgc <[email protected]>
thcrap_configure: Display a repository's contact e-mail address.

66adc21324ccbbdb41566f91e96be03ffbba98eb authored over 10 years ago by nmlgc <[email protected]>
Add a script to build and update a patch repository.

4e9bf7e6ec5c3ca101b4247777a67a8be65407d4 authored over 10 years ago by nmlgc <[email protected]>
BP_ruby_offset(): Set the game's string pointer to the second last comma.

If any of the first two string parameters include one, the game would otherwise get the wrong st...

6f129554ad3bdb0a6fd286dc4805357daa40b3ba authored over 10 years ago by nmlgc <[email protected]>
thcrap_detour(): Show the name of the module the detours are applied to.

e68f3bbcf454cbdd13f0a67f45cd7ace92e41b28 authored over 10 years ago by nmlgc <[email protected]>
win32_utf8: Add IsDBCSLeadByteFB().

Required for Danmakufu. And yes, it works, even through UPX. I can't believe it either.

593e62f17b9a279ac8978daae5e717f63d2e7938 authored over 10 years ago by nmlgc <[email protected]>
Use the iat_detour_t structure for the low-level IAT detour functions.

3dda94516f99370b8b876b41a742bfab469a8b1a authored over 10 years ago by nmlgc <[email protected]>
Fall back to IAT detouring by pointer if OriginalFirstThunk is not available.

Fixes a crash that previously occurred in this case. This is particularly likely to happen with ...

f67f39108db2eefcaa3eeb03f4cca6ee67cf77b5 authored over 10 years ago by nmlgc <[email protected]>
Add a breakpoint to calculate the X offset for variable-width Ruby annotations.

Third attempt at patching ruby annotations. At a cost of requiring 6 values per game, we finally...

52fcf754bd241ee9173feb11a75adf9f02aaaf63 authored over 10 years ago by nmlgc <[email protected]>
Introduce a global run configuration file at the bottom of the hierarchy.

This can be used to define general run configuration elements shared by all games.

a46e85d75c02dea9447cac7d0942a73c1c1e41b1 authored over 10 years ago by nmlgc <[email protected]>
runconfig_set(): Decrease the reference count of the old run configuration.

cba2f87d688907a200a0f32ba41cd48c03888098 authored over 10 years ago by nmlgc <[email protected]>
thcrap_init(): Improve naming of the different run configuration variables.

... really, we should get rid of that run_cfg global.

cb1c175486e7524e14e0fde9d33f3c631e69bc55 authored over 10 years ago by nmlgc <[email protected]>
Only use the LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR flag if KB2533623 is installed.

... oh wait, it *is* easy to check whether that update is installed.

e127e5327a18b13026d2921d9728501da9a99fc2 authored over 10 years ago by nmlgc <[email protected]>
Eliminate crashes when an "archive" object is no string.

926ffa64f1369cfe2566d340a18ed949f915df19 authored over 10 years ago by nmlgc <[email protected]>
Support breakpoints with multiple addresses.

5a6eb6d6e47440a0833479f57a78e8a34db07b11 authored over 10 years ago by nmlgc <[email protected]>
Refactor breakpoint rendering into its own function.

5eb3a1eb0aa0003c6d60668d1485fcc7c296e863 authored over 10 years ago by nmlgc <[email protected]>
breakpoints_apply(): Take the "breakpoints" object as a parameter.

Now orthogonal to binhacks_apply().

9f1dbf99ef3bee39085a6e4258ac58f249579f10 authored over 10 years ago by nmlgc <[email protected]>
Use runconfig_func_get() to resolve functions in binary hacks.

This requires the list of exported functions to be stored in the run configuration beforehand - ...

3828a3a663a7776fc13c2a63775ebbeba25b3f09 authored over 10 years ago by nmlgc <[email protected]>
Music Room patching: Don't print "@" for untranslated music titles.

671c3f18e6c3223630afd2d2159be2609bb0ff2e authored over 10 years ago by nmlgc <[email protected]>
Cleanup.

f02bde442864c9ec4a5e61d27ebf3b2b89a14712 authored over 10 years ago by nmlgc <[email protected]>
Count the number of binary hack instances in advance.

And yes, we're going to use this for multi-address breakpoints, too.

"Hackpoints". What a brill...

d1caa04574282123658c734c3f5e5107dab98244 authored over 10 years ago by nmlgc <[email protected]>
binhacks_apply(): Fix a logic flaw in the log counting.

59326af72ef69e0b20e95a428d0ba2de02a9ae45 authored over 10 years ago by nmlgc <[email protected]>
Add functions to access flexible JSON arrays.

Suddenly, even my most hated function in this code is looking so clean!

50cac6782e599c67391ebc0d09b2c8c96c36557c authored over 10 years ago by nmlgc <[email protected]>
Prepare and keep breakpoint data in a local structure.

This gets rid of all the JSON dictionary lookups in breakpoint_process(), and makes everything a...

222138ca0a2e5e66d9ca0ae6445aa1850e312ce3 authored over 10 years ago by nmlgc <[email protected]>
MSG patching: Fix a memory corruption bug introduced by the last cleanup commit.

I should keep a tally of the instances where pointer arithmetic has actually made the code clear...

73dbb9b30117e5205010207830c5d973e911a2e0 authored over 10 years ago by nmlgc <[email protected]>
Tell the user to download KB2533623 if DLL injection failed.

Another cause for DLL injection failure, and hopefully the last one. The LOAD_LIBRARY_SEARCH_DLL...

30c4bca0eb03bb3cba12a29ac82e3db7eee49e20 authored over 10 years ago by nmlgc <[email protected]>
MSG patching: Add a helper function to get the next instruction.

ed0f7d9fb4b8a088d6486cfd9556e7113d215c02 authored almost 11 years ago by nmlgc <[email protected]>
MSG patching: Make the 'lines' key optional.

Time to get rid of this ancient wart.

aa8d966c5fa09f0092228b9c19247634b9f94bfe authored almost 11 years ago by nmlgc <[email protected]>
MSG patching: Don't patch in invalid TSA ruby syntax due to utter plebbery.

Well, of COURSE we can't expect ZUN to apply BASIC PROGRAMMING PRINCIPLES to check the return va...

2b977f87c3d16ac89bb8272b65d06a85487f5673 authored almost 11 years ago by nmlgc <[email protected]>
MSG patching: Advance the line counter in any case.

What a fucking mess this is.

334f64f2c761d051ee5884737d20e1545ae37558 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_update: Ensure graceful termination while an update is in progress.

701fafdf1eddedd9478b079a317eb13998200695 authored almost 11 years ago by nmlgc <[email protected]>
Fix a potential buffer overflow when determining the .msg.jdiff slot key.

One of the few last fixed char arrays, and it was susceptible to a buffer overflow. Hooray.

......

eafcef388af246b6225dac0e2bba8d15cc448f88 authored almost 11 years ago by nmlgc <[email protected]>
ServerDownloadFile: Refactor the HTTP-specific code into its own function.

fd671a7087acdbf7550296da65f07fe6b2ed232e authored almost 11 years ago by nmlgc <[email protected]>
ServerDownloadFile: Fix potential memory leaks.

52281476cd35eae8b4fccd7c49aeda3e49321aec authored almost 11 years ago by nmlgc <[email protected]>
patch_update(): Return prematurely if a patch contains no "servers" object.

Avoids the misleading log message that was previously printed in that case.

e50c1d70fc027c81d855417aa50303e9c399bc66 authored almost 11 years ago by nmlgc <[email protected]>
Rename the "inet" functions and variables to "http".

Yup, we'd like to go multi-protocol.

06d0bdfee6d000657b34732484b8071f61a3778d authored almost 11 years ago by nmlgc <[email protected]>
Cleanup.

6124fa7dc4d739cba9a2df6710cce34b25654503 authored almost 11 years ago by nmlgc <[email protected]>
TSA layout engine: Refactor the final TextOut call into its own function.

cbd72a0b1634c8a179c8c9d41e2f8d3e681617dd authored almost 11 years ago by nmlgc <[email protected]>
Bump version number to 2014-01-03.

1d9a51d130404d5bdb974f412321a3a8c91502d6 authored almost 11 years ago by nmlgc <[email protected]>