Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/EgeBalci/sgn
/ functions
Functions
53 in github.com/EgeBalci/sgn
⨍
Functions
53
◇
Types & classes
5
↓ 15 callers
Function
PrintVerbose
(format string, a ...interface{})
utils/helpers.go:50
↓ 13 callers
Method
Assemble
Assemble assembes the given instructions and return a byte array with a boolean value indicating wether the operation is successful or not
pkg/sgn.go:223
↓ 10 callers
Function
PrintFatal
(format string, a ...interface{})
utils/helpers.go:44
↓ 9 callers
Function
GetRandomByte
GetRandomByte generates a random single byte
pkg/encode.go:181
↓ 9 callers
Method
GetRandomRegister
GetRandomRegister returns a random register name based on given size and architecture
pkg/sgn.go:110
↓ 8 callers
Function
CoinFlip
CoinFlip implements a coin flip witch returns true/false
pkg/encode.go:195
↓ 6 callers
Method
GenerateGarbageInstructions
GenerateGarbageInstructions generates random garbage instruction(s) with the specified architecture and returns the assembled bytes
pkg/obfuscate.go:36
↓ 5 callers
Method
GetArchitecture
GetArchitecture returns the encoder architecture
pkg/encode.go:71
↓ 5 callers
Method
GetRandomStackAddress
GetRandomStackAddress returns a stack address assembly referance based on the encoder architecture Ex: [esp+10] (address range is 1 byte)
pkg/sgn.go:147
↓ 4 callers
Function
PrintStatus
(format string, a ...interface{})
utils/helpers.go:34
↓ 3 callers
Method
GenerateGarbageAssembly
SGN ASM Label Definitions; ----------------------------- {R} = RANDOM GENERAL PURPOSE REGISTER {K} = RANDOM BYTE OF DATA {L} = RANDOM ASM LABEL {G}
pkg/obfuscate.go:21
↓ 3 callers
Function
GetRandomBytes
GetRandomBytes generates a random byte slice with given size
pkg/encode.go:186
↓ 3 callers
Method
GetSafeRandomRegister
GetSafeRandomRegister returns a random register among all (registers-excluded parameters) based on given size
pkg/sgn.go:181
↓ 3 callers
Method
GetStackPointer
GetStackPointer returns the stack pointer register string based on the encoder architecture
pkg/sgn.go:155
↓ 2 callers
Method
AddSchemaDecoder
AddSchemaDecoder creates decoder stub for binaries that are ciphered with SchemaCipher function. The schema array that is used on the given payload, a
pkg/decode.go:78
↓ 2 callers
Method
Encode
Encode function is the primary encode method for SGN all nessary options and parameters are contained inside the encodder struct
pkg/encode.go:77
↓ 2 callers
Method
NewCipherSchema
NewCipherSchema generates random schema for using int the SchemaCipher function. Generated schema contains random operands and keys.
pkg/encode.go:202
↓ 2 callers
Method
NewDecoderAssembly
NewDecoderAssembly creates a unobfuscated decoder stub to the given encoded payload with the given architecture and seed value
pkg/decode.go:42
↓ 2 callers
Function
PrintSuccess
(format string, a ...interface{})
utils/helpers.go:39
↓ 2 callers
Method
SchemaCipher
SchemaCipher encodes a part of the given binary starting from the given index. Encoding done without using any loop conditions based on the schema val
pkg/encode.go:152
↓ 2 callers
Function
encode
Encode function is the primary encode method for SGN
main.go:134
↓ 2 callers
Function
include
(arr []string, str string)
pkg/obfuscate.go:232
↓ 1 callers
Method
AddADFLDecoder
AddADFLDecoder creates decoder stub for binaries that are ciphered with CipherADFL function.
pkg/decode.go:64
↓ 1 callers
Method
AddCallOver
AddCallOver function adds a call instruction over the end of the given payload address of the payload will be pushed to the stack and execution will c
pkg/sgn.go:297
↓ 1 callers
Method
AddJmpOver
AddJmpOver function adds a jmp instruction over the end of the given payload execution will continiou after the end of payload
pkg/sgn.go:312
↓ 1 callers
Method
CalculateAverageGarbageInstructionSize
CalculateAverageGarbageInstructionSize calculate the avarage size of generated random garbage instructions
pkg/obfuscate.go:242
↓ 1 callers
Function
CipherADFL
CipherADFL (Additive Feedback Loop) performs a additive feedback xor operation similar to LFSR (Linear-feedback shift register) IN REVERSE ORDER !! wi
pkg/encode.go:138
↓ 1 callers
Function
ConfigureOptions
()
config/options.go:37
↓ 1 callers
Function
ContainsBytes
checks if a byte array contains any element of another byte array
utils/helpers.go:15
↓ 1 callers
Method
GenerateGarbageJump
GenerateGarbageJump generates a JMP instruction over random bytes
pkg/obfuscate.go:298
↓ 1 callers
Method
GetRandomMatchingOperandType
GetRandomMatchingOperandType randomly selects a operand type for subject instruction
pkg/obfuscate.go:210
↓ 1 callers
Method
GetRandomOperandValue
GetRandomOperandValue generates a instruction parameter value based on given operand type Only some operand types are considered because SGN only uses
pkg/obfuscate.go:153
↓ 1 callers
Function
GetRandomSafeAssembly
GetRandomSafeAssembly return a safe garbage instruction assembly
pkg/obfuscate.go:70
↓ 1 callers
Method
GetRandomUnsafeMnemonic
GetRandomUnsafeMnemonic returns a random unsafe instruction based on the encoder architecture and operand number/type Currently SGN only supports inst
pkg/obfuscate.go:123
↓ 1 callers
Function
IsASCIIPrintable
checks if s is ascii and printable, aka doesn't include tab, backspace, etc.
utils/helpers.go:25
↓ 1 callers
Function
RandomLabel
RandomLabel generates a random assembly label
pkg/obfuscate.go:308
↓ 1 callers
Function
RandomOperand
RandomOperand generates a random operand string
pkg/encode.go:176
↓ 1 callers
Function
printBanner
()
main.go:198
Method
AddCondJmpOver
AddCondJmpOver function adds a jmp instruction over the end of the given payload execution will continiou after the end of payload
pkg/sgn.go:327
Method
GenerateIPToStack
GenerateIPToStack function generates instructions series that pushes the instruction pointer to stack
pkg/sgn.go:286
Method
GetAssemblySize
GetAssemblySize assembes the given instructions and returns the total instruction size if assembly fails return value is -1
pkg/sgn.go:253
Method
GetBasePointer
GetBasePointer returns the base pointer register string based on the encoder architecture
pkg/sgn.go:168
Method
GetRandomFunctionAssembly
GetRandomFunctionAssembly generates a function frame assembly with garbage instructions inside
pkg/obfuscate.go:268
Method
GetRandomUnsafeAssembly
GetRandomUnsafeAssembly return a safe garbage instruction assembly
pkg/obfuscate.go:82
Function
GetSchemaTable
GetSchemaTable returns the printable encoder schema table
pkg/encode.go:224
Function
HelpPrompt
(options kong.HelpOptions, ctx *kong.Context)
config/options.go:29
Function
NewEncoder
NewEncoder for creating new encoder structures
pkg/encode.go:35
Method
SetArchitecture
SetArchitecture sets the encoder architecture
pkg/encode.go:58
Function
TestIntegrationExecution
(t *testing.T)
test/integration_test.go:24
Method
debugAssembly
(str string)
pkg/obfuscate.go:257
Function
init
Initialize the register values
pkg/sgn.go:33
Function
main
()
main.go:20
Function
main
()
examples/encode_x64_binary.go:11