Skip to content
⌘ NSIS Forum Archive

Bugreport: WriteRegBin data is not stored in script.bin

4 posts

cw2k#

Bugreport: WriteRegBin data is not stored in script.bin

Well when running
nsis-3.0a2-src\Examples\bigtest.nsi
against my new NSIS-Decompiler I encounter some compiling bug in WriteRegBin
regarding the Line
WriteRegBin HKLM SOFTWARE\NSISTest\BigNSISTest "BinTest_deadbeef01f00dbeef" "DEADBEEF01F00DBEEF"
the data 'DEADBEEF01F00DBEEF' somehow will not find it's way into the compiled script. While the others work data of WriteRegBin just gets a string with length 0 ""

I guess the bug has something to do with the function
Source\build.cpp - add_db_data()
well it's just used 2 times(the other use is somewhat during File() ) so that bug has no great impact. However just thought it's nice to drop ya a note on than. 🙂


;/ #0024 33_ EW_WRITEREG: -7FFFFFFE 0345 0363 - 0378 0004 0004
WriteRegDWORD HKLM SOFTWARE\NSISTest\BigNSISTest DwordTest_0xDEADBEEF 0xdeadbeef

;/ #0025 33_ EW_WRITEREG: -7FFFFFFE 0383 03A1 - 03B2 0004 0004
WriteRegDWORD HKLM SOFTWARE\NSISTest\BigNSISTest DwordTest_123456 123456

;/ #0026 33_ EW_WRITEREG: -7FFFFFFE 03B9 03D7 - 03E6 0004 0004
WriteRegDWORD HKLM SOFTWARE\NSISTest\BigNSISTest DwordTest_0123 0123

;/ #0027 33_ EW_WRITEREG: -7FFFFFFE 03EB 0409 - 0362 0003 0003
WriteRegBin HKLM SOFTWARE\NSISTest\BigNSISTest BinTest_deadbeef01f00dbeef ''

Dump of 'NB_STRINGS'
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F
00000350 49 53 54 65 73 74 5C 42 69 67 4E 53 49 53 54 65 ISTest\BigNSISTe
00000360 73 74 00 44 77 6F 72 64 54 65 73 74 5F 30 78 44 stDwordTest_0xD
00000370 45 41 44 42 45 45 46 00 30 78 64 65 61 64 62 65 EADBEEF 0xdeadbe
Anders#
Are you saying the generated installer is unable to write to the registry or that your decompiler is broken?

What is script.bin?

Where is the \0 terminator for ...ISTest\BigNSISTest?
cw2k#
Originally Posted by Anders View Post
Are you saying the generated installer is unable to write to the registry
Yes that's the point. The setup doesn't create
BinTest_deadbeef01f00dbeef
with the content "DEADBEEF01F00DBEEF"
under HKLM SOFTWARE\NSISTest\BigNSISTest

Originally Posted by Anders View Post
or that your decompiler is broken?
Well broken - of course - it's runs but it's not finished yet.

Originally Posted by Anders View Post
What is script.bin?
Universal Extractor
splits out that file if I extract bigtest.exe (the new create setup from bigtest.nsi)

script.bin starts with the so called NS Common Header. It is right from the beginning of the tempfile that NSI used to create(the unpacked setup.exe) - but you can't accessed it so easily because the CreateFile() used to create it didn't set flags of sharemode access. See more here.


Originally Posted by Anders View Post
Where is the \0 terminator for ...ISTest\BigNSISTest?
[/QUOTE]
The Hexdata are good.
..73 74 00 44...
.. s t D w...
While in the Acci part it's missing (normally there is a '.' since \0 is not printable)

But yes ...NSISTest\BigNSISTest\0 is correctly terminated.
..and the 'string storage optimiser' seem to have reused that \0 part of ...NSISTest\BigNSISTest for the new empty string of the data from WriteRegBin.
... that should be "DEADBEEF01F00DBEEF"
but is actually "".