Author Topic: injecting .cs file thru fileObject writing  (Read 1145 times)

hi. i'm doing development for a friends server. he hosts on his computer so i cannot edit an ftp and develop for that. instead i can only edit files by injecting them thru eval. nothing malicious, its just writing prefs or editing script files in the gamemode folder

im able to write and read the files fine. im writing a file as a .cs file and it can be read, but for some reason attempting to exec(); that file in the path will break things. like it executes stuff, but it like breaks certain contents. example

new scriptObject(hello) {
      test =5;
};

when i multi-line eval this, the object is created and works. i can create as many clones as necessary and delete them. but when i write this to a .cs file on my friends computer and execute it, the object becomes corrupted or deleted automatically. isObject(hello) will return 0

is there some limitation im not understanding

stop hacking blockland

I can only suggest you try the same thing in an environment that you do have access to via ftp.  Maybe it's writing the files wrong?  Maybe you have to do discoverfile();?  Maybe you're not closing the file after writing to it?


Maybe change the topic title to "writing .cs file through eval"
« Last Edit: June 05, 2018, 07:56:40 PM by Tendon »

make sure you .close(); the fileobject after writing to the file

make sure you .close(); the fileobject after writing to the file
i did. the files can be written and read again afterwards without an issue, but executing the file deletes the object for some reason