Created
October 2, 2015 01:40
-
-
Save XMPPwocky/9a818404a782592fb443 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
import struct | |
while True: | |
src = open("source.vtf", "rb") | |
f = open("test.vtf", "wb") | |
word = src.read(4) | |
while len(word) == 4: | |
word = struct.unpack("I", word)[0] | |
if random.randint(0, 20) < 3: | |
bit = random.randint(0, 31) | |
word = word ^ (1 << bit) | |
word = struct.pack("I", word) | |
f.write(word) | |
word = src.read(4) | |
os.system("\"C:/Program Files (x86)/Steam/steamapps/common/Team Fortress 2/bin/vtf2tga.exe\" -i test.vtf") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment