On Tue, 29 Dec 2009 15:49:36 +0100, Danny Backx <danny.ba...@scarlet.be>
wrote:
> On Mon, 2009-12-28 at 10:00 +0100, Danny Backx wrote:
>> I just committed a cleaned up version of my current work.
>> 
>> This now has .edata and .idata sections hidden in .rdata, and can
>> generate working DLL and EXEs but with the SizeOfImage <= 10000 limit.
>> 
>>      Danny
> 
> I found one more issue, haven't figured out the reason yet though.
> 
> I got here by using a minimalistic example (a DLL with almost no code
> but a big buffer). This gave me an error that I considered suspicious :
> code 1114 (ERROR_DLL_INIT_FAILED).
> 
> So I tuned in on this, and ended up replacing the default
> DllMainCRTStartup (from src/mingw) by an empty one. Cutting the story
> shorter, the error appears to be in _pei386_runtime_relocator().
> 
> Replacing the underlying function do_pseudo_reloc() by an empty one also
> got the DLL to load. Adding MessageBoxW() calls to print the arguments
> succeeds, until I try to print the value of the third argument "base".
> 
> This is (from src/mingw/pseudo-reloc.c) :
>   do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__,
>                    &__RUNTIME_PSEUDO_RELOC_LIST_END__,
>                     &__U(_image_base__));
> 
> I tried several versions :
>    wsprintf(msg, L"do_pseudo_reloc(%p,%p)", start, end); // works
>    wsprintf(msg, L"do_pseudo_reloc(%p)", base); // error 1114
> 
>   { DWORD a = start, b = end, c = base;
>         wsprintf(msg, L"do_pseudo_reloc(%08x,%08x,%08x)", a, b, c);
>           } // error 1114
> 
> Strangely the latter works with the assignment (c = base) but fails when
> I try to print the value of c.
> 
> Obviously (feeling adventurous) the next thing is to relink a bunch of
> DLLs with empty do_pseudo_reloc, and try a real application.
> 
> This turned out to work :-)
> See http://danny.backx.info/download/cegcc/Capture.PNG
> 
> Two questions :
> - why I cannot work with that third argument (_image_base__)
> - which functionality have I now turned off by removing the content
>   of do_pseudo_reloc().

Congratulations!
I don't know asnwers to your question but you seem to have progressed a
lot.
Thanks for investigating this.





------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to