AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Code Snippets/Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=83)
-   -   [TOOL] AMXX UnCompress 1.0 (https://forums.alliedmods.net/showthread.php?t=250748)

wiDD. 10-29-2014 22:26

[TOOL] AMXX UnCompress 1.0
 
2 Attachment(s)
[TOOL] AMXX UnCompress 1.0
(Edit compilated plugins in .amxx)

Description:

This is a program to uncompress an .amxx and show the raw generated in the compilation of the plugin. Also it's possible return compile the raw, in addition to change the code used in the file .memory

Info:

When a script (.sma) is compiled it is generated all necesary information for run in the virtual machine of pawn, if it's qualified also it is generated the information for the depuration (debug). When the compilation it finishes it compresses and packs in a file .amxx.

http://2-ps.googleusercontent.com/h/...ges/bhG8gn.png

amxx file header: Have the information of the file composition
amxx header: Have the information about the plugin.
debug header: Have the information about the depuration.

Use:

Basic:
Drag the .amxx into the .exe, in seconds the program generate two files, one .raw and the other .memory with the same name of the .amxx.

File .RAW:

Have all information of the compilation without compressing, it's possible edit some things with a hexadecimal editor.

File .MEMORY:

This is a file that the AMXX UnCompress use for do modifications in the plugin. In this it define directions of memory to modificate, already be dates(data) or codes(code). The most easy it's use for modificate a string, since the directions of the memory there are auto generated and the value it's a string and not a hexadecimal.

Format:
Type: Address = Value

Type: code or data

Address: Direction of the memory in hexadecimal format 0x00000000
Value: A string between "" only for a tipe data or values hexadecimals without [ ] separateds for a space. The hexadecimal value is 4bytes, it is to say up to 8 characters.
Comment line: Use ; for coment a line.

(To replace a string)
data:address="string"
ex.:
data:0x00000008="hi"

(To replace a string and force writing exceeding the lenght)
data:address="string"f
ex.:
data:0x000000A1="hi wooorld"f

(Edit date)
data:address=[hex value]
ex.:
data:0x00000050=[ff 23CEFF f0ff00a AAEFD01 33]

(Edit code)
code:address=[hex value]
ex.:
code:0x0000012F=[ff 33 C000E]

Example of .memory file auto generated:
Code:

;data:0x00000000="Message 1"
;data:0x00000028="Hacked :P"
;data:0x00000050="Final"
;data:0x00000068="Test amxx uncompress"
;data:0x000000C4="1.0"
;data:0x000000D4="Destro"
;data:0x000000F0="%s"
;data:0x000000FC="test
;data:0x00000118="svcmd_test"
;data:0x00000154="string:[%s] static:[%d]"

Replace String:

Basic:

Using an example the .memory file of above.

We open it with any text editor and modify.

Code:

data:0x00000000="changed"
data:0x00000068="Title of the plugin"

Save it.
Drag the .raw file to .exe and we compresses the .raw with the modifications about .memory in a new .amxx.

Plugin used
PHP Code:

#include <amxmodx>

#define PLUGIN "Test amxx uncompress"
#define VERSION "1.0"
#define AUTHOR "Destro"

new const string[] = "Message 1"
new const string2[] = "Hacked :P"
new const string3[] = "Final"
const const_value 2

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
server_print("%s"string)
    
    new 
value 1
    
    
if(value == const_value)
    {
        
server_print(string2)
        return
    }
    
    
funtion_print2()
    
    
register_srvcmd("test""svcmd_test")
}

public 
svcmd_test()
{
    
funtion_print()
}

funtion_print()
{
    static 
value
    
    value
++
    
    
server_print("string:[%s] static:[%d]"stringvalue)
}

funtion_print2()
{
    
server_print(string3)


Protect Plugin:

To avoid that your plugin was descompresed with this program, add this string "no_amxx_uncompress" in any part of your plugin.

Example:

PHP Code:

server_print("no_amxx_uncompress"

All credits: Destro

Kia 10-30-2014 02:45

Re: [TOOL] AMXX UnCompress 1.0
 
How does your "protection" work? I mean, since you provide the source code, I could remove the function that disallows decompiling when a plugin has that line, or not?

Destro- 10-30-2014 11:57

Re: [TOOL] AMXX UnCompress 1.0
 
Yes, is anti noobs, really can't protect.

HamletEagle 10-30-2014 12:16

Re: [TOOL] AMXX UnCompress 1.0
 
Quote:

Originally Posted by Kia (Post 2217719)
How does your "protection" work? I mean, since you provide the source code, I could remove the function that disallows decompiling when a plugin has that line, or not?

The protection is for his version I think, if you remove it, this is. It's a good thing that he provided the source.

meTaLiCroSS 10-30-2014 15:33

Re: [TOOL] AMXX UnCompress 1.0
 
This was done thinking on private .amxx file distributions. Changing a few values would make something better and you would be able to delete a plugin protection easily.

joropito 10-31-2014 19:31

Re: [TOOL] AMXX UnCompress 1.0
 
There's already an amxx dissasembler on this forums.
I've already done this same tool but to use under linux command line :)
Also I have a tool to repack the whole thing

fysiks 10-31-2014 23:28

Re: [TOOL] AMXX UnCompress 1.0
 
Quote:

Originally Posted by joropito (Post 2218584)
There's already an amxx dissasembler on this forums.
I've already done this same tool but to use under linux command line :)
Also I have a tool to repack the whole thing

Do share.

KORD_12.7 11-02-2014 01:30

Re: [TOOL] AMXX UnCompress 1.0
 
Quote:

Originally Posted by fysiks (Post 2218638)
Do share.

+1

milutinke 02-05-2015 16:34

Re: [TOOL] AMXX UnCompress 1.0
 
Hello, I have used this tool when it was published and it have worked like chum, but today when I tried to use it showed me the error :P
ERROR code: 3minAPress

Freezo Begin 02-05-2015 22:57

Re: [TOOL] AMXX UnCompress 1.0
 
Lool the same thing !


All times are GMT -4. The time now is 11:41.

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