Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings and typos #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

e4ch
Copy link

@e4ch e4ch commented Dec 6, 2024

changed:

  • some printf format strings were not using correct type
  • char[] initialization: using string with "\xnn" instead of {0xnn}
  • use new payload: exec calc.exe (not sure what was there before)
  • fix typo: pEnctyptedShell -> pEncryptedShell
  • for-loop: int idx -> unsigned int idx
  • deObfuscate parameter char* -> LPSTR
  • ram= cast to smaller type to avoid warning with size lost
  • reverseShellcode: fix comment "in 0x format" (values have no format)
  • reverseShellcode: rename parameter "shellcode" as it conflicts with global variable
  • main: add macro UNREFERENCED_PARAMETER for argc
  • EnableConsoleColors call: remove comment in arabic to avoid unicode in source code
  • hModule and dwOldProtect: unused variables commented out
  • nMemAlloc comment "will be 1048576" clarify that it's multiply
  • pMem=malloc() -> separate into two lines to avoid warning "assignment within if statement"
  • LoadLibraryA(cAmsi): add cast to LPSTR
  • move all single-line if(){..}else{..} statements to two lines, as default VisualStudio does this anyway
  • a few code lines were using spaces, while the rest of the code used tabs for indentation: unified this to tabs everywhere
  • uNtAllocateVirtualMemory, uNtCreateThreadEx, uNtQueryInformationThread assignments were unused variables: commented them out
  • etwPatch had a conversion warning; added a cast
  • text "without using an APIs" -> "without using any APIs"
  • getchar() moved to new line
  • last return statement is unreachable code; commented it out

changed:
* some printf format strings were not using correct type
* char[] initialization: using string with "\xnn" instead of {0xnn}
* use new payload: exec calc.exe (not sure what was there before)
* fix typo: pEnctyptedShell -> pEncryptedShell
* for-loop: int idx -> unsigned int idx
* deObfuscate parameter char* -> LPSTR
* ram= cast to smaller type to avoid warning with size lost
* reverseShellcode: fix comment "in 0x format" (values have no format)
* reverseShellcode: rename parameter "shellcode" as it conflicts with global variable
* main: add macro UNREFERENCED_PARAMETER for argc
* EnableConsoleColors call: remove comment in arabic to avoid unicode in source code
* hModule and dwOldProtect: unused variables commented out
* nMemAlloc comment "will be 1048576" clarify that it's multiply
* pMem=malloc() -> separate into two lines to avoid warning "assignment within if statement"
* LoadLibraryA(cAmsi): add cast to LPSTR
* move all single-line if(){..}else{..} statements to two lines, as default VisualStudio does this anyway
* a few code lines were using spaces, while the rest of the code used tabs for indentation: unified this to tabs everywhere
* uNtAllocateVirtualMemory, uNtCreateThreadEx, uNtQueryInformationThread assignments were unused variables: commented them out
* etwPatch had a conversion warning; added a cast
* text "without using an APIs" -> "without using any APIs"
* getchar() moved to new line
* last return statement is unreachable code; commented it out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant