-
Notifications
You must be signed in to change notification settings - Fork 6
/
gohack_windows.go
50 lines (40 loc) · 1.56 KB
/
gohack_windows.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
package gohack
import (
"errors"
"github.com/jamesmoriarty/gohack/internal/gohack"
"github.com/jamesmoriarty/gomem"
log "github.com/sirupsen/logrus"
)
var (
Version string
Date string
)
func Instrument() (*gohack.Client, error) {
log.SetFormatter(&log.TextFormatter{ForceColors: true})
offsets, err := gohack.GetOffsets()
if err != nil {
return nil, errors.New("Failed to get offsets " + err.Error())
}
log.WithFields(log.Fields{"url": gohack.OffsetsURL}).Info("GetOffsets")
process, err := gomem.GetOpenProcessFromName("csgo.exe")
if err != nil {
return nil, errors.New("Failed to get pid csgo.exe")
}
log.WithFields(log.Fields{"pid": process.ID, "handle": process.Handle}).Info("GetOpenProcessFromName csgo.exe")
client, err := gohack.GetClientFrom(process, offsets)
if err != nil {
return nil, err
}
log.WithFields(log.Fields{"value": gohack.ToHexString(client.Address)}).Info("[+] Address")
log.WithFields(log.Fields{"value": gohack.ToHexString(client.OffsetForceJump())}).Info("[+] OffsetForceJump")
log.WithFields(log.Fields{"value": gohack.ToHexString(client.OffsetForceAttack())}).Info("[+] OffsetForceAttack")
log.WithFields(log.Fields{"value": gohack.ToHexString(client.OffsetPlayer())}).Info("[+] OffsetPlayer")
log.WithFields(log.Fields{"value": gohack.ToHexString(client.OffsetPlayerFlags())}).Info("[+] OffsetPlayerFlags")
log.WithFields(log.Fields{"value": gohack.ToHexString(client.OffsetEntityId())}).Info("[+] OffsetEntityId")
return client, err
}
func Execute(c *gohack.Client) {
go gohack.RunTrigger(c)
go gohack.RunHop(c)
select{ }
}