@@ -191,15 +191,25 @@ func isAppMetadataFile(filePath string) bool {
191191}
192192
193193var binDataReplace = []fsutil.ReplaceInfo {
194+ {
195+ PathSuffix : "/curl" ,
196+ Match : "curl/" ,
197+ Replace : "kerl/" ,
198+ },
194199 {
195200 PathSuffix : "/node" ,
196201 Match : "node.js/v" ,
197202 Replace : "done,xu/v" ,
198203 },
199204 {
200- PathSuffix : "/curl" ,
201- Match : "curl/" ,
202- Replace : "kerl/" ,
205+ PathSuffix : "/bash" ,
206+ Match : "@(#)Bash version" ,
207+ Replace : "@(#)Nash wersion" ,
208+ },
209+ {
210+ PathSuffix : "/nginx" ,
211+ Match : "nginx version: " ,
212+ Replace : "xginn wersion: " ,
203213 },
204214}
205215
@@ -223,6 +233,10 @@ const (
223233 OMPObfuscateAPN = "obfuscate_apn"
224234)
225235
236+ var (
237+ BinFileExtra = []byte ("OFH" )
238+ )
239+
226240func init () {
227241 rand .Seed (time .Now ().UnixNano ())
228242}
@@ -2192,16 +2206,17 @@ copyFiles:
21922206 } else {
21932207 //NOTE: this covers the main file set (doesn't cover the extra includes)
21942208 binProps , err := binfile .Detected (filePath )
2195- if err == nil && binProps != nil && binProps .IsBin && binProps .IsExe {
2196- if err := fsutil .AppendToFile (filePath , []byte ("KCQ" ), true ); err != nil {
2209+ if err == nil && binProps != nil && binProps .IsBin {
2210+ //not checking binProps.IsExe because Go's ELF header type decoding is unreliable...
2211+ if err := fsutil .AppendToFile (filePath , BinFileExtra , true ); err != nil {
21972212 logger .Debugf ("[%s,%s] - fsutil.AppendToFile error => %v" , srcFileName , filePath , err )
21982213 } else {
21992214 logger .Tracef ("binfile.Detected[IsExe]/fsutil.AppendToFile - %s" , filePath )
2215+ }
22002216
2201- err := fsutil .ReplaceFileData (filePath , binDataReplace , true )
2202- if err != nil {
2203- logger .Debugf ("[%s,%s] - fsutil.ReplaceFileData error => %v" , srcFileName , filePath , err )
2204- }
2217+ err := fsutil .ReplaceFileData (filePath , binDataReplace , true )
2218+ if err != nil {
2219+ logger .Debugf ("[%s,%s] - fsutil.ReplaceFileData error => %v" , srcFileName , filePath , err )
22052220 }
22062221 }
22072222 }
0 commit comments