ActionScript AVM2 avm2.intrinsics.memory package missing functions

545 Views Asked by At

I have a swf file and I decompiled it. And I get fla and as files , I am trying to run this files but I get these errors

1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method si32.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method li8.
1180: Call to a possibly undefined method si8.

and these functions must be in avm2.intrinsics.memory this package but doesnt exist I tried to change SDK versions AIR 3.5 , 3.6 which this package comes with , 3.7 and some others but not of them as these functions. What is the problem

1

There are 1 best solutions below

0
hoonoh On

Check if you are using ASC2.0 compiler.

Fast memory opcode is a part of ASC2.0 compiler and is not a part of the AIR SDK. Depending on which IDE you are using, avm2.intrinsics.memory opcode methods might show unresolved error on the code editor, but it will build fine with ASC2.0 compiler.

The following code is tested with AIR SDK 27 in intelliJ IDEA.

package {

import flash.display.Sprite;

import avm2.intrinsics.memory.sf64;
import avm2.intrinsics.memory.lf64;

import flash.system.ApplicationDomain;
import flash.utils.ByteArray;
import flash.utils.Endian;

public class FastMemTest extends Sprite {
  public function FastMemTest() {
    var ba:ByteArray = new ByteArray();
    ba.length = ApplicationDomain.MIN_DOMAIN_MEMORY_LENGTH;
    ba.endian = Endian.LITTLE_ENDIAN;
    ApplicationDomain.currentDomain.domainMemory = ba;

    const addr:int = 0xf0;
    const value:int = 1234;
    sf64(1234, value);
    trace(value.toString(16), ':', lf64(value));
  }
}
}

trace output:

"C:\Program Files\JetBrains\IntelliJ IDEA 2017.2.1\jre64\bin\java.exe" "-Dapplication.home=C:\FlexSDK\AIRSDK_Compiler_27.0.0.132" -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Duser.language=en -Duser.region=en -Xmx512m -classpath "C:/FlexSDK/AIRSDK_Compiler_27.0.0.132/lib/legacy/fdb.jar" flex.tools.debugger.cli.DebugCLI
Adobe fdb (Flash Player Debugger) [build development]
Copyright (c) 2004-2007 Adobe, Inc. All rights reserved.
Waiting for Player to connect
"C:\FlexSDK\AIRSDK_Compiler_27.0.0.132\bin\adl.exe" -profile extendedDesktop C:\test\Stage3DTest-app.xml C:\test
Player connected; session starting.

[trace] f0 : 1234