MCPcopy Create free account
hub / github.com/axhlzy/Il2CppHookScripts / new

Method new

Il2cppHook/_Ufunc.js:11132–11141  ·  view source on GitHub ↗

Allocates a new object of the current class and calls its default constructor.

()

Source from the content-addressed store, hash-verified

11130 }
11131 /** Allocates a new object of the current class and calls its default constructor. */
11132 new() {
11133 const object = this.alloc();
11134 const exceptionArray = Memory.alloc(Process.pointerSize);
11135 Il2Cpp.Api._objectInit(object, exceptionArray);
11136 const exception = exceptionArray.readPointer();
11137 if (!exception.isNull()) {
11138 (0, console_1.raise)(new Il2Cpp.Object(exception).toString());
11139 }
11140 return object;
11141 }
11142 /** Gets the field with the given name. */
11143 tryField(name) {
11144 const handle = Il2Cpp.Api._classGetFieldFromName(this, Memory.allocUtf8String(name));

Callers

nothing calls this directly

Calls 5

allocMethod · 0.95
_objectInitMethod · 0.80
isNullMethod · 0.80
toStringMethod · 0.65
allocMethod · 0.45

Tested by

no test coverage detected