This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :glot | |
// allow error | |
package main | |
func main() { | |
// :show start | |
ch := make(chan int) | |
close(ch) | |
ch <- 5 // panics | |
// :show end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :glot | |
// allow error | |
package main | |
func main() { | |
// :show start | |
ch := make(chan string) | |
close(ch) | |
close(ch) | |
// :show end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :glot | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
// :show start | |
ch := make(chan int) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :glot | |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
// :show start | |
ch := make(chan string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :glot | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
// :show start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source code examples: | |
* https://grep.app/search?q=IApplicationAssociationRegistration&filter[lang][0]=C%2B%2B | |
* https://github.com/QupZilla/qupzilla/blob/master/src/lib/other/registerqappassociation.cpp | |
* https://github.com/mpc-hc/mpc-hc/blob/master/src/mpc-hc/FileAssoc.cpp | |
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win7.cpp | |
* https://github.com/syndicodefront/infekt/blob/master/src/win32/default_app_win8.cpp | |
In gecko-dev source code: | |
* Telemetry.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
import ( | |
"fmt" | |
"os/exec" | |
) | |
func checkExeExists(exe string) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
import ( | |
"fmt" | |
"log" | |
"os" | |
"os/exec" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
// https://blog.kowalczyk.info/article/wOYk/advanced-command-execution-in-go-with-osexec.html | |
import ( | |
"bytes" | |
"compress/bzip2" | |
"fmt" | |
"io" | |
"io/ioutil" |