Topic: Editing Cnut files (not for modding, just curiosity)

Tagged: ,

  • Author
    Posts
  • #20729
    MeteMete
    Participant

    I was trying to do some really simple things, like edit the weapon names. I was able to edit the names but looks like your cnut files doesn’t work with string that are bigger than 7 characters? Are the devs obfuscating strings or is this something done by the compiler? I compiled a file I created and I was able to see the full string, doesn’t matter the size.

    Just to sane my curiosity, is there a Name = “knife” in the knife.cnut file?

    Thanks.

    #20747
    ZensalinZensalin
    Participant

    Hi Mete!
    I am not a dev, so I can’t answer your initial question, but I want to ask you one!

    Did you simply rename the files themselfs or did you actually edit them? If so: How/with what did you decompile/edit the scripts?

    I’m asking because, if I would be able to read out various things of the scripts (like unique weapon stat ranges, background stat ranges, event info, etc.) I could turn some “guesswork” on the wiki into untouchable facts by reading the data out.

    #20753
    MeteMete
    Participant

    If you open the cnut files you will be able to identify some string, like “Name”, these string have a prefix and a suffix in the form of:
    08 04 N a m e 10
    Where the 08 is a “header”, the 04 is the size of the string, the string, and 10 is the end, of course the Name is in hex, so thats how I changed weapons names, the problem is that it only works for strings that are not bigger than 7 characters.
    Also, I tried to edit some weapon values, I found that for knife, there are like 9 integers with value 20, and some others with value 25, I tried to compare the address and the characters around these values to the values on other weapons but I couldn’t find a pattern, I will probably do it by trial and error.

    I just got my hands on NutCracker, but it didnt decompile the cnut files at all. As I said, if I create a cnut file and compile, I can edit the strings, so I guess they are doing something different.

    But, I didn’t spend to much time looking at these files, I will probably keep trying when I get some time.

    #20754
    DanubianDanubian
    Participant

    Good luck mate, i really want to mod this game myself too. Its a bit ridiculous modding is where it is now, i really hope this is one of the priorities for the near future.

    #20757
    SarissofoiSarissofoi
    Participant

    Ha. You are exactly in place where I was been few months ago(or even later).
    Good luck as I run of mine and achieve nothing.

    #20764
    MeteMete
    Participant

    Ha. You are exactly in place where I was been few months ago(or even later).
    Good luck as I run of mine and achieve nothing.

    Mind sharing your discoveries?

    #20765
    SarissofoiSarissofoi
    Participant

    Ha. You are exactly in place where I was been few months ago(or even later).
    Good luck as I run of mine and achieve nothing.

    Mind sharing your discoveries?

    Nothing really.
    The files are compiled and I was out of ideas how to break them. Tried Nut cracker and some other programs with no to zero effect.

    #23956
    AdamMil
    Participant

    I gave it a try. There are multiple layers of DRM and deliberate corruption/ciphering of the CNUT files to make them hard to read; clearly the developers went out of their way to prevent people from reading the scripts. But after 8 or 9 hours I got it. Here’s the content of that knife.cnut file you mentioned:

    [code]
    this.knife <- this.inherit(“scripts/items/weapons/weapon”, {
    m = {},
    function create()
    {
    this.weapon.create();
    this.m.ID = “weapon.knife”;
    this.m.Name = “Knife”;
    this.m.Description = “A short knife, not made for combat.”;
    this.m.Categories = “Dagger, One-Handed”;
    this.m.IconLarge = “weapons/melee/knife_01.png”;
    this.m.Icon = “weapons/melee/knife_01_70x70.png”;
    this.m.SlotType = this.Const.ItemSlot.Mainhand;
    this.m.ItemType = this.Const.Items.ItemType.Weapon | this.Const.Items.ItemType.MeleeWeapon | this.Const.Items.ItemType.OneHanded;
    this.m.IsDoubleGrippable = true;
    this.m.AddGenericSkill = true;
    this.m.ShowQuiver = false;
    this.m.ShowArmamentIcon = true;
    this.m.ArmamentIcon = “icon_knife_01”;
    this.m.Value = 30;
    this.m.Condition = 32.00000000;
    this.m.ConditionMax = 32.00000000;
    this.m.RegularDamage = 15;
    this.m.RegularDamageMax = 25;
    this.m.ArmorDamageMult = 0.50000000;
    this.m.DirectDamageMult = 0.20000000;
    }

    function onEquip()
    {
    this.weapon.onEquip();
    this.addSkill(this.new(“scripts/skills/actives/stab”));
    this.addSkill(this.new(“scripts/skills/actives/puncture”));
    }

    function onUpdateProperties( _properties )
    {
    this.weapon.onUpdateProperties(_properties);
    }

    });
    [/code]

    I peeked at a bunch of other files, too. Interesting stuff there. It’s possible to figure out the most efficient backgrounds to hire now since you can read the stats directly out of the scripts…

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.