Add RSpec coverage for Msf::Util::EXE.to_winaarch64pe - #9
Merged
bwatters-r7 merged 1 commit intoAug 17, 2026
Conversation
The AArch64 Windows PE generator was added in this branch without a
matching spec, unlike its x86/x64 counterparts in
spec/lib/msf/util/exe/windows/common_spec.rb. Cover the two behaviours
that matter for callers that now route AArch64 payloads through it
(psexec, msfvenom, RPC):
- a small payload is written at the "PAYLOAD:" tag offset in the
template, the returned bytes are still an MZ/PE the same size as
the template, and the surrounding template bytes are untouched;
- a payload larger than WINAARCH64_PAYLOAD_SPACE raises the
documented RuntimeError instead of silently overflowing the
fixed-size buffer.
The oversize test computes its input from
Msf::Util::EXE::Windows::Aarch64::ClassMethods::WINAARCH64_PAYLOAD_SPACE
so widening the template buffer will surface the change here.
Co-authored-by: Cursor <cursoragent@cursor.com>
bwatters-r7
merged commit Aug 17, 2026
3d8d268
into
bwatters-r7:feature/add-aarch64-psexec
25 of 31 checks passed
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.
Follow-up to rapid7#21779, addressing the empty
Included RSpec testscheckbox and the Copilot review note about missing coverage for the new AArch64 EXE generator paths.Summary
Add
spec/lib/msf/util/exe/windows/aarch64_spec.rbcovering the two behaviours callers rely on now thatpsexec/generate_payload_exe_service/to_executable_fmtroute AArch64 payloads throughMsf::Util::EXE.to_winaarch64pe:PAYLOAD:tag offset indata/templates/template_aarch64_windows.exe, the returned bytes are still anMZ/PE the same size as the template, and the surrounding template bytes are unchanged;WINAARCH64_PAYLOAD_SPACEraises the documentedRuntimeErrorinstead of silently overflowing the fixed-size buffer.The oversize test derives its input from
Msf::Util::EXE::Windows::Aarch64::ClassMethods::WINAARCH64_PAYLOAD_SPACEso widening the template buffer will surface here.Mirrors the existing structure of
spec/lib/msf/util/exe/windows/common_spec.rb, which coversto_win32pe_service/to_win64pe_service.Verification
Run against this branch:
bundle exec rubocop spec/lib/msf/util/exe/windows/aarch64_spec.rbclean.Made with Cursor