Skip to content

Commit

Permalink
wait for process to init fully
Browse files Browse the repository at this point in the history
  • Loading branch information
moonshadow565 committed Aug 25, 2022
1 parent 2c8e397 commit 24dbedb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions cslol-tools/lib/lol/patcher/utility/process_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,15 @@ auto Process::Find(char const* name) -> std::optional<Process> {
if (!process.handle_) {
lol_throw_msg("OpenProcess: {}", last_error());
}
HMODULE mod = {};
DWORD modSize = {};
if (!EnumProcessModules(process.handle_, &mod, sizeof(mod), &modSize)) {
return std::nullopt;
}
char dump[1024] = {};
if (!ReadProcessMemory(process.handle_, mod, dump, sizeof(dump), nullptr)) {
return std::nullopt;
}
return std::move(process);
}
return std::nullopt;
Expand Down
2 changes: 1 addition & 1 deletion src/qml/CSLOLToolBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ToolBar {
text: "\uf004"
font.family: "FontAwesome"
onClicked: {
Qt.openUrlExternally("https://github.com/sponsors/moonshadow565")
Qt.openUrlExternally("https://github.com/morilli")
}
}
ToolButton {
Expand Down

0 comments on commit 24dbedb

Please sign in to comment.