inBuf ="12345666"
v0 =0
v1 =0
k =0if(ord(inBuf[0])==45):
v1 =-1
k +=1
nEnd =len(inBuf)- k
for i inrange(nEnd):
v0 =(ord(inBuf[k+i])-48)+ v0*10print(k+i,v0,hex(v0))
res = v1 ^(v1 + v0)print(res)
nType =3# GetDriveType
volName ="windows"# GetVolumeInformation
ret =0;
ebx =ord(volName[3])<<24|ord(volName[2])<<16|ord(volName[1])<<8|ord(volName[0])for k inrange(nType,0,-1):
ret += ebx * k
ret &=0xffffffffprint(hex(ret))
ret ^=0x797A7553print("Serial: ",hex(ret)," =====> ",ret)