Giter Site home page Giter Site logo

il2cppsdkgenerator's Introduction

Il2CppSDKGenerator

An Il2Cpp SDK generator for Android (And probably IOS)

How to use

  1. Compile Il2CppSDK generator (or use release version)
  2. Get your DummyDll from using Il2CppDumper
  3. Drag the whole folder of DummyDll to Il2CppSDK.exe
  4. Wait for your SDK to be generated
  5. Copy the result to your project
  6. Copy precoded Il2Cpp Headers to your project (And include it to your Android.mk or CMakeList.txt)

Done!

How to use the SDK

You can include an namespace header to compile whole classes within a namespace or just compile a single class, for example take a look at SDK result.

Please read how to Initialize Il2Cpp Functions first before using any of the SDK/Il2Cpp Functions.

Example:

#include "SDK/Assembly-CSharp.dll/GameBase.h"
#include "SDK/Assembly-CSharp.dll/GameEngine.h"

#include "SDK/UnityEngine.dll/Includes/UnityEngine/Component.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/Transform.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/Screen.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/Camera.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/Physics.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/RaycastHit.h"
#include "SDK/UnityEngine.dll/Includes/UnityEngine/Object.h"

using namespace UnityEngine;
using namespace GameBase;
using namespace GameEngine;

void PrintLocation()
{
  auto baseGame = GamePlay::get_Game<BaseGame *>();
  if (baseGame) {
    auto localPawn = GamePlay::get_LocalPawn<Pawn *>();
    if(localPawn){
      auto pawnTransform = ((Component *)localPawn)->get_transform<Transform *>();
      LOG("Local Pawn: %f %f %f", pawnTransform->get_position().x, pawnTransform->get_position().y, pawnTransform->get_position().z);
      localPawn->m_Health() = 9999.9f;
    }
  }
}

Initiating Il2Cpp Functions

Before you use any Il2Cpp functions, you need to call Attach first.

...
void WaitForAttach()
{
  waitUntilLoaded(); // TODO: create function that loops when libil2cpp.so is not loaded yet.
  if(Il2Cpp::Attach() != 0)
  {
      // Something goes wrong here...
      exit(0);
  }
  // Attached!
  // You can call any Il2Cpp functions now.
}

Changelogs

7 July 2020:

- Added CreateString functions to Il2Cpp Header

Credits

dnlib: dnlib

il2cppsdkgenerator's People

Contributors

aimardcr avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.