MCPcopy Create free account
hub / github.com/dobin/RedEdr / main

Function main

RedTest/redtest.cpp:800–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

798// =============================================================================
799
800int main(int argc, char* argv[]) {
801 printf("==============================================\n");
802 printf("Red Team Test Tool - APC & Process Injection\n");
803 printf("==============================================\n\n");
804
805 EnumerateMemoryRegions();
806 PrintMemorySegments();
807
808 if (argc > 1) {
809 int testNum = atoi(argv[1]);
810 switch (testNum) {
811 case 0:
812 printf("Running all tests...\n\n");
813 TestThreadSuspendResume();
814 printf("\n");
815 TestProcessSpawnWithShellcode();
816 printf("\n");
817 TestProcessSpawnWithAPCInjection();
818 printf("\n");
819 TestProcessSpawnWithSetThreadContext();
820 printf("\n");
821 TestProcessSpawnWithSectionMapping();
822 printf("\n==============================================\n");
823 printf("All tests completed!\n");
824 printf("==============================================\n");
825 break;
826 case 1:
827 TestThreadSuspendResume();
828 break;
829 case 2:
830 TestProcessSpawnWithShellcode();
831 break;
832 case 3:
833 TestProcessSpawnWithAPCInjection();
834 break;
835 case 4:
836 TestProcessSpawnWithSetThreadContext();
837 break;
838 case 5:
839 TestProcessSpawnWithSectionMapping();
840 break;
841 default:
842 printf("Invalid test number. Use 0, 1, 2, 3, 4, or 5.\n");
843 return 1;
844 }
845 }
846 else {
847 printf("Usage: %s <test_number>\n\n", argv[0]);
848 printf("Available tests:\n");
849 printf(" 0 - Run ALL tests\n");
850 printf(" 1 - Thread Suspend/Resume (no APC)\n");
851 printf(" 2 - Process Spawn with Shellcode Allocation\n");
852 printf(" 3 - Process Spawn with APC Injection\n");
853 printf(" 4 - Process Spawn with SetThreadContext Injection\n");
854 printf(" 5 - Process Spawn with Section Mapping Injection\n\n");
855 printf("Example: %s 1\n", argv[0]);
856 printf("Example: %s 0 (run all tests)\n", argv[0]);
857 return 1;

Callers

nothing calls this directly

Tested by

no test coverage detected