From 9f1c3b3e7719b50fd21953851be8a20841b6feb5 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Sat, 4 Feb 2023 13:44:57 -0800 Subject: [PATCH] Fix properties with getter/setters --- Decompiler/PscCoder.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Decompiler/PscCoder.cpp b/Decompiler/PscCoder.cpp index 8ad8165..4dfb9b2 100644 --- a/Decompiler/PscCoder.cpp +++ b/Decompiler/PscCoder.cpp @@ -177,18 +177,18 @@ void Decompiler::PscCoder::writeObject(const Pex::Object &object, const Pex::Bin writeStructs(object, pex); } - if (object.getProperties().size()) { - write(""); - write(";-- Properties --------------------------------------"); - writeProperties(object, pex); - } - if (object.getVariables().size()) { write(""); write(";-- Variables ---------------------------------------"); writeVariables(object, pex); } + if (object.getProperties().size()) { + write(""); + write(";-- Properties --------------------------------------"); + writeProperties(object, pex); + } + writeStates(object, pex); } @@ -339,7 +339,8 @@ void Decompiler::PscCoder::writeProperty(int i, const Pex::Property& prop, const !prop.isWritable() && prop.getReadFunction().getInstructions().size() == 1 && prop.getReadFunction().getInstructions()[0].getOpCode() == Pex::OpCode::RETURN && - prop.getReadFunction().getInstructions()[0].getArgs().size() == 1; + prop.getReadFunction().getInstructions()[0].getArgs().size() == 1 && + prop.getReadFunction().getInstructions()[0].getArgs()[0].getType() != Pex::ValueType::Identifier; stream << mapType(prop.getTypeName().asString()) << " Property " << prop.getName().asString(); if (prop.hasAutoVar()) { auto var = object.getVariables().findByName(prop.getAutoVarName());