[pylauncher] Use standard main() entry point with hybrid CRT linking - #27618
Merged
Conversation
sbc100
force-pushed
the
pylauncher-main
branch
from
August 28, 2026 21:40
373c67d to
a36e5a1
Compare
sbc100
requested review from
RReverser and
dschuff
and removed request for
dschuff
August 28, 2026 21:40
Switch to standard `int main()` entry point in `pylauncher.c` and use `/MT` with `/NODEFAULTLIB:libucrt.lib ucrt.lib` in `build.bat`. The goal of this change is to make the binaries less likely to trigger false positive detections from malware scanners and antivirus tools, which often flag tiny executables compiled with custom entry points and without buffer security checks (`/GS-`). This links CRT startup code and compiler runtime support statically (so buffer security checks `/GS` and cookie initialization are handled automatically by `mainCRTStartup` without custom entrypoint stubs or `vcruntime140.dll` dependencies) while dynamically linking against the OS-provided `ucrtbase.dll`. This increases binary size by ~16-17 KB (total size ~23 KB) compared to the previous `/NODEFAULTLIB /GS-` setup, while avoiding the ~100-300 KB overhead of statically linking the full Universal CRT.
sbc100
force-pushed
the
pylauncher-main
branch
from
August 28, 2026 22:11
a36e5a1 to
b48c619
Compare
dschuff
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switch to standard
int main()entry point inpylauncher.cand use/MTwith/NODEFAULTLIB:libucrt.lib ucrt.libinbuild.bat.The goal of this change is to make the binaries less likely to trigger
false positive detections from malware scanners and antivirus tools,
which often flag tiny executables compiled with custom entry points
and without buffer security checks (
/GS-).This links CRT startup code and compiler runtime support statically
(so buffer security checks
/GSand cookie initialization are handledautomatically by
mainCRTStartupwithout custom entrypoint stubs orvcruntime140.dlldependencies) while dynamically linking against theOS-provided
ucrtbase.dll.This increases binary size by ~16-17 KB (total size ~23 KB) compared
to the previous
/NODEFAULTLIB /GS-setup, while avoiding the~100-300 KB overhead of statically linking the full Universal CRT.