Skip to content

Commit 053c722

Browse files
committed
fix forge subscription channel
1 parent b61bfc2 commit 053c722

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tests/attack/0-global/3-forge-subscription-channel.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
from 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

1111
logger.remove()
1212
logger.add(sys.stdout, level="INFO")
1313

1414

1515
def 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

Comments
 (0)