Raised This Month: $32 Target: $400
 8% 

Lysis: An experimental .smx decompiler


Post New Thread Reply   
 
Thread Tools Display Modes
Vaxa
Member
Join Date: Nov 2014
Old 06-13-2015 , 07:57   Re: Lysis: An experimental .smx decompiler
Reply With Quote #191

hello! Please decompile this plugin
Vaxa is offline
Vaxa
Member
Join Date: Nov 2014
Old 06-13-2015 , 07:57   Re: Lysis: An experimental .smx decompiler
Reply With Quote #192

Quote:
Originally Posted by Vaxa View Post
hello! Please decompile this plugin
Attached Files
File Type: smx antiaim_pro.smx (10.4 KB, 170 views)
Vaxa is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-14-2015 , 06:54   Re: Lysis: An experimental .smx decompiler
Reply With Quote #193

Quote:
Originally Posted by Vaxa View Post
hello! Please decompile this plugin
Lots of anti-lysis code in this one, so I just hacked away at it until it was able to decompile the real code.
Attached Files
File Type: txt antiaim_pro.smx.txt (17.4 KB, 238 views)
__________________
GoD-Tony is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 06-14-2015 , 16:01   Re: Lysis: An experimental .smx decompiler
Reply With Quote #194

Quote:
Originally Posted by GoD-Tony View Post
Lots of anti-lysis code in this one, so I just hacked away at it until it was able to decompile the real code.
Curious, can you explain how you did that? Having dropped it in the java version and used your online version, it simple got stuck after 2kb's of data. I got to about line 87.
Maxximou5 is offline
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 06-15-2015 , 10:23   Re: Lysis: An experimental .smx decompiler
Reply With Quote #195

Quote:
Originally Posted by Maxximou5 View Post
Curious, can you explain how you did that? Having dropped it in the java version and used your online version, it simple got stuck after 2kb's of data. I got to about line 87.
I ran it in Eclipse in debug mode to view the stack when it gets stuck, then added exceptions to skip over code for this specific plugin. Edit: I've updated the web version to include a few of these "workarounds".
__________________

Last edited by GoD-Tony; 06-15-2015 at 12:26.
GoD-Tony is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 06-15-2015 , 16:02   Re: Lysis: An experimental .smx decompiler
Reply With Quote #196

Quote:
Originally Posted by GoD-Tony View Post
I ran it in Eclipse in debug mode to view the stack when it gets stuck, then added exceptions to skip over code for this specific plugin. Edit: I've updated the web version to include a few of these "workarounds".
Nice! Thanks for explaining, I'll keep that in mind for the future. attack!
Maxximou5 is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 06-29-2015 , 05:18   Re: Lysis: An experimental .smx decompiler
Reply With Quote #197

Hello I'l try decompile a plugin but i get this error:
Quote:
Welcome to Lysis Decompiler.

