honeynet / ochi

https://ochi.mushmush.org
GNU General Public License v3.0
27 stars 15 forks source link

Per sensor add download button for ARM and AMD64 binaries #95

Open glaslos opened 11 months ago

glaslos commented 11 months ago

The backend will have access to binaries for each architecture. UUID of the sensor needs to be baked into binary. Use the following snippet to replace a placeholder sensor UUID in the binary:

// IndexReplace uses the optimized offset finding
func IndexReplace(b, old, new []byte) []byte {
    i := bytes.Index(b, old)
    if i == -1 {
        return b
    }
    copy(b[i:], new)
    return b
}