Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Building libil2cpp source

Discussion in 'Editor & General Support' started by leksowo, Jun 20, 2023.

  1. leksowo

    leksowo

    Joined:
    Oct 24, 2021
    Posts:
    7
    Hello, I’ve tried and still trying to re build the libil2cpp source, because I’ve made modification to it so I’ve took it and made a new static library project in Xcode, because I’m mainly doing that to change the pre build one that come with Xcode project of your unity build to include my modification, but I’m getting some errors, all errors are because of il2cpp-runtime-stats.h including atomic.
     

    Attached Files:

    Last edited: Jun 20, 2023
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    Unity's outputted IL2CPP source isn't really intended for modification.

    I'm actually not even sure it legally CAN be modified within the letter of the Unity license, but we'll leave that for now.

    Like any software, the source CAN be modified but you would need to preserve 100% of the assumptions and settings going into it, such as anything twiddled or tweaked in the XCode project, include directories, etc.

    If you're getting an XCode error, that's quite outside of this forum. You may wish to start with the Apple developer forum?
     
  3. leksowo

    leksowo

    Joined:
    Oct 24, 2021
    Posts:
    7
    Thanks for the reply that what I also did but i thought more unity forum could have helped me as its a problem straight from source libil2cpp.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    There is no normal reason to touch IL2CPP generated code for the simple reason that it is transient and transitory and machine-generated and far too horrible to even consider thinking about.

    Code (csharp):
    1. __this->____size_2 = ((int32_t)il2cpp_codegen_add(L_5, 1));
    Ugh! Head explode.
     
  5. leksowo

    leksowo

    Joined:
    Oct 24, 2021
    Posts:
    7
    I was talking about libil2cpp source in Editor files : Editor/Data/il2cpp/libil2cpp/
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    I guess I have absolutely no idea what you are speaking of.

    What does the documentation say about it all?
     
  7. leksowo

    leksowo

    Joined:
    Oct 24, 2021
    Posts:
    7
    Nothing that the thing my only problem is with iOS build because they use a prebuild static library that contain all the source so my modification isn’t included but for android , windows etc.. it’s all fine and my game run perfectly i mainly edited libil2cpp to fight against cheating but also for some optimization of memory leak. i don’t even understand why atomic header is giving error since it’s part of iOS sdk but yes i will continue to search around because else i cannot release my game.
     
  8. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,563
    I wish you said this was for cheat prevention, I never would have wasted time replying.

    If you're concerned about the user 'hacking your save files,' or 'cheating in your game,' which is playing on their computer, just don't be.

    There's nothing you can do about it. Nothing is secure, it is not your computer, it is the user's computer.

    If it must be secure, store it on your own server and have the user connect to download it.

    Anything else is a waste of your time and the only person you're going to inconvenience is yourself when you're debugging the game and you have savegame errors. Work on your game instead.

    Remember, it only takes one 12-year-old in Finland to write a script to read/write your game files and everybody else can now use that script. Read about Cheat Engine to see more ways you cannot possibly control this.

    Good luck! I'll be working on my game. :)
     
  9. leksowo

    leksowo

    Joined:
    Oct 24, 2021
    Posts:
    7
    I understand that could be your point of view but if i can avoid even 5% of more cheating in my game then this is the way I will take. Thank you for the replay anyways.