Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -6175,8 +6175,13 @@ def do_invoke(self, argv: list[str]) -> None:
endian = gef.arch.endianness

if argc >= 2:
if argv[1].lower() == "big": endian = Endianness.BIG_ENDIAN
elif argv[1].lower() == "little": endian = Endianness.LITTLE_ENDIAN
if argv[1].lower() == "big":
endian = Endianness.BIG_ENDIAN
elif argv[1].lower() == "little":
endian = Endianness.LITTLE_ENDIAN
else:
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing whitespace after the colon.

Suggested change
else:
else:

Copilot uses AI. Check for mistakes.
self.usage()
return
Comment on lines +6182 to +6184
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new validation logic for the second argument (lines 6182-6184) lacks test coverage. Consider adding a test case that verifies the command shows usage information when an invalid endianness value is provided as the second argument, such as search-pattern PATTERN invalid_value.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AAMOF Copilot is right on this.
Can you add a quick test to make there is no regression on this?


if is_hex(pattern):
if endian == Endianness.BIG_ENDIAN:
Expand Down