Revision indexing in progress... (symbol navigation in revisions will be accurate after indexed)
Total 1 files
■ ■ ■ ■ ■ ■ ■
pkg/BananaPhone/bananaphone.go
skipped 19 lines
20
20
DiskBananaPhoneMode
21
21
//AutoBananaPhoneMode will resolve by first trying to resolve in-memory, and then falling back to loading from disk if in-memory fails (eg, if it's hooked and the sysid's have been moved).
22
22
AutoBananaPhoneMode
23
+
//HalosGateBananaPhoneMode will resolve by first trying to resolve in-memory, and then falling back to deduce the syscall by searching a non-hooked function
24
+
HalosGateBananaPhoneMode
23
25
)
24
26
25
27
//BananaPhone will resolve SysID's used for syscalls while making minimal API calls. These ID's can be used for functions like NtAllocateVirtualMemory as defined in functions.go.
26
28
type BananaPhone struct {
27
-
banana *pe.File
28
-
isAuto bool
29
-
memloc uintptr
29
+
banana *pe.File
30
+
isAuto bool
31
+
isHalosGate bool
32
+
memloc uintptr
30
33
}
31
34
32
35
//NewBananaPhone creates a new instance of a bananaphone with behaviour as defined by the input value. Use AutoBananaPhoneMode if you're not sure.
if (useOrd && exp.Ordinal == ord) || // many bothans died for this feature (thanks awgh). Turns out that a value can be exported by ordinal, but not by name! man I love PE files. ha ha jk.
// The sysid should be located 14 bytes after the syscall; ret instruction.
215
+
sysId, e := sysIDFromRawBytes(bBytes[i+14 : i+14+8])
216
+
if !errors.As(e, &err) {
217
+
return sysId - uint16(distanceNeighbor), e
218
+
}
219
+
}
220
+
}
221
+
// reset the value to 1. When we go forward we catch the current syscall; ret but not when we go backward, so distanceNeighboor = 0 for forward and distanceNeighboor = 1 for backward
222
+
distanceNeighbor = 1
223
+
// If nothing has been found forward, search backward