Parse MemProcFS-style argv. Returns (dump_path, symbol_path). Unrecognised flags are silently skipped — matches MemProcFS leniency.
| 48 | // Parse MemProcFS-style argv. Returns (dump_path, symbol_path). |
| 49 | // Unrecognised flags are silently skipped — matches MemProcFS leniency. |
| 50 | std::pair<std::string, std::string> |
| 51 | parse_argv(DWORD argc, LPCSTR argv[]) { |
| 52 | std::string dump, syms; |
| 53 | // MemProcFS skips argv[0] by convention. |
| 54 | for (DWORD i = 1; i + 1 <= argc; ++i) { |
| 55 | if (!argv[i]) continue; |
| 56 | std::string a = argv[i]; |
| 57 | // `-device <path>` or `-z <path>` (alias seen in scripts) |
| 58 | if ((a == "-device" || a == "-z") && i + 1 < argc) { |
| 59 | dump = argv[++i]; |
| 60 | continue; |
| 61 | } |
| 62 | if (a == "-symbol" && i + 1 < argc) { |
| 63 | syms = argv[++i]; |
| 64 | continue; |
| 65 | } |
| 66 | // First non-flag positional → treat as dump path (some scripts |
| 67 | // pass the path bare). |
| 68 | if (dump.empty() && !a.empty() && a[0] != '-') { |
| 69 | dump = a; |
| 70 | continue; |
| 71 | } |
| 72 | // Silently ignore the rest. (-waitinitialize, -symbolserverdisable, |
| 73 | // -norefresh, -printf, etc. are all accepted-and-ignored.) |
| 74 | } |
| 75 | return { dump, syms }; |
| 76 | } |
| 77 | |
| 78 | } // anonymous |
| 79 |
no outgoing calls
no test coverage detected