Decompiling G:\Lysis\current.smx.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
ex out of range: 843331992
at java.lang.String.checkBounds(Unknown Source)
at java.lang.String.<init>(Unknown Source)
at lysis.sourcepawn.SourcePawnFile.ReadString(So urcePawnFile.java:106)
at lysis.sourcepawn.SourcePawnFile.stringFromDat a(SourcePawnFile.java:72
1)
at lysis.builder.SourceBuilder.dumpStringArray(S ourceBuilder.java:976)
at lysis.builder.SourceBuilder.dumpStringArray(S ourceBuilder.java:98
at lysis.builder.SourceBuilder.writeGlobal(Sourc eBuilder.java:119
at lysis.builder.SourceBuilder.writeGlobals(Sour ceBuilder.java:1244)
at lysis.Lysis.main(Lysis.java:143)
Appuyez sur une touche pour continuer...
Thanks
Attached Files
File Type: smx current.smx (6.1 KB, 183 views)
eric0279 is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 06-29-2015 , 06:05   Re: Lysis: An experimental .smx decompiler
Reply With Quote #198

Quote:
Originally Posted by eric0279 View Post
Hello I'l try decompile a plugin but i get this error:
Thanks
Works fine on the website decompiler.
Spoiler
Maxximou5 is offline
eric0279
AlliedModders Donor
Join Date: May 2007
Old 06-29-2015 , 06:53   Re: Lysis: An experimental .smx decompiler
Reply With Quote #199

Chrome: https://support.google.com/chrome/answer/6213033

Firefox: Lysis failed to load. Is Java installed? edit: ok fix security enabled, work fine

Thanks, you have same error ^^:
Quote:
/* Error writing globals: java.lang.StringIndexOutOfBoundsException: String index out of range: 843331992 */

Last edited by eric0279; 06-29-2015 at 06:58.
eric0279 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 06-29-2015 , 11:13   Re: Lysis: An experimental .smx decompiler
Reply With Quote #200

Quote:
Originally Posted by eric0279 View Post
Hello I'l try decompile a plugin but i get this error:


Thanks
That's fixed now, but there seems to be more stuff going wrong with unused global variables. Could you send me the real sourcecode of that plugin?

Code:
public PlVers:__version =
{
    version = 5,
    filevers = "1.6.0-dev+4177",
    date = "08/17/2014",
    time = "17:00:43"
};
new Float:NULL_VECTOR[3];
new String:NULL_STRING[4];
public Extension:__ext_core =
{
    name = "Core",
    file = "core",
    autoload = 0,
    required = 0,
};
new MaxClients;
public Extension:__ext_sdktools =
{
    name = "SDKTools",
    file = "sdktools.ext",
    autoload = 1,
    required = 1,
};
new String:L4D2_InfectedNames[8][32];
new String:L4D2_InfectedTimerEntities[8][0];
new String:L4D2_InfectedVictimNetprops[8][0];
new String:MeleeWeaponModels[15][0];
new String:MeleeWeaponNames[15][0];
new String:SurvivorModels[8][0];
new String:SurvivorNames[8][0];
new String:WeaponModels[56][0];
new String:WeaponNames[56][0];
new WeaponSlots[56] =
{
    0, 0, 0, 0, 843330636, 1920291616, 1870031222, 1917853810, 1701996399, 29555, 1634623811, 1867669860, 1444949112, 1919906665, 0, 1852404304, 1970479220, 1986623090, 1881174639, 1919381362, 544437093, 1713401449, 544698220, 1668441456, 1937010277, 32, 774909490, 49, 1886680168, 791624307, 1752459623, 1663984245, 1093627247, 1851880564, 1917857647, 1685015919, 0, 1356, 1400, 1380, 1444, 1452, 1936876918, 1650422645, 1601401711, 1717990754, 29285, 1600402540, 1651469415, 1885301857, 1701016165, 29806, 49, 1886611780, 544825708, 1936944994
};
new Handle:hCvarPrintToEveryone;
new Handle:hMeleeWeaponModelsTrie;
new Handle:hMeleeWeaponNamesTrie;
new Handle:hSurvivorModelsTrie;
new Handle:hWeaponNamesTrie;
new Handle:survivor_limit;
new Handle:z_max_player_zombies;
new Handle:g_hVsBossBuffer;
public Plugin:myinfo =
{
    name = "L4D2 Survivor Progress",
    description = "Print survivor progress in flow percents ",
    author = "CanadaRox, Visor",
    version = "2.0.1",
    url = "https://github.com/Attano/ProMod"
};
public __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("PbReadInt");
    MarkNativeAsOptional("PbReadFloat");
    MarkNativeAsOptional("PbReadBool");
    MarkNativeAsOptional("PbReadString");
    MarkNativeAsOptional("PbReadColor");
    MarkNativeAsOptional("PbReadAngle");
    MarkNativeAsOptional("PbReadVector");
    MarkNativeAsOptional("PbReadVector2D");
    MarkNativeAsOptional("PbGetRepeatedFieldCount");
    MarkNativeAsOptional("PbReadRepeatedInt");
    MarkNativeAsOptional("PbReadRepeatedFloat");
    MarkNativeAsOptional("PbReadRepeatedBool");
    MarkNativeAsOptional("PbReadRepeatedString");
    MarkNativeAsOptional("PbReadRepeatedColor");
    MarkNativeAsOptional("PbReadRepeatedAngle");
    MarkNativeAsOptional("PbReadRepeatedVector");
    MarkNativeAsOptional("PbReadRepeatedVector2D");
    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("PbReadMessage");
    MarkNativeAsOptional("PbReadRepeatedMessage");
    MarkNativeAsOptional("PbAddMessage");
    VerifyCoreVersion();
    return 0;
}

Float:operator*(Float:,_:)(Float:oper1, oper2)
{
    return oper1 * float(oper2);
}

Float:operator+(Float:,_:)(Float:oper1, oper2)
{
    return oper1 + float(oper2);
}

bool:operator>(Float:,Float:)(Float:oper1, Float:oper2)
{
    return FloatCompare(oper1, oper2) > 0;
}

Handle:L4D2Direct_GetGameConf()
{
    static Handle:g_hGameConf_l4d2dir;
    if (!g_hGameConf_l4d2dir)
    {
        g_hGameConf_l4d2dir = LoadGameConfigFile("l4d2_direct");
    }
    return g_hGameConf_l4d2dir;
}

Address:L4D2Direct_GetTerrorNavMesh()
{
    static Address:TheNavMesh;
    if (!TheNavMesh)
    {
        TheNavMesh = GameConfGetAddress(L4D2Direct_GetGameConf(), "TerrorNavMesh");
    }
    return TheNavMesh;
}

Address:L4D2Direct_GetMapMaxFlowDistanceAddr()
{
    static Address:pMapMaxFlowDistance;
    if (!pMapMaxFlowDistance)
    {
        new offs = GameConfGetOffset(L4D2Direct_GetGameConf(), "TerrorNavMesh::m_fMapMaxFlowDistance");
        if (offs == -1)
        {
            return Address:0;
        }
        pMapMaxFlowDistance = L4D2Direct_GetTerrorNavMesh() + offs;
    }
    return pMapMaxFlowDistance;
}

Float:L4D2Direct_GetMapMaxFlowDistance()
{
    return LoadFromAddress(L4D2Direct_GetMapMaxFlowDistanceAddr(), NumberType:2);
}

Address:L4D2Direct_GetTerrorNavArea(Float:pos[3], Float:beneathLimit)
{
    static Handle:GetNavAreaSDKCall;
    if (!GetNavAreaSDKCall)
    {
        StartPrepSDKCall(SDKCallType:5);
        if (!PrepSDKCall_SetFromConf(L4D2Direct_GetGameConf(), SDKFuncConfSource:1, "CNavMesh::GetNavArea"))
        {
            return Address:0;
        }
        PrepSDKCall_AddParameter(SDKType:2, SDKPassMethod:3, 0, 0);
        PrepSDKCall_AddParameter(SDKType:5, SDKPassMethod:1, 0, 0);
        PrepSDKCall_SetReturnInfo(SDKType:4, SDKPassMethod:1, 0, 0);
        GetNavAreaSDKCall = EndPrepSDKCall();
        if (GetNavAreaSDKCall)
        {
        }
        else
        {
            return Address:0;
        }
    }
    return SDKCall(GetNavAreaSDKCall, L4D2Direct_GetTerrorNavMesh(), pos, beneathLimit);
}

Float:L4D2Direct_GetTerrorNavAreaFlow(Address:pTerrorNavArea)
{
    if (pTerrorNavArea)
    {
        new offs = GameConfGetOffset(L4D2Direct_GetGameConf(), "TerrorNavArea::m_flow");
        if (offs == -1)
        {
            return 0.0;
        }
        return LoadFromAddress(offs + pTerrorNavArea, NumberType:2);
    }
    return 0.0;
}

public OnPluginStart()
{
    g_hVsBossBuffer = FindConVar("versus_boss_buffer");
    L4D2_InfectedNames[0] = CreateConVar("l4d_global_percent", "1", "Display boss percentages to entire team when using commands", 262144, false, 0.0, false, 0.0);
    RegConsoleCmd("sm_cur", CurrentCmd, "", 0);
    RegConsoleCmd("sm_current", CurrentCmd, "", 0);
    survivor_limit = FindConVar("survivor_limit");
    z_max_player_zombies = FindConVar("z_max_player_zombies");
    return 0;
}

public Action:CurrentCmd(client, args)
{
    new L4D2_Team:team = GetClientTeam(client);
    if (team == L4D2_Team:1)
    {
        PrintCurrentToClient(client);
    }
    else
    {
        if (GetConVarBool(L4D2_InfectedNames[0]))
        {
            PrintCurrentToTeam(team);
        }
        PrintCurrentToClient(client);
    }
    return Action:0;
}

PrintCurrentToClient(client)
{
    new boss_proximity = RoundToNearest(GetBossProximity() * 100.0);
    PrintToChat(client, "\x01Current: \x04%d%%", boss_proximity);
    return 0;
}

PrintCurrentToTeam(L4D2_Team:team)
{
    new members_found;
    new team_max = GetTeamMaxHumans(team);
    new boss_proximity = RoundToNearest(GetBossProximity() * 100.0);
    new client = 1;
    while (client <= MaxClients && members_found < team_max)
    {
        new var2;
        if (IsClientInGame(client) && !IsFakeClient(client) && team == GetClientTeam(client))
        {
            members_found++;
            PrintToChat(client, "\x01Current: \x04%d%%", boss_proximity);
        }
        client++;
    }
    return 0;
}

Float:GetBossProximity()
{
    new Float:proximity = GetMaxSurvivorCompletion() + GetConVarFloat(g_hVsBossBuffer) / L4D2Direct_GetMapMaxFlowDistance();
    new var1;
    if (proximity > 1.0)
    {
        var1 = 1.0;
    }
    else
    {
        var1 = proximity;
    }
    return var1;
}

Float:GetMaxSurvivorCompletion()
{
    new Float:flow = 0.0;
    decl Float:tmp_flow;
    decl Float:origin[3];
    decl Address:pNavArea;
    new client = 1;
    while (client <= MaxClients)
    {
        new var1;
        if (IsClientInGame(client) && GetClientTeam(client) == 2)
        {
            GetClientAbsOrigin(client, origin);
            pNavArea = L4D2Direct_GetTerrorNavArea(origin, 120.0);
            if (pNavArea)
            {
                tmp_flow = L4D2Direct_GetTerrorNavAreaFlow(pNavArea);
                new var2;
                if (flow > tmp_flow)
                {
                    var2 = flow;
                }
                else
                {
                    var2 = tmp_flow;
                }
                flow = var2;
            }
        }
        client++;
    }
    return flow / L4D2Direct_GetMapMaxFlowDistance();
}

GetTeamMaxHumans(L4D2_Team:team)
{
    if (team == L4D2_Team:2)
    {
        return GetConVarInt(survivor_limit);
    }
    if (team == L4D2_Team:3)
    {
        return GetConVarInt(z_max_player_zombies);
    }
    return MaxClients;
}
__________________
Peace-Maker is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode