Skip to main content

A player made and maintained cheat detection tool for osu!. Provides support for detecting replay stealing, remodding, relax, and aim correction from a profile, map, or set of osr files.

Project description

logo

PyPi version CodeFactor

Circlecore

Circlecore is a both a cheat detection library and a utilities library for osu!. Features include:

  • Replay Stealing / Remodding detection
  • Unstable Rate (ur) calculation, for relax cheats
  • Finding suspicious movements in replays (called Snaps), for aim correction cheats
  • Frametime analysis, for timewarp cheats

Built for use in Circleguard, circlecore is easily integratable into any existing python project and we have worked hard to ensure it is easy to use. See Usage (and our documentation at https://circleguard.dev/docs/circlecore) for developer guidance.

Circleguard is developed and maintained by:

Installation

Circlecore can be installed from pip:

pip install circleguard

This documentation refers to the project as circlecore to differentiate it from our organization Circleguard and the gui application Circleguard. However, circlecore is installed from pypi with the name circleguard, and is imported as such in python (import circleguard).

Links

Github: https://github.com/circleguard/circlecore
Documentation: https://circleguard.dev/docs/circlecore
Discord: https://discord.gg/VNnkTjm

Usage

We have documentation and a tutorial at https://circleguard.dev/docs/circlecore. However, below is a quickstart guide.

from circleguard import *

# replace "key" with your api key
cg = Circleguard("key")
# replays by http://osu.ppy.sh/u/2757689 and http://osu.ppy.sh/u/4196808 on map
# http://osu.ppy.sh/b/221777
r1 = ReplayMap(221777, 2757689)
r2 = ReplayMap(221777, 4196808)

for result in cg.steal_check([r1, r2]): # r is a StealResult
    r = result
    print(f"{r.replay1.username} +{r.replay1.mods} vs {r.replay2.username} "
          f"+{r.replay2.mods} on {r.replay1.map_id}. {r.similarity} sim")

for result in cg.relax_check(r1): # r is a RelaxResult
    print(f"{r1}, {result.ur:.2f} ur")

for result in cg.correction_check(r2): # r is a CorrectionResult
    snap_times = [snap.time for snap in result.snaps]
    print(f"Number of snaps: {len(result.snaps)}, times: {snap_times}")

# ReplayMap isn't the only way to represent replays; we can also get a user's
# top 10 plays:
u = User(12092800, span="1-10")
# or a local replay:
r3 = ReplayPath("/path/to/local/osr/replay.osr")
# or all of a user's replays on a map:
mu = MapUser(221777, 2757689)
# and more...you can find them all at
# https://docs.circleguard.dev/en/v4.3.4/appendix.html#circleguard.loadable.Loadable.

# all of these can be investigated in the same way as ReplayMaps above, eg:
r = cg.steal_check([r, r3, mu])
# or just one:
r = cg.relax_check(u)

# there are more checks than just the above, as well - you can find them all at
# https://docs.circleguard.dev/en/v4.3.4/appendix.html#circleguard.circleguard.Circleguard
from circleguard import *

cg = Circleguard("key")
m = Map(221777, span="1-2") # First two replays on 221777
# all Loadables (that is, anything that can be loaded - Map, User, ReplayMap,
# ReplayPath, etc) defer loading anything from the api until necessary.
# We can force the Map to load information about its replays:
cg.load_info(m)

# Once info loaded, we can iterate over Map, User, and MapUser to get the
# replays contained by them. Formally, these objects are called "LoadableContainers"
for replay in m:
    print(f"{replay.username} +{replay.mods} on map {replay.map_id}")

# the map is info loaded, but not yet loaded, so its replays are not yet loaded either
print(m[0].loaded) # False
print(m[0].replay_data) # None, unloaded replays don't yet have replay data
# we can force load m, which will load its replays:
cg.load(m)
print(len(m[0].replay_data)) # 11100

# all this loading is only necessary if you want to handle Loadables specially
# before checking them - cg.steal_check (and the other methods like cg.relax_check)
# automatically load the Loadables passed to them, which is why we didn't need
# to force load anything ourselves in the first example.

Contributing

Join our discord and ask how you can help, or look around for open issues which interest you and tackle those. PR requests are welcome!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circleguard-4.5.0.tar.gz (46.9 kB view details)

Uploaded Source

Built Distribution

circleguard-4.5.0-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file circleguard-4.5.0.tar.gz.

File metadata

  • Download URL: circleguard-4.5.0.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for circleguard-4.5.0.tar.gz
Algorithm Hash digest
SHA256 9f590fccda2774e27b31ca95904d77f595fa9e5bd00510acfd668ac92d1661c2
MD5 b4ffb0613bfce6a979f02d8f6d6d879a
BLAKE2b-256 203ee90a09ac5cd47e83a34c8cd6659c60a26dbc4388a88b8d36ceaa527f7eb4

See more details on using hashes here.

File details

Details for the file circleguard-4.5.0-py3-none-any.whl.

File metadata

  • Download URL: circleguard-4.5.0-py3-none-any.whl
  • Upload date:
  • Size: 68.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for circleguard-4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eca0569619176bb3cd03ccdc9f49aeb062a1fa767b6009a84a1c3c01eff41bdb
MD5 5451dc0f5f37fd0aae95ac0fe34c5318
BLAKE2b-256 7e2f0e52696963a2ecd23cdc0fc1fe7c41d17e971693111870a97e16ce51c153

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page