Skip to content

Commit

Permalink
whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron committed Jun 24, 2022
1 parent 9706060 commit 515ec03
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 3 deletions.
4 changes: 1 addition & 3 deletions SummerCamp/Content/Localization/Game/en/Game.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@
"25 cm"

<TEXT> "ADC09A8C4C816DB75013618BC8FB8A6D" (5388dac3)
""

<TEXT> "13A13C434C299B2635D4C1975669D961" (5388dac3)
<TEXT> "19ED532942B42523C89C48815536D93B" (5388dac3)
<TEXT> "2859347E47BB8C9223C6AEAE87D81C8E" (5388dac3)
Expand All @@ -264,7 +262,7 @@
<TEXT> "DEA80A3C42FEAD3C025B32B1430CEB12" (5388dac3)
<TEXT> "E45319144E7F4925171C53A2E593A730" (5388dac3)
<TEXT> "F280B28147950F388CFF80BF46D95490" (5388dac3)
"3"
"!?!"

<TEXT> "660AE18D4B1E4497FCA753A3DD537B0A" (7ab4525f)
"3415 xp"
Expand Down
59 changes: 59 additions & 0 deletions replace_audio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
import os

def main(argv):
if (len(argv) != 3):
print("Too few/many arguments.")
quit()
if ((not os.path.exists(argv[1])) or (not os.path.exists(argv[2]))):
print("One of the paths does not exist.")
quit()
if (argv[1][-6::]!="uasset" or argv[2][-3::]!="ogg"):
print("Bad file types..?")
quit()
uexpr = open(argv[1][:-6]+"uexp","rb")
uexpdata = bytearray(uexpr.read())
uexpr.close()

oggr = open(argv[2],"rb")
oggdata = bytearray(oggr.read())

# Find the beginning of the OGG
i = 0
while True:
if (uexpdata[i:i+4] == bytearray(str.encode("OggS"))):
break
i = i + 1

print("Found OggS at " + str(i) + "!")

uexpend = uexpdata[len(uexpdata)-0x14:]
uexpdata = uexpdata[:i]
uexpdata[i-0x10:i-0x8] = len(oggdata).to_bytes(4,'little') * 2
uexpdata += oggdata
uexpdata += uexpend

uexpw = open(argv[1][:-6] + "newuexp","wb")
uexpw.write(uexpdata)
uexpw.close()

#uexp replaced, now fix the uasset

uassetr = open(argv[1],"rb")
uassetdata = bytearray(uassetr.read())
uassetr.seek(0, os.SEEK_END)
uassetlen = uassetr.tell()
uassetr.close()

uassetdata[-0x60:uassetlen-0x60+4] = (len(uexpdata)-4).to_bytes(4,'little')
uassetw = open(argv[1][:-6] + "newuasset","wb")
uassetw.write(uassetdata)
uassetw.close()

print("success?")




if __name__ == "__main__":
main(sys.argv)
Binary file added untitled.ogg
Binary file not shown.

0 comments on commit 515ec03

Please sign in to comment.