I would love to see such a tool, i could use it for some actctx tests in ntdll<br><br>Gesendet mit meinem HTC<br><br>----- Reply message -----<br>Von: "Saulius Krasuckas" <saulius2@ar.fi.lt><br>An: "Alexandre Julliard" <julliard@winehq.org><br>Cc: <wine-devel@winehq.org><br>Betreff: ntdll: Revert 33b0f0edffa0c8a06b4ee8831c92fdc373f83ece.<br>Datum: Do., Nov. 17, 2011 18:49<br><br><br>On Thu, 17 Nov 2011, Alexandre Julliard wrote:<br>> <br>> The test requires a PE binary because obviously we can't test PE <br>> protections on Unix binaries. That doesn't mean it doesn't exist. Just <br>> build a crosstest:<br>> <br>> $ wine ntdll_crosstest.exe info.c<br>> info.c:1296: Test failed: mbi.Protect is 0x8, expected 0x4<br><br>IIRC, some of tests already craft minimal PE binaries in manual way.<br>So it would be nice to have some tool inside the tree to generate PEs <br>independetly, no?<br><br>Several years ago I've tried testing GetStdHandle() from within two PE <br>binaries with different header flags set (IMAGE_SUBSYSTEM_WINDOWS_[GC]UI).  <br><br>For a start I have copied some code of manual PE crafting to build PE <br>header.  Then there came .text section's order.  I realized it's <br>sufficient to write small assembler file, run it through the gas <br>crosscompiler, disasm it and parse the results to have _not only_ binary <br>data for rebuilding PE, but also symbolic one.<br><br>I wrote some awk-script then to convert .S file into C-function this way.  <br>With it it was easy to adjust options for crosscompiling gas/ld tools to <br>get PE with needed structure.<br><br>But maybe there is point in creating some universal in-tree tool?  Or <br>integrate the functionality into winegcc (or else) so as not to depend on <br>a crosscompiling suite but still have readable and easy changeable source.<br><br>Guys, what do you think?<br><br>S.<br><br><br>