0

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

  • I'll just copy my comment from the similar question: *It seems that the author of the original code took certain measures and applied obfuscation/protection to his work. Obfuscation/protection are measures against decompilers. The code you get is not meant to be read/understood/compiled ever again. Please stop doing what you are doing. Stealing other people work is not a nice thing to do.* – Organis Aug 27 '17 at 23:54
  • It is my file , I just lost the original source – Erman Sinan Turan Aug 28 '17 at 01:21
  • 2
    So, if it **is** your file, what are these methods for then? And how did you build that SWF in the first place if you cannot do it again? – Organis Aug 28 '17 at 01:46
  • @Organis yes, you've asked a good question!! Although, in his defense, it's possible he used it unknowingly (_eg:_ maybe those methods are referenced by the code of some external library he used?). He couldn't answer since he never wrote the library code?... That said, no court in the world accepts _ignorance as a defense_. Also, it makes no sense to ask here _"What is the problem?"_ without even showing code that makes the error. – VC.One Aug 28 '17 at 06:36
  • @ErmanSinanTuran, so you have AIR 3.6 and others? What happens if you make a basic test project that simply imports `avm2.intrinsics.memory` and tries to use those methods? Do you still get errors? Also remember that decompiling is meant to give a code template that helps you to re-write the lost sources. You cannot just re-compile it's output without first recreating as real AS3 code. – VC.One Aug 28 '17 at 06:46
  • @VC.One The thing is, I have over 15 years of experience with Flash technology, almost 10 of them with specifically AS3. Not only I understand how obfuscation and decompilation work, I had created my own obfuscator for AS1/AS2 SWFs, back in 2006 I think. Still, this is first time I learned of this **avm2.intrinsics.memory** thing, so while I grasped the overall concept, I kind of doubt one could just use it mindlessly without actual understanding **what** and **why** he's doing. The technique has quite a narrow usefulness with a handful of conditions to be compiled and run. – Organis Aug 28 '17 at 10:32
  • @Organis Even if I get someone else's code , this is not wrong this is programing and everything is legit here you can't know the purpose behind it. İf you want to help then do it without blaming me , or dont help and dont start a polemic – Erman Sinan Turan Aug 28 '17 at 11:44
  • @VC.One Yeah I have tried this but still there isn't other functions. I dont know why – Erman Sinan Turan Aug 28 '17 at 11:47
  • @ErmanSinanTuran Quote me where I am blaming you, if you please. I do believe in lost sources in general, yet you should be aware what the whole thing looks like, that's exactly why I kindly ask you to cooperate and answer my questions above. – Organis Aug 28 '17 at 12:36
  • @Organis Here is description of functions [link](http://docs.redtamarin.com/0.4.1T111/avm2/intrinsics/memory/package.html) – Erman Sinan Turan Aug 28 '17 at 12:41

1 Answers1

1

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
hoonoh
  • 2,151
  • 1
  • 11
  • 10