IIRC Mgi125 & Admiral Slee have both provided tools for working with CS2 scripts.
|
Hey guys. So I've been crawling my way through the client side of my project while I wait for my new PC parts to arrive, trying to de-obfuscate and pick up on anything where I can. I've been taking a look into CS2 scripts and I really can't get my head around how they're de/recompiled. I figure this is something not many people know. Honestly almost anything cache/client related kills my vibe haha.
So anyway, to avoid trying to figure out how any of that is actually dealt with I just decided to try and make my own custom scripts, however not quite as optimal... I've basically just studied how the scripts are broken up into a series of opcodes and values that the executor works from. Currently, my scripts are essentially just text files stored in the client project. I wrote some functionality to read from said file when the script is called and basically break it into an executor readable format. I mean it works and I can overwrite existing scripts which is real cool, but I don't particularly like how its handled. Aside from the fact that I pretty much have to write a language in order for it to be readable; I don't like that they're not cached...
This may be a dumb question, I really am not versed in handling this kinda stuff, but is there a "somewhat simple" way to go about caching these and implementing it specifically for this purpose? if not simple, could someone at least point me in some direction? I get an aneurysm anytime I break open these client sided mumbo-jumbo decompiled classes. Seems everything is just scattered about aimlessly. Honestly though if you veterans out there think this is sufficient as is then I'll just stick to it, I'm just not sure tbh. I assume it's fine for basic scripts but I'd like to optimize this the best I can before I dive into writing more in-depth / process heavy scripts.
This script I put together is one that allows setting the size of any interface component, considering I couldn't find an actual script/packet that did this on its own to a specified widget, I decided to start there:
Code:void script_10001(Widget widget0, int arg1, int arg2) { widget0.setActive(); widget0.setSize(arg1, arg2, 0, 0); return; }
I mean I’m aware of decompilers and posted information regarding script data, but I haven’t seen any actual tools or in depth information relating to editing, compiling and repacking. Maybe I’m missing something, would you happen to have any links? My method is pretty effective, I have a pretty decent understanding of how the data is handled, it’s just time consuming implementing the language. I think all would be good if I could get these cached.
Been using CS2 Compiler(/Decompiler) for some time now. As far as I remember I've made some changes to it to make it load from and save to the cache directly, but that should be fairly simple to implement.
Add Gradle to the project:
Then use this `build.gradle` file:Code:gradle init
You can then read stuff from your cache like:Code:apply plugin: 'java' apply plugin: 'maven' buildscript { repositories { mavenCentral() maven { url 'https://plugins.gradle.org/m2/' } } } group = 'cs2-editor' version = '1.0' description = 'Vincent\'s CS2 editor' sourceCompatibility = 8 targetCompatibility = 8 repositories { jcenter() mavenCentral() } dependencies { compile fileTree(include: ['*.jar'], dir: 'lib') implementation 'com.displee:rs-cache-library:6.4' } compileJava.options.encoding = 'UTF-8' tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
Code:CacheLibrary cache = CacheLibrary.create("C:\\Users\\Displee\\Documents\\RSPS\\OSRS\\180\\cache"); byte[] data = cache.data(12, script_id);
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |