MCPcopy Create free account
hub / github.com/Firebasky/Java / do_exec

Method do_exec

BypassSM/learn/eviljar/src/main/java/bypass_sm.java:67–79  ·  view source on GitHub ↗
(String[] cmd)

Source from the content-addressed store, hash-verified

65 }
66
67 public static void do_exec(String[] cmd)
68 throws Exception
69 {
70 Process p = ProcessImpl(cmd);
71
72 byte[] stderr = readBytes(p.getErrorStream());
73 byte[] stdout = readBytes(p.getInputStream());
74 int exitValue = p.waitFor();
75 if (exitValue == 0) {
76 throw new Exception("-----------------\r\n" + new String(stdout) + "-----------------\r\n");
77 }
78 throw new Exception("-----------------\r\n" + new String(stderr) + "-----------------\r\n");
79 }
80
81 public static void main(String[] args)
82 throws Exception

Callers 1

mainMethod · 0.95

Calls 2

ProcessImplMethod · 0.95
readBytesMethod · 0.95

Tested by

no test coverage detected