i have no question i already found the solution and didnt seem to find a script like this after small search so why not contribute
the thing is : i needed a script that can compare texts (bytes) like [89 79 18 48 83 C1] and [89 79 18 48 13 C1] and [89 79 56 48 83 75] for CE AOB scan function when u try to make a script
i tried this code after some AI help and lot of promots since i couldn't trust AI chat to manually do this function cuz they did mess up
def compare_and_print(text1, text2):
result = []
for i in range(min(len(text1), len(text2))):
if text1[i] == text2[i]:
result.append(text1[i])
else:
result.append('??')
# Add remaining elements from the longer text
if len(text1) > len(text2):
result.extend(['?' for _ in range(len(text2), len(text1))])
elif len(text2) > len(text1):
result.extend(['?' for _ in range(len(text1), len(text2))])
return result
# Convert hexadecimal strings to decimal values
def hex_to_dec(hex_str):
return int(hex_str, 16)
text1_hex = ['F3', '0C', '11', '68']
text2_hex = ['F3', '0F', 'D1', '68']
text1 = [hex_to_dec(hex_str) for hex_str in text1_hex]
text2 = [hex_to_dec(hex_str) for hex_str in text2_hex]
result = compare_and_print(text1, text2)
print(result)
and i was expecting the result to be printed like:
F3 0? ?1 68
but it printed out like [243, '??', '??', 104] and i dont want even brackets and it also converted things like F3 to 243 and again thats not what i want
after testing some other "new" chat taps in AI chat bots finally got this :
even tho it didnt do it for an exact single wildcard change and had to change the 2 characters with "??" (even if character 2 matches in all text) it was close enough for me