Artikash / Textractor

Extracts text from video games and visual novels. Highly extensible.
GNU General Public License v3.0
2.12k stars 204 forks source link

after 4.9.0 TextractorCLI is not work #322

Closed luojunyuan closed 4 years ago

luojunyuan commented 4 years ago

when I use PIPE in python to connect with TextractorCLI.exe. But attach -Pid return nothing to me. Before 4.9.0, it works great and return me many messages.

when I use Textractor 4.9.0, and send attach -Pid to it

    def attach(self, pid: int) -> None:
        print('attach -P' + str(pid))
        self.cli.stdin.write('attach -P' + str(pid) + CRLF)
        self.cli.stdin.flush()

And return nothing to me image

I tried to use R-code to inject it, but it return this error. I think it means the process is not injected yet

image

I must reopen the game. Then switch to 4.8.0. everything goes well image

all version after 4.9.0 has this seem issua I compared the source code between 4.8.0 and 4.9.0 found in GUI\host\host.cpp line 207

static std::wstring location = Util::GetModuleFilename(LoadLibraryExW(ITH_DLL, nullptr, DONT_RESOLVE_DLL_REFERENCES)).value();

changed to

static std::wstring location = std::filesystem::current_path().wstring() + L"\\" + ITH_DLL;

I don't know if this is the reason..

Artikash commented 4 years ago

Yup, that line of code is the reason. Try with this: TextractorCLI.zip

luojunyuan commented 4 years ago

Yup, that line of code is the reason. Try with this: TextractorCLI.zip

I still get the same situation. I replace the exe file, but this even make the 4.8.0 didn't work. when I attach to non-existent pid. It will show me Textractor: couldn't inject when I attach to a right process. It respond nothing to me

Edit: I complie CLI in 4.9.0 and let it back to Util::GetModuleFilename. things work perfectly! But I don't know how to archive this in the last version of Textractor

Artikash commented 4 years ago

Ok this one should definitely work: TextractorCLI.zip

luojunyuan commented 4 years ago

image Awesome! now I can use the powerfull new version in the future <3 thank you!

Artikash commented 4 years ago

Fixed in 4.12.0.