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

Do string table lookups for string parameters in variable argument lists.

ff807491845524cbb5d38cefb755dc70f7d533a7 authored almost 11 years ago by nmlgc <[email protected]>
thcrap_configure: Mention that the shortcuts work from anywhere.

e492cb51664aaa2346d76879fb8a5f6a52dbc2a5 authored almost 11 years ago by nmlgc <[email protected]>
Eliminate potential VLA memory leaks.

Whoops.

4eb458933f73d3beca4f751e22f591479e25f2f5 authored almost 11 years ago by nmlgc <[email protected]>
patch_update(): Load file hash list from files.js.

69fa00f3fa91e7d5c7f799cfd43f4a13033dfa1f authored almost 11 years ago by nmlgc <[email protected]>
patch_update(): Move local file hash list to files.js.

This will cause everyone to redownload everything...

2ed4deb4c0735cbb825302e6108af620a3109eca authored almost 11 years ago by nmlgc <[email protected]>
patch_update(): Always use local server URLs.

That's the only drawback to the new updating system, which treats patch.js just like a normal fi...

a6fead36ddddf87361458142d8d59b088e2c5d7b authored almost 11 years ago by nmlgc <[email protected]>
win32_utf8: Add SetDlgItemText().

Necessary for the pad input check in the custom.exe of th06 (... and later games, if only it act...

6040e892d0dcae4255ccac2cbefce952c92dea8b authored almost 11 years ago by nmlgc <[email protected]>
Add a macro for VLA conversions to UTF-16.

8fd65273e0b39cfc4d07d12afc9a168f770a0578 authored almost 11 years ago by nmlgc <[email protected]>
Bump version number to 2013-10-25

0d3a1182f9c19c4a79a60441e3699dec0616e062 authored almost 11 years ago by nmlgc <[email protected]>
log_nprint(): Check if the console was opened.

What the hell.

00de661c56938c4f0eb19a3245a612946857988a authored almost 11 years ago by nmlgc <[email protected]>
Mention DLL injection chaining in the README file.

... and reword the win32_utf8 section a bit.

f81c89e6119fe627cc64171f57b29e27b1d4de87 authored almost 11 years ago by nmlgc <[email protected]>
Replace IsBad*Ptr() calls with a custom function using VirtualQuery().

See MSDN, Raymond Chen (http://blogs.msdn.com/b/oldnewthing/archive/2006/09/27/773741.aspx) and ...

da41b813f29c84f09efdc6259d35efa4e0aa3c28 authored almost 11 years ago by nmlgc <[email protected]>
Add a basic custom exception handler.

A first step to making the logs of crashes a bit more descriptive. We start out without any adva...

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

... and a bit of everything: missing initializations of local variables, alphabetical sorting of...

9aa798b65dc63497f9d2450bd962f62d53bbe61d authored almost 11 years ago by nmlgc <[email protected]>
Correct types.

1be535ce63ecbeac40c9e4ab012345670e173f4f authored almost 11 years ago by nmlgc <[email protected]>
Correct #include syntax.

Yes, certain other compilers do make a difference between the two #include forms. Guess it becam...

645e615a39aa137a6e3080ce33ec7574fba9150a authored almost 11 years ago by nmlgc <[email protected]>
Use the __DATE__ and __TIME__ macros to print the build time.

__TIMESTAMP__ refers to the *modification time*, not the *build time*... and is not that portable.

55d4e3bd220325adfee328e6f672051f8637c385 authored almost 11 years ago by nmlgc <[email protected]>
Add inject_CreateProcessW().

Necessary for our modified vpatch_th06.dll... and for other, future patched applications that al...

3500e44873e13ba9bd93a949bcdbfed9ade276c6 authored almost 11 years ago by nmlgc <[email protected]>
Change leftover spaces to tabs.

8b07c54c5ff2d02558910651ec798c650556a7ee authored almost 11 years ago by nmlgc <[email protected]>
Add macros for conversions from UTF-16 to UTF-8.

For the few cases where we need them.

a8c6131877e6b5469c73bd022813dc614ad7ac2c authored almost 11 years ago by nmlgc <[email protected]>
Change "old-style" empty function declarations to the (void) syntax.

That's the kind of stuff you only notice when testing a different compiler. Another lesson learned.

ee79edcc6f65acf922439c6e0225dcca08c8b619 authored almost 11 years ago by nmlgc <[email protected]>
Detour CreateRemoteThread() to apply the thcrap detours to newly injected DLLs.

That's it! thcrap can now be fully chained to other patches that use DLL injection, independent ...

6e93053336f15677457d40f3ebbf6383ea023c0b authored about 11 years ago by nmlgc <[email protected]>
Add GetRemoteProcAddress().

53e1aba6e3bde02c518a0b91aba299b73ba73d1b authored about 11 years ago by nmlgc <[email protected]>
Add ReadProcessString().

49e296e16a0464cb12b8e94cd090e3815c6287e4 authored about 11 years ago by nmlgc <[email protected]>
Detour CreateProcess() and LoadLibrary() for DLL injection chaining.

This implements the main part of #25. It still leaves a few locale problems unsolved, though.

1893659196e9d03ce56cb5afde536258b625d829 authored about 11 years ago by nmlgc <[email protected]>
win32_utf8: Add GetPrivateProfileInt().

Necessary for vpatch chaining.

2a8b75d04da9cc4b8e8c99f1eda884a3a803c43f authored about 11 years ago by nmlgc <[email protected]>
Cleanup.

Huh, I forgot sorting the detoured functions in win32_detour.c back in 7e258645f7caa7ee67dc24cf1...

c52eec583b7f6073b29739fce65fd1fc668d70f7 authored about 11 years ago by nmlgc <[email protected]>
Add GetRemoteModuleNtHeader().

8eea3e652e8502be5b5bc44b291857dfc4f5d98f authored about 11 years ago by nmlgc <[email protected]>
Rename module_base_get() to GetRemoteModuleHandle().

133beef47368a0e651d4630f5c7cb476fe9b0554 authored about 11 years ago by nmlgc <[email protected]>
Rename entry_from_header() to GetRemoteModuleEntryPoint().

This is Windows Naming Style Territory.

ac77813e211f934756d8b9923b780557be34c02a authored about 11 years ago by nmlgc <[email protected]>
Move PE structure functions to their own file.

... and adjust some comments accordingly.

69c9226eb905592f3ddb30b013b689402d133ef1 authored about 11 years ago by nmlgc <[email protected]>
module_base_get(): Accept both relative and absolute module names.

1f927bb347fd618bb1ada842979a5edc824f4e1b authored about 11 years ago by nmlgc <[email protected]>
EnumProcessModules() takes the number of *bytes*, not elements.

Changing variable names to reflect this.

5f4d37d4269a49944db69f97ee2d0e12b9087d75 authored about 11 years ago by nmlgc <[email protected]>
StringToUTF8: Take the actual buffer length as parameter.

... instead of intransparently multiplying it by some factor. You should not be able to accident...

8442814066c769de4a4ab3ba847580a266df5e2e authored about 11 years ago by nmlgc <[email protected]>
tsa_CreateWindowExA(): Observe CW_USEDEFAULT.

8ebb088789112f698e08cf7db3f9812ae4ff5f59 authored about 11 years ago by nmlgc <[email protected]>
Split log functions into a variadic and a va_list function.

4ce0e9ee697f1aea9142a1923b67ec85560affbb authored about 11 years ago by nmlgc <[email protected]>
Move submodule detour calls from thcrap_init() to a dedicated function.

d7d554825aea183454356a39b8c9297e38a9a1fb authored about 11 years ago by nmlgc <[email protected]>
Introduce a "detour" naming convention for the IAT patch functions.

There are already way too many different things named "patch" in the engine. It has pretty much ...

58797a645c37abe6bf8b1effb8af2db5e664df48 authored about 11 years ago by nmlgc <[email protected]>
thcrap_tsa layout: Statically call the functions detoured for the main process.

The DLL still keeps its own function pointers to the system functions. These type definitions an...

3a63f35752c6405a0108501b3b20653601513240 authored about 11 years ago by nmlgc <[email protected]>
Remove UTF-16 JSON and logging functions from the main engine.

Finally, everything is consistent. Encodings should never be mixed again.

3568a6852c34c1b4f98f91cf421a8d9f61538785 authored about 11 years ago by nmlgc <[email protected]>
thcrap_update: Add UTF-8 wrappers for the wininet functions used.

Sometimes, you just got to do the right thing... even if that means adding about 150 lines of co...

ab6d8319462c72445baa5e2a3f1c74abad095318 authored about 11 years ago by nmlgc <[email protected]>
Simplify size calculation for translated Win32 dialogs.

Well, it always takes a while for me to get the best ideas.

d19e38da4b4cb78c19b7916fa2c57eff79ff7794 authored about 11 years ago by nmlgc <[email protected]>
Cleanup.

That should have been all the whitespace issues.

6cb7cf7c1373a4798611f19fd6f8293ef8d1aa3a authored about 11 years ago by nmlgc <[email protected]>
Move DLL injection code to the main engine.

1ae967e6fa4898fb3d021ec71ec0a0c504e64138 authored about 11 years ago by nmlgc <[email protected]>
Add json_array_from_wchar_array().

Not too happy about either naming or placement... but well, that code appeared in both the loade...

68591f91ecb741e072399078dac922b7db84a657 authored about 11 years ago by nmlgc <[email protected]>
thcrap_inject(): Determine the DLL name using GetModuleHandleEx().

Not only does this get rid of the #ifdef, it also allows the DLL to be renamed without changing ...

417255e2947dded09c82e4e15335774b4eb6d331 authored about 11 years ago by nmlgc <[email protected]>
thcrap_inject(): Determine the DLL directory using GetModuleFileNameU().

Necessary for chained injection, where the directory of a process executable may no longer be th...

1681df6547e2015bd7b4c252d49530cddfccd4f8 authored about 11 years ago by nmlgc <[email protected]>
Use the new json_pack() string concatenation syntax introduced in Jansson 2.5.

620618f74bd7ea22c1d6165534fe11ca4c34b527 authored about 11 years ago by nmlgc <[email protected]>
strings_vsprintf(): Don't replace the pointer if realloc() failed.

9df854c91d295f44dc9b0b57fbe5bceac483cc0e authored about 11 years ago by nmlgc <[email protected]>
Add a macro for the most common StringToUTF16 use case.

5767e7a3434bb7dda0ae3f9d550957053278c845 authored about 11 years ago by nmlgc <[email protected]>
Store run configuration file name in the run configuration.

This will be necessary for chaining multiple injection-based patches together. And it's a one-li...

4f2c45b252ef3765d97289e4d60f282f9f2ae4f9 authored about 11 years ago by nmlgc <[email protected]>
Use three methods to determine the entry point of the game process.

These are:

1. Reading from EAX after the process has been created in suspended state (works on...

80605dc4af2f12e3989a89d99c2c983c74a518ef authored about 11 years ago by nmlgc <[email protected]>
Introduce a "Rx" syntax for hexadecimal addresses relative to the game's base address.

First half of #3. A lot cleaner than what I originally had in mind.

569199b0141dd31f1f23428a408ec0393fe36fc0 authored about 11 years ago by nmlgc <[email protected]>
Add json_object_hexkey_get().

Oh, if we just hadn't decided on JSON, but some other nonexistant widespread standard format tha...

66f3b3833b6c63dec9817fe27679dce0e75074ac authored about 11 years ago by nmlgc <[email protected]>
Describe the extended functionality of certain win32_utf8 functions in the readme file.

85d800b65b0885b59e87efe5c142b5eb82faf387 authored about 11 years ago by nmlgc <[email protected]>
Refactor the main DLL injection function to match current coding standards.

Yup, finally got around to clean up this copy-pasta. Less redundancy, less fixed-size string buf...

14037147912307ef15a84017860a0f85547d39c0 authored about 11 years ago by nmlgc <[email protected]>
GetModuleFileNameU(): Return the required length if NULL is passed.

Finally, we have the "GetCurrentDirectory functionality" the original function unfortunately lacks.

73ec3fd4ba366b6be80e01e7f3308c0fd366003c authored about 11 years ago by nmlgc <[email protected]>
Replace magic numbers that imply 32-bit pointers with macros.

This will by far not be everything we'll need for 16-bit (PC-98) and 64-bit (the future) compati...

ea1c8a80fce7975048d1d023509b7e8298e96de7 authored about 11 years ago by nmlgc <[email protected]>
Correctly determine the size of patched Win32 dialog items, once and for all.

In the end, the correct way ended up involving a healthy dose of RTFM and the use of an undocume...

bf745861f1347e4ddd734191bbb13369388a8aa4 authored about 11 years ago by nmlgc <[email protected]>
strings_vsprintf(): Rewrite to work independently of string encoding.

Necessary to do this with ascii.anm... and less malloc() is always a good thing.

d5b903618ca45985de614efb1a2634cdfa9a2bc7 authored about 11 years ago by nmlgc <[email protected]>
Cleanup.

aad2ae1b9364acd0a29b8f460a25101c4aeb3f5a authored about 11 years ago by nmlgc <[email protected]>
Rename json_object_get_numkey() to json_object_numkey_get().

... wow, what the hell was I thinking when I named that function. Once you take a look at the fu...

c993da3205565ac483a072cb535446767cd0a1ea authored about 11 years ago by nmlgc <[email protected]>
Redirect GetWindowLong and SetWindowLong to their W equivalents.

This is necessary because Windows otherwise silently converts certain text parameters for window...

f9edf6cb9e577bbdcc2f6a01ba60452e7ec05509 authored about 11 years ago by nmlgc <[email protected]>
Patch Win32 dialog font sizes.

... which is only necessary because drywall messed up the font settings in custom_e.exe in the t...

cbac0328e749f49308075a8d760e6fa1ab7f30ee authored about 11 years ago by nmlgc <[email protected]>
Use the MulDiv algorithm to determine the font size for adjusting dialog items.

Um... yeah, this fixes some cutoffs with certain Korean text, at the expense of slightly overcal...

825f3da3c69b4dbb022ba5080b23de2dbc4f51e1 authored about 11 years ago by nmlgc <[email protected]>
win32_utf8: Add GetModuleFileNameEx().

f30b830a5b54605d08a8a7da9ec5a1ca3bfb57e2 authored about 11 years ago by nmlgc <[email protected]>
Eliminate directory creation confusion and patch CreateDirectoryA.

The existing calls to win32_utf8's custom CreateDirectory function assumed that the directory pa...

b2bb918b266ac972b92235398517130844777854 authored about 11 years ago by nmlgc <[email protected]>
Actually *call* strings_patch(). -.-

That's what you get for adding translatable content after release without testing it beforehand....

ae43fbf8926ac27fc0c821bd5ef0043d6db19b5b authored about 11 years ago by nmlgc <[email protected]>
Bump version number to 2013-08-25

8c99e4e43487692fa73056e3fb50a6d9dce21b66 authored about 11 years ago by nmlgc <[email protected]>
Add the custom.exe bug fix for Western systems.

... by linking to comctl32.dll ourselves and initializing common controls for good measure.

b1f8031f6dd1db20fb7bc371b646ffa17626c62e authored about 11 years ago by nmlgc <[email protected]>
Ensure that the run configuration has a "game" key.

Especially helpful for custom.exe. Otherwise, we would have to create a dummy th*_custom.js file...

f2a04f00803aff3c3fcf04ac729445e418a1043d authored about 11 years ago by nmlgc <[email protected]>
strings_lookup() for MessageBox and CreateWindowEx.

07e0df4f9bc402612aa7398b0bfbfe78e35efccc authored about 11 years ago by nmlgc <[email protected]>
Cleanup.

Now with more "hey, didn't I have a macro for that?".

f7c2429faadcc45c9856039c40d6c9cecff6ad63 authored about 11 years ago by nmlgc <[email protected]>
Add archive formats to .gitignore.

aff112ca4ad2c4537810c7e52f1cdb2b3236a1bb authored about 11 years ago by nmlgc <[email protected]>
Enlarge dialog items both horizontally and vertically, if necessary.

Using the correct function, the direction of text expansion doesn't matter at all.

That complet...

89ccf7f54a0d3b780b5a68553651bc732b40f50e authored about 11 years ago by nmlgc <[email protected]>
win32_utf8: Add DrawText.

78d562c592e4c96e49eef2ed316c53c804c24c49 authored about 11 years ago by nmlgc <[email protected]>
Enlarge dialog items horizontally if necessary.

1fc959feeb1cf30465ef430a62f0d61401b6f1d0 authored about 11 years ago by nmlgc <[email protected]>
Win32 dialog patching, attempt #2 (Easy mode).

I almost wanted to write "Lunatic mode", but with all the time I spent on making the code more c...

eff1907927833f12a733ea30ab784010a1ac0a30 authored about 11 years ago by nmlgc <[email protected]>
Allow length calculations in the UTF conversion functions.

You can now:
* pass NULL as the destination parameter to get the required buffer size for the co...

be31e8df1ffaea5814baba5a1435901a059c48e8 authored about 11 years ago by nmlgc <[email protected]>
thcrap_configure: Maximize the height of the console window.

af3f982b3c7dca72070369017560a1209a53fa14 authored about 11 years ago by nmlgc <[email protected]>
Win32 dialog patching, attempt #1 (Normal mode).

Come on! We're looping three times through both half-structures involved. Can't we do the same w...

f3ebea3f4c134b82379189fa7e38903d1b7c852c authored about 11 years ago by nmlgc <[email protected]>
Do string lookup in GetTextExtent(), not in GetTextExtentBase().

cc018b3a7fc109c52bc5972e2f223322b9f9851e authored about 11 years ago by nmlgc <[email protected]>
win32_utf8: Add CreateDialogParam and DialogBoxParam.

Bravo, Microsoft. What a great design.

If you just replaced lpTemplateName with an integer para...

609e844a396ba380378688ae5cb26359b1aa67d1 authored about 11 years ago by nmlgc <[email protected]>
Fix window placement bugs in the original games.

71c1dcab690f85653cbc9a06c7c55b9794127141 authored about 11 years ago by nmlgc <[email protected]>
Bump version number to 2013-08-20

c1fc1f9ae36f17f88c01de650e9dfd7e142835ea authored about 11 years ago by nmlgc <[email protected]>
BP_music_cmt: Resolve "@" to a music title format string.

I will regret this half a year from now. Anyway, closes #14.

d73613deb99ba9c674ff6f95dedecf2667662490 authored about 11 years ago by nmlgc <[email protected]>
Add Music Room title patching.

cc5031126e84ada23f555051e338f33205eeef1f authored about 11 years ago by nmlgc <[email protected]>
Cleanup.

Recently, I seem to have forgotten that VLAs need to be freed, too.

2b7c1107d444736092fb914b12f7f8c55781144f authored about 11 years ago by nmlgc <[email protected]>
GetTextExtent: Take layout markup into account.

089896a9c10aba35b62d37843717a1ec852b0673 authored about 11 years ago by nmlgc <[email protected]>
Move text layout tokenization into its own function.

Because...

17e622f5642241c97ff2ba2bc0567ab18034d89e authored about 11 years ago by nmlgc <[email protected]>
Move the textdisp GDI32 hooks and GetTextExtent to thcrap_tsa.

The former were kind of Touhou-dependent all the time. GetTextExtent depends on these too, and i...

1536248fd0253bf2195b249c8a2a978b1a242719 authored about 11 years ago by nmlgc <[email protected]>
Refactor the text layout parser.

The string is now tokenized into an array before any actual parsing.

81a0b89d8bf02dd9bfa3254bfb28e1d4373fc0ac authored about 11 years ago by nmlgc <[email protected]>
Add ruby layout.

Closes #26.

ac3e47be50fd8638877d91630dc55684d2e47d2f authored about 11 years ago by nmlgc <[email protected]>
Add strings_sprintf().

This originally resulted from some confusion about the th14 spell card practice menu not properl...

266c34adbb1ad0390b939167768bd9d7b09d6844 authored about 11 years ago by nmlgc <[email protected]>
Add EnsureUTF8().

1deb49bbb5ea48deeb7e07c1b36968b55d2e5aff authored about 11 years ago by nmlgc <[email protected]>
Add basic Music Room comment patching.

324159a9d6dbce928ea86c0a4ea0f4154cf1eca2 authored about 11 years ago by nmlgc <[email protected]>
Add strings_get().

Yeah, it's just a one-liner, but it keeps the stringdefs object local to the strings module. I r...

2ddf5132e6d28c2cccfd0666c4d22c560709fc4d authored about 11 years ago by nmlgc <[email protected]>
Add json_object_get_numkey().

003be09e0b04c1ae96bd7426f7cb31e9c44d51b1 authored about 11 years ago by nmlgc <[email protected]>
Add json_array_get_string_safe().

Yes, I'm not too happy about the name.

68573307bb610226b995ecf0a9b533b6c00ee5bf authored about 11 years ago by nmlgc <[email protected]>
Don't *actually* download 0-byte files.

257c8c797a06eee2ef6996f2e01a02a46b948282 authored about 11 years ago by nmlgc <[email protected]>