def iterXOR(hexString, otherString):
#Convert otherString to a hex (the 16 is for base 16)
otherNum = int(otherString, 16)
#Iterate over the hexString
for i in range(0, len(hexString) - len(otherString) + 1):
#Grab the substring of length N beginning at index i
#Where N is the length of otherString and i is the index
subString = hexString[i:i+len(otherString)]
#Convert the substring to a hex number
hexNum = int(subString, 16)
#Print the product of the XOR (or do whatever you want here)
print hex(hexNum ^ otherNum)
#Usage
iterXOR("12104c06134e5709", "74484520")
Outputs:
>>>
0x66580926
0x554c8541
0x64044333
0x70882414
0x384e566e
0xb42971c5
0x725b0b77
0x157ca050
0x67061229