peace-maker / lysis-java

Lysis - SourceMod .smx and AMXModX .amxx decompiler
111 stars 39 forks source link

missing string assignment statements in decompilation result #10

Closed devilesk closed 5 years ago

devilesk commented 5 years ago

small test example:

#pragma semicolon 1;

#include <sourcemod>

new String:g_str[64];

public OnPluginStart()
{
    decl String:str[64];
    str = "test";
    g_str = str;
}

I don't see an equivalent g_str = str; statement in the decompilation

decompilation result:

 public PlVers:__version =
{
    version = 5,
    filevers = "1.8.0-manual",
    date = "07/17/2019",
    time = "22:09:37"
};
new Float:NULL_VECTOR[3];
new String:NULL_STRING[4];
public Extension:__ext_core =
{
    name = "Core",
    file = "core",
    autoload = 0,
    required = 0,
};
new MaxClients;
new String:g_str[64];
public void:__ext_core_SetNTVOptional()
{
    MarkNativeAsOptional("GetFeatureStatus");
    MarkNativeAsOptional("RequireFeature");
    MarkNativeAsOptional("AddCommandListener");
    MarkNativeAsOptional("RemoveCommandListener");
    MarkNativeAsOptional("BfWriteBool");
    MarkNativeAsOptional("BfWriteByte");
    MarkNativeAsOptional("BfWriteChar");
    MarkNativeAsOptional("BfWriteShort");
    MarkNativeAsOptional("BfWriteWord");
    MarkNativeAsOptional("BfWriteNum");
    MarkNativeAsOptional("BfWriteFloat");
    MarkNativeAsOptional("BfWriteString");
    MarkNativeAsOptional("BfWriteEntity");
    MarkNativeAsOptional("BfWriteAngle");
    MarkNativeAsOptional("BfWriteCoord");
    MarkNativeAsOptional("BfWriteVecCoord");
    MarkNativeAsOptional("BfWriteVecNormal");
    MarkNativeAsOptional("BfWriteAngles");
    MarkNativeAsOptional("BfReadBool");
    MarkNativeAsOptional("BfReadByte");
    MarkNativeAsOptional("BfReadChar");
    MarkNativeAsOptional("BfReadShort");
    MarkNativeAsOptional("BfReadWord");
    MarkNativeAsOptional("BfReadNum");
    MarkNativeAsOptional("BfReadFloat");
    MarkNativeAsOptional("BfReadString");
    MarkNativeAsOptional("BfReadEntity");
    MarkNativeAsOptional("BfReadAngle");
    MarkNativeAsOptional("BfReadCoord");
    MarkNativeAsOptional("BfReadVecCoord");
    MarkNativeAsOptional("BfReadVecNormal");
    MarkNativeAsOptional("BfReadAngles");
    MarkNativeAsOptional("BfGetNumBytesLeft");
    MarkNativeAsOptional("BfWrite.WriteBool");
    MarkNativeAsOptional("BfWrite.WriteByte");
    MarkNativeAsOptional("BfWrite.WriteChar");
    MarkNativeAsOptional("BfWrite.WriteShort");
    MarkNativeAsOptional("BfWrite.WriteWord");
    MarkNativeAsOptional("BfWrite.WriteNum");
    MarkNativeAsOptional("BfWrite.WriteFloat");
    MarkNativeAsOptional("BfWrite.WriteString");
    MarkNativeAsOptional("BfWrite.WriteEntity");
    MarkNativeAsOptional("BfWrite.WriteAngle");
    MarkNativeAsOptional("BfWrite.WriteCoord");
    MarkNativeAsOptional("BfWrite.WriteVecCoord");
    MarkNativeAsOptional("BfWrite.WriteVecNormal");
    MarkNativeAsOptional("BfWrite.WriteAngles");
    MarkNativeAsOptional("BfRead.ReadBool");
    MarkNativeAsOptional("BfRead.ReadByte");
    MarkNativeAsOptional("BfRead.ReadChar");
    MarkNativeAsOptional("BfRead.ReadShort");
    MarkNativeAsOptional("BfRead.ReadWord");
    MarkNativeAsOptional("BfRead.ReadNum");
    MarkNativeAsOptional("BfRead.ReadFloat");
    MarkNativeAsOptional("BfRead.ReadString");
    MarkNativeAsOptional("BfRead.ReadEntity");
    MarkNativeAsOptional("BfRead.ReadAngle");
    MarkNativeAsOptional("BfRead.ReadCoord");
    MarkNativeAsOptional("BfRead.ReadVecCoord");
    MarkNativeAsOptional("BfRead.ReadVecNormal");
    MarkNativeAsOptional("BfRead.ReadAngles");
    MarkNativeAsOptional("BfRead.GetNumBytesLeft");
    MarkNativeAsOptional("PbReadInt");
    MarkNativeAsOptional("PbReadFloat");
    MarkNativeAsOptional("PbReadBool");
    MarkNativeAsOptional("PbReadString");
    MarkNativeAsOptional("PbReadColor");
    MarkNativeAsOptional("PbReadAngle");
    MarkNativeAsOptional("PbReadVector");
    MarkNativeAsOptional("PbReadVector2D");
    MarkNativeAsOptional("PbGetRepeatedFieldCount");
    MarkNativeAsOptional("PbSetInt");
    MarkNativeAsOptional("PbSetFloat");
    MarkNativeAsOptional("PbSetBool");
    MarkNativeAsOptional("PbSetString");
    MarkNativeAsOptional("PbSetColor");
    MarkNativeAsOptional("PbSetAngle");
    MarkNativeAsOptional("PbSetVector");
    MarkNativeAsOptional("PbSetVector2D");
    MarkNativeAsOptional("PbAddInt");
    MarkNativeAsOptional("PbAddFloat");
    MarkNativeAsOptional("PbAddBool");
    MarkNativeAsOptional("PbAddString");
    MarkNativeAsOptional("PbAddColor");
    MarkNativeAsOptional("PbAddAngle");
    MarkNativeAsOptional("PbAddVector");
    MarkNativeAsOptional("PbAddVector2D");
    MarkNativeAsOptional("PbRemoveRepeatedFieldValue");
    MarkNativeAsOptional("PbReadMessage");
    MarkNativeAsOptional("PbReadRepeatedMessage");
    MarkNativeAsOptional("PbAddMessage");
    MarkNativeAsOptional("Protobuf.ReadInt");
    MarkNativeAsOptional("Protobuf.ReadFloat");
    MarkNativeAsOptional("Protobuf.ReadBool");
    MarkNativeAsOptional("Protobuf.ReadString");
    MarkNativeAsOptional("Protobuf.ReadColor");
    MarkNativeAsOptional("Protobuf.ReadAngle");
    MarkNativeAsOptional("Protobuf.ReadVector");
    MarkNativeAsOptional("Protobuf.ReadVector2D");
    MarkNativeAsOptional("Protobuf.GetRepeatedFieldCount");
    MarkNativeAsOptional("Protobuf.SetInt");
    MarkNativeAsOptional("Protobuf.SetFloat");
    MarkNativeAsOptional("Protobuf.SetBool");
    MarkNativeAsOptional("Protobuf.SetString");
    MarkNativeAsOptional("Protobuf.SetColor");
    MarkNativeAsOptional("Protobuf.SetAngle");
    MarkNativeAsOptional("Protobuf.SetVector");
    MarkNativeAsOptional("Protobuf.SetVector2D");
    MarkNativeAsOptional("Protobuf.AddInt");
    MarkNativeAsOptional("Protobuf.AddFloat");
    MarkNativeAsOptional("Protobuf.AddBool");
    MarkNativeAsOptional("Protobuf.AddString");
    MarkNativeAsOptional("Protobuf.AddColor");
    MarkNativeAsOptional("Protobuf.AddAngle");
    MarkNativeAsOptional("Protobuf.AddVector");
    MarkNativeAsOptional("Protobuf.AddVector2D");
    MarkNativeAsOptional("Protobuf.RemoveRepeatedFieldValue");
    MarkNativeAsOptional("Protobuf.ReadMessage");
    MarkNativeAsOptional("Protobuf.ReadRepeatedMessage");
    MarkNativeAsOptional("Protobuf.AddMessage");
    VerifyCoreVersion();
    return void:0;
}

public void:OnPluginStart()
{
    new String:str[64] = "test";
    return void:0;
}
peace-maker commented 5 years ago

Thanks, that's fixed now. Your example decompiles to

public void:OnPluginStart()
{
    new String:str[64] = "test";
    g_str = str;
    return void:0;
}