Skip to content

Instantly share code, notes, and snippets.

@huntfx
Created July 17, 2024 23:40
Show Gist options
  • Save huntfx/613461d817d957d644c2092b6d37d91a to your computer and use it in GitHub Desktop.
Save huntfx/613461d817d957d644c2092b6d37d91a to your computer and use it in GitHub Desktop.
Bypass the sensitivity slider in Immortals of Aveum to manually set a value.
"""Set the Immortals of Aveum sensitivity value to anything.
It works outside the range of the sensitivity slider, and possibly with more precision.
"""
import os
import struct
PATH = os.path.expandvars('%LOCALAPPDATA%/P3/Saved/SaveGames/GameSettings.sav')
with open(PATH, 'rb') as f:
data = bytearray(f.read())
# Get the pointer to the data
ptr = data.index(b'MouseSensitivity')
ptr += data[ptr:].index(b'FloatProperty') + 23
# Read the value
value = struct.unpack('f', data[ptr:ptr + 4])[0]
print(f'Current sensitivity: {value}')
# Ask for a new value
new_value = float(input('Choose a new sensitivity value (0.01 - 1.0): '))
# Overwrite the data
for i, c in enumerate(struct.pack('f', new_value)):
data[ptr + i] = c
with open(PATH, 'wb') as f:
f.write(data)
print(f'Set sensitivity: {struct.unpack("f", data[ptr:ptr + 4])[0]}')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment