NSIS反编译器

Ede*_*den 2 windows-installer nsis

任何熟悉NSIS反编译器的人(google不是:-))

谢谢,E

Nad*_*adu 6

如何访问NSIS安装程序脚本?

好的,那是该帖子的重要主题.

http://netcologne.dl.sourceforge.net/project/nsis/NSIS%202/2.09/nsis-2.09-src.tar.bz2

nsis-2.09-src\Source\exehead\fileform.c
nsis-2.09-src\Source\exehead\fileform.h

#define FH_SIG 0xDEADBEEF

// neato surprise signature that goes in firstheader. :)
#define FH_INT1 0x6C6C754E  // 'Null'
#define FH_INT2 0x74666F73  // 'soft'
#define FH_INT3 0x74736E49  // 'Inst'

typedef struct
{
  int flags; // FH_FLAGS_*
  int siginfo;  // FH_SIG

  int nsinst[3]; // FH_INT1,FH_INT2,FH_INT3

  // these point to the header+sections+entries+stringtable in the datablock
  int length_of_header;

  // this specifies the length of all the data (including the firstheader and CRC)
  int length_of_all_following_data;
} firstheader;
Run Code Online (Sandbox Code Playgroud)

数据样本:

$ ==>  00000000  ....
$+4    DEADBEEF  
$+8    6C6C754E  Null
$+C    74666F73  soft
$+10   74736E49  Inst 
$+14   000268E2            157 922  length_of_header (inside <<Compressed Data>>)
$+18   011947CB         18 433 995  length_of_all_following_data
       <<Compressed Data>>

$+011947CB CRC32
Run Code Online (Sandbox Code Playgroud)

获取"压缩数据"未压缩

那么这些数据写入%temp%,但ShareMode = None和Attributes = DELETE_ON_CLOSE,因此您无法访问它.

Fix:
    Inside 'NSIS Setup.exe'
Replace 
    68 00 01 00 04 with
    68 00 00 00 00
    To avoid that this tempfile get's create with DELETE_ON_CLOSE

Background:

    00402E56  |.  68 00010004   PUSH    4000100                          ; |Attributes = TEMPORARY|DELETE_ON_CLOSE
                  ^^^^^^^^^^^-Patch Target
    00402E5B  |.  6A 02         PUSH    2                                ; |Mode = CREATE_ALWAYS
    00402E5D  |.  53            PUSH    EBX                              ; |pSecurity
    00402E5E  |.  53            PUSH    EBX                              ; |ShareMode
    00402E65  |.  68 000000C0   PUSH    C0000000                         ; |Access = GENERIC_READ|GENERIC_WRITE
    00402E6A  |.  50            PUSH    EAX                              ; |FileName
    00402E6B  |.  FF15 90704000 CALL    [<&KERNEL32.CreateFileA>]        ; \CreateFileA
Run Code Online (Sandbox Code Playgroud)

好的,大的<>未压缩的临时文件如下所示:

00000000   E2 68 02 00 A0 00 00 00  2C 01 00 00 08 00 00 00  2C   âh      ,       ,
Run Code Online (Sandbox Code Playgroud)

E2 68 02 00 - > 000268E2 157 922 length_of_header(内部<>)

只需删除此数据块,并将NSIS脚本作为未压缩的Raw

其余数据是7z将为您提取的数据文件.

更新:获取Universal Extractor

它用

cmdTotal 1.02 (c) 2006/2007 KaKeeware, http://www.kakeeware.com
Run Code Online (Sandbox Code Playgroud)

使用插件: InstExpl.wcx

或多或少成功提取Nullsoft Setup.exe.小心不要太信任提取的文件 - 有些东西已经损坏了.(首选7zip.)然而,该过程的主要内容是 script.bin 这是在3-4示例中我测试的状态良好.:)

好的更新:这是我的NullsoftDecompiler 1.2 alpha的早期版本

目前它仍在大力开发中,但这是它的第一个原始未完成版本.

更新(大约一年后): NullsoftDecompiler 3 在Notepad ++中从nsiDecomp重新编译输出 最后我添加了减压支持.


Cha*_*lts 5

谷歌再次.

NSIS"我可以反编译现有的安装程序"

简答:不.

答案很长:可能有可能使用7Zip或其他解压缩程序,但没有保证,可能需要大量工作才能重建原始脚本.