It does not concern me currently, since I have been bypassing it habitually for a long time.
For the sake of simplicity, I am posting a code here,
my StringFields_BF, which is detected as a Trojan,
and below the code with the workaround I usually use.
But take the StringFields_BF from its thread for use in your software,
because these codes here are just a snapshot and may change in the future :
viewtopic.php?f=12&t=77219
With respect, this is some bullshit.
d12_m06_2021 - Win10 Pro 10.0.19043 Build 19043
Serious=Schwerwiegend - Low=Niedrig
The Defender means, this is the Trojan Wacatac.G!ml.
Code: Select all
DeclareModule StringFields_BF
EnableExplicit
; Main function - Call firstly
; Start index :
; 0 = Add a virtual separator at the first
; 1 = first index
; -1 = Add a virtual separator at the end
; -2 = Add a virtual separator at the first and the end
Declare StringFields_BF(string$, ; String to parse - Adress - set so @string$
separator$, ; Separator
start_index=1, ; Start index
end_index=-1, ; Index up to which is searched - -1 = full string size, all
ignore_empty_fields=1) ; Ignore empty fields
; Child funktions - call at the first the main function
Declare.s GetStringFields_BF(field) ; Get a selected StringField
Declare GetAmountStringFields_BF() ; Get the StringFields amount
Declare GetEmptyStringFields_BF() ; Get the empty StringFields amount
Declare FreeAllStringFields_BF() ; Free the actual cached StringField list
Declare SortStringFields_BF(flags.a=0, ; Flags - (optional) - #PB_Sort_Ascending, #PB_Sort_Descending, #PB_Sort_NoCase
start_field=-1, ; Start field for sort - Ignore with -1
end_field=-1) ; End field for sort - Ignore with -1
; Find a string in a StringField
; This function give back the Stringfield number or 0
Declare FindStringFields_BF(find_string$, ; Search string
start_position=1, ; Startposition inside a StringField
flag.a=#PB_String_CaseSensitive, ; Flag - #PB_String_CaseSensitive (preset), #PB_String_NoCase
start_field=-1, ; Ignore with -1
end_field=-1) ; Ignore with -1
EndDeclareModule
Module StringFields_BF
Global NewList index() : AddElement(index())
Global NewList indexes.s() : AddElement(indexes())
Global empty_fields, skip_first
Procedure StringFields_BF(string$, separator$, start_index=1, end_index=-1, ignore_empty_fields=1)
; StringField_Tool_BF - By Saki - Unicode - This code is free for using and enhancing
Select start_index
Case 0 : Protected add_first=1 : Case -1 : Protected add_last=1 : Case -2 : add_first=1 : add_last=1
EndSelect
start_index=1
Protected i, ii, iii, iiii, pos_1, pos_2, length_result, comp, count_index, amount_indexes
Protected len_separator=StringByteLength(separator$), skip_first, skip_last, *string=@string$
Protected *separator=@separator$, *pointer.word, byte_pos_last, result$
If end_index<0 : end_index=$FFFFFFF : EndIf
If end_index=0 : ProcedureReturn 0 : EndIf
If start_index>end_index : start_index=end_index : EndIf
If Not PeekW(*string) : ProcedureReturn 0 : EndIf
ClearList(index()) : AddElement(index())
ClearList(indexes()) : AddElement(indexes())
If comp=CompareMemory(*string, *separator, len_separator)
end_index+1 : count_index+1 : skip_first=1
EndIf
If add_first
If skip_first And start_index : start_index-2 : end_index-1: EndIf
Else
If skip_first And start_index : start_index-1 : EndIf
EndIf
i=-2
Repeat
i+2 : comp=CompareMemory(*string+i, *separator, len_separator)
If comp
iii=i : count_index+1 : ii+1 : i+len_separator-2 : amount_indexes+1
AddElement(index()) : index()=i+2
EndIf
*pointer=*string+i+len_separator
Until count_index>end_index Or Not *pointer\w
iiii=i
byte_pos_last=iii+len_separator
If comp=CompareMemory(*string+i-len_separator-1, *separator, len_separator) : skip_last=1 : EndIf
If end_index>count_index : end_index=count_index : EndIf
amount_indexes=ii : i=skip_first
If start_index>amount_indexes : start_index=amount_indexes-1 : EndIf
i+start_index+skip_first+skip_last
If skip_first : i-1 : EndIf : If skip_last : i-1 : EndIf
If amount_indexes
Repeat
If ListSize(index())>i : SelectElement(index(), i) : pos_1=index() : EndIf
If ListSize(index())>i+1 : SelectElement(index(), i+1) : pos_2=index() : EndIf
length_result=(pos_2-pos_1-len_separator)>>1
If pos_2-pos_1>0
If length_result>0
result$=PeekS(*string+pos_1, length_result) : AddElement(indexes()) : indexes()=result$
Else
empty_fields+1
If ignore_empty_fields : result$=#Null$ : Else : result$="" : AddElement(indexes()) : EndIf
EndIf
EndIf
skip_first=0 : i+1
Until i>end_index Or i=amount_indexes
If add_last And skip_last
result$=PeekS(*string+byte_pos_last, (iiii-byte_pos_last+len_separator)>>1)
AddElement(indexes()) : indexes()=result$
EndIf
EndIf
ProcedureReturn 1
EndProcedure
Procedure.s GetStringFields_BF(field)
If field <1 : ProcedureReturn "" : EndIf
SelectElement(indexes(), field)
If field<ListSize(indexes())
ProcedureReturn indexes()
EndIf
EndProcedure
Procedure GetAmountStringFields_BF()
ProcedureReturn ListSize(indexes())-1
EndProcedure
Procedure GetEmptyStringFields_BF()
ProcedureReturn empty_fields+skip_first
EndProcedure
Procedure FreeAllStringFields_BF()
ClearList(index())
AddElement(index())
ClearList(indexes())
AddElement(indexes())
empty_fields=0
ProcedureReturn 1
EndProcedure
Procedure SortStringFields_BF(flags.a=0, start_field=-1, end_field=-1)
If start_field>0 And end_field>1 And end_field<=ListSize(indexes())
SortList(indexes(), flags, start_field, end_field-1)
ProcedureReturn 2
Else
SortList(indexes(), flags)
ProcedureReturn 1
EndIf
EndProcedure
Procedure FindStringFields_BF(find_string$,
start_position=1,
flag.a=#PB_String_CaseSensitive,
start_field=-1,
end_field=-1)
Protected i, result$
If end_field>ListSize(indexes()) : end_field=ListSize(indexes()) : EndIf
If start_field>0 And end_field>1
end_field-1
For i=start_field To end_field
SelectElement(indexes(), i) : result$=indexes()
If FindString(result$, find_string$, start_position, flag)
ProcedureReturn i
EndIf
Next
EndIf
ProcedureReturn 0
EndProcedure
EndModule
UseModule StringFields_BF
; #################### Demo part #######################
CompilerIf #PB_Compiler_IsMainFile
EnableExplicit
Define separator$=" "
Define i, index, start_index, end_index, result$, string$
string$=" Hello i am a splitted String, i am StringFields_BF "
Define multiplier=15 ; Enlarge the Teststring - 15 is about 1.7mb (20=54mb) - Deactivate the debugger for large values
If multiplier>1 : For i=1 To multiplier : string$+string$ : Next i : EndIf
Define len_string=Len(string$)
start_index=1 ; Start index
; 0 = Add a virtual separator at the first
; 1 = first index
; -1 = Add a virtual separator at the end
; -2 = Add a virtual separator at the first and the end
end_index=-1 ; Index up to which is searched - -1 = full string size, all
Debug "Start Index : "+start_index
Debug "End Index : "+end_index
Define ignore_empty_fields=1
Define time=ElapsedMilliseconds()
Define parsing_time=ElapsedMilliseconds()
Define amount_fields=StringFields_BF(string$, separator$, start_index, end_index, ignore_empty_fields)
Define parsing_time=ElapsedMilliseconds()-parsing_time
Debug "String parsing time : "+parsing_time
Debug "String length : "+Len(string$)
Debug "StringFields found : "+GetAmountStringFields_BF()
Debug "Empty StringFields found : "+GetEmptyStringFields_BF()
Debug "=============================="
Debug "I only display the first nine StringFields here"
Debug "=============================="
; Sort the StringFields
; Define flags.a=#PB_Sort_Ascending|#PB_Sort_NoCase
; Define start_field=1
; Define end_field=9
; flags (optional) - #PB_Sort_Ascending, #PB_Sort_Descending, #PB_Sort_NoCase
; SortStringFields_BF(flags.a, start_field, end_field)
For index=1 To 9
result$=GetStringFields_BF(index)
Debug result$
Next
; Find a string in a StringField
Define find_string$="am"
Define start_position=1
Define flags.a=#PB_Sort_Ascending ; #PB_Sort_NoCase
Define start_field=1
Define end_field=9 ; GetAmountStringFields_BF()
Define found
Debug "=============================="
Debug "I only search the first nine StringFields here"
Debug "=============================="
Debug "Search for : "+find_string$
For i=1 To end_field
found=FindStringFields_BF(find_string$, start_position, flags.a, start_field, end_field)
If found
start_field=found+1
Debug "Found in StringField : "+found
EndIf
Next
MessageRequester("Deactivate the Debugger",
"String parsing time : "+parsing_time+#LF$+
"String length : "+Len(string$)+#LF$+
"StringFields found : "+GetAmountStringFields_BF()+#LF$+
"Empty StringFields found : "+GetEmptyStringFields_BF())
CompilerEndIf
This is the standard code with the usual workaround
Code: Select all
DeclareModule StringFields_BF
EnableExplicit
; Main function - Call firstly
; Start index :
; 0 = Add a virtual separator at the first
; 1 = first index
; -1 = Add a virtual separator at the end
; -2 = Add a virtual separator at the first and the end
Declare StringFields_BF(string$, ; String to parse - Adress - set so @string$
separator$, ; Separator
start_index=1, ; Start index
end_index=-1, ; Index up to which is searched - -1 = full string size, all
ignore_empty_fields=1) ; Ignore empty fields
; Child funktions - call at the first the main function
Declare.s GetStringFields_BF(field) ; Get a selected StringField
Declare GetAmountStringFields_BF() ; Get the StringFields amount
Declare GetEmptyStringFields_BF() ; Get the empty StringFields amount
Declare FreeAllStringFields_BF() ; Free the actual cached StringField list
Declare SortStringFields_BF(flags.a=0, ; Flags - (optional) - #PB_Sort_Ascending, #PB_Sort_Descending, #PB_Sort_NoCase
start_field=-1, ; Start field for sort - Ignore with -1
end_field=-1) ; End field for sort - Ignore with -1
; Find a string in a StringField
; This function give back the Stringfield number or 0
Declare FindStringFields_BF(find_string$, ; Search string
start_position=1, ; Startposition inside a StringField
flag.a=#PB_String_CaseSensitive, ; Flag - #PB_String_CaseSensitive (preset), #PB_String_NoCase
start_field=-1, ; Ignore with -1
end_field=-1) ; Ignore with -1
EndDeclareModule
Module StringFields_BF
Global NewList index() : AddElement(index())
Global NewList indexes.s() : AddElement(indexes())
Global empty_fields, skip_first
Procedure StringFields_BF(string$, separator$, start_index=1, end_index=-1, ignore_empty_fields=1)
; StringField_Tool_BF - By Saki - Unicode - This code is free for using and enhancing
Select start_index
Case 0 : Protected add_first=1 : Case -1 : Protected add_last=1 : Case -2 : add_first=1 : add_last=1
EndSelect
start_index=1
Protected i, ii, iii, iiii, pos_1, pos_2, length_result, comp, count_index, amount_indexes
Protected len_separator=StringByteLength(separator$), skip_first, skip_last, *string=@string$
Protected *separator=@separator$, *pointer.word, byte_pos_last, result$
If end_index<0 : end_index=$FFFFFFF : EndIf
If end_index=0 : ProcedureReturn 0 : EndIf
If start_index>end_index : start_index=end_index : EndIf
If Not PeekW(*string) : ProcedureReturn 0 : EndIf
ClearList(index()) : AddElement(index())
ClearList(indexes()) : AddElement(indexes())
If comp=CompareMemory(*string, *separator, len_separator)
end_index+1 : count_index+1 : skip_first=1
EndIf
If add_first
If skip_first And start_index : start_index-2 : end_index-1: EndIf
Else
If skip_first And start_index : start_index-1 : EndIf
EndIf
i=-2
Repeat
i+2 : comp=CompareMemory(*string+i, *separator, len_separator)
If comp
iii=i : count_index+1 : ii+1 : i+len_separator-2 : amount_indexes+1
AddElement(index()) : index()=i+2
EndIf
*pointer=*string+i+len_separator
Until count_index>end_index Or Not *pointer\w
iiii=i
byte_pos_last=iii+len_separator
If comp=CompareMemory(*string+i-len_separator-1, *separator, len_separator) : skip_last=1 : EndIf
If end_index>count_index : end_index=count_index : EndIf
amount_indexes=ii : i=skip_first
If start_index>amount_indexes : start_index=amount_indexes-1 : EndIf
i+start_index+skip_first+skip_last
If skip_first : i-1 : EndIf : If skip_last : i-1 : EndIf
If amount_indexes
Repeat
If ListSize(index())>i : SelectElement(index(), i) : pos_1=index() : EndIf
If ListSize(index())>i+1 : SelectElement(index(), i+1) : pos_2=index() : EndIf
length_result=pos_2-pos_1-len_separator
If pos_2-pos_1>0
If length_result>0
result$=Space(length_result>>1)
CopyMemory(*string+pos_1, @result$, length_result)
AddElement(indexes()) : indexes()=result$
Else
empty_fields+1
If ignore_empty_fields : result$=#Null$
Else
result$="" : AddElement(indexes())
EndIf
EndIf
EndIf
skip_first=0 : i+1
Until i>end_index Or i=amount_indexes
If add_last And skip_last
result$=Space((iiii-byte_pos_last+len_separator)/2)
CopyMemory(*string+byte_pos_last, @result$, iiii-byte_pos_last+len_separator)
AddElement(indexes()) : indexes()=result$
EndIf
EndIf
ProcedureReturn 1
EndProcedure
Procedure.s GetStringFields_BF(field)
If field <1 : ProcedureReturn "" : EndIf
SelectElement(indexes(), field)
If field<ListSize(indexes())
ProcedureReturn indexes()
EndIf
EndProcedure
Procedure GetAmountStringFields_BF()
ProcedureReturn ListSize(indexes())-1
EndProcedure
Procedure GetEmptyStringFields_BF()
ProcedureReturn empty_fields+skip_first
EndProcedure
Procedure FreeAllStringFields_BF()
ClearList(index())
AddElement(index())
ClearList(indexes())
AddElement(indexes())
empty_fields=0
ProcedureReturn 1
EndProcedure
Procedure SortStringFields_BF(flags.a=0, start_field=-1, end_field=-1)
If start_field>0 And end_field>1 And end_field<=ListSize(indexes())
SortList(indexes(), flags, start_field, end_field-1)
ProcedureReturn 2
Else
SortList(indexes(), flags)
ProcedureReturn 1
EndIf
EndProcedure
Procedure FindStringFields_BF(find_string$,
start_position=1,
flag.a=#PB_String_CaseSensitive,
start_field=-1,
end_field=-1)
Protected i, result$
If end_field>ListSize(indexes()) : end_field=ListSize(indexes()) : EndIf
If start_field>0 And end_field>1
end_field-1
For i=start_field To end_field
SelectElement(indexes(), i) : result$=indexes()
If FindString(result$, find_string$, start_position, flag)
ProcedureReturn i
EndIf
Next
EndIf
ProcedureReturn 0
EndProcedure
EndModule
UseModule StringFields_BF
; #################### Demo part #######################
CompilerIf #PB_Compiler_IsMainFile
EnableExplicit
Define separator$=" "
Define i, index, start_index, end_index, result$, string$
string$=" Hello i am a splitted String, i am StringFields_BF "
Define multiplier=15 ; Enlarge the Teststring - 15 is about 1.7mb (20=54mb) - Deactivate the debugger for large values
If multiplier>1 : For i=1 To multiplier : string$+string$ : Next i : EndIf
Define len_string=Len(string$)
start_index=1 ; Start index
; 0 = Add a virtual separator at the first
; 1 = first index
; -1 = Add a virtual separator at the end
; -2 = Add a virtual separator at the first and the end
end_index=-1 ; Index up to which is searched - -1 = full string size, all
Debug "Start Index : "+start_index
Debug "End Index : "+end_index
Define ignore_empty_fields=1
Define time=ElapsedMilliseconds()
Define parsing_time=ElapsedMilliseconds()
Define amount_fields=StringFields_BF(string$, separator$, start_index, end_index, ignore_empty_fields)
Define parsing_time=ElapsedMilliseconds()-parsing_time
Debug "String parsing time : "+parsing_time
Debug "String length : "+Len(string$)
Debug "StringFields found : "+GetAmountStringFields_BF()
Debug "Empty StringFields found : "+GetEmptyStringFields_BF()
Debug "=============================="
Debug "I only display the first nine StringFields here"
Debug "=============================="
; Sort the StringFields
; Define flags.a=#PB_Sort_Ascending|#PB_Sort_NoCase
; Define start_field=1
; Define end_field=9
; flags (optional) - #PB_Sort_Ascending, #PB_Sort_Descending, #PB_Sort_NoCase
; SortStringFields_BF(flags.a, start_field, end_field)
For index=1 To 9
result$=GetStringFields_BF(index)
Debug result$
Next
; Find a string in a StringField
Define find_string$="am"
Define start_position=1
Define flags.a=#PB_Sort_Ascending ; #PB_Sort_NoCase
Define start_field=1
Define end_field=9 ; GetAmountStringFields_BF()
Define found
Debug "=============================="
Debug "I only search the first nine StringFields here"
Debug "=============================="
Debug "Search for : "+find_string$
For i=1 To end_field
found=FindStringFields_BF(find_string$, start_position, flags.a, start_field, end_field)
If found
start_field=found+1
Debug "Found in StringField : "+found
EndIf
Next
MessageRequester("Deactivate the Debugger",
"String parsing time : "+parsing_time+#LF$+
"String length : "+Len(string$)+#LF$+
"StringFields found : "+GetAmountStringFields_BF()+#LF$+
"Empty StringFields found : "+GetEmptyStringFields_BF())
CompilerEndIf