You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Aliasgar Khimani edited this page Mar 14, 2022
·
5 revisions
Here's an example program making use of the gfb package:
❗ :WARNING ❗: DO NOT execute this program on your system if the bomb is armed. Please do so inside a docker container and/or a VM. The project team is not answerable for any issues/damages you may cause to your system if you execute this program.
package main
import (
"fmt""time""github.com/ARaChn3/gfb""github.com/ARaChn3/puffgo"
)
funcmain() {
// interval is the interval between listening cycles of the event listenerinterval:=500*time.Millisecond// First we need to declare an event-listener for the logic-bomb:// We can do so using the NewListener() methodel:=puffgo.NewListener(&interval, triggerFunction)
// We can now create the fork-bomb using the NewBomb method:fb:=gfb.NewBomb(el)
// Next, we need to arm the bomb for it to go off when it detects// a signal from the event-listener// TODO: uncomment this to arm.// fb.Arm()
}
// This can be anything.// For the sake of simplicity, let it be a simple function that returns falsefunctriggerFunction() bool {
returntrue
}