Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Investigating PE format (EXE and DLL)

  1. #11

    Re: Investigating PE format (EXE and DLL)

    Thanks for testing Petr.

    The next step is to drop some of the current Asm examples into this framework and run them as standalones. To do this they must not have any run-time dependencies on Oxygen or thinBasic - so the small kernel of procedures like bind and copy0 have to be carried in the EXE file itself. Fortunately they are only a few hundred bytes. - I am rewriting these in Asm, then they can be incorporated into the framework for every EXE and DLL compiled.

  2. #12

    Re: Investigating PE format (EXE and DLL)


    Oxygen Update:

    http://community.thinbasic.com/index.php?topic=1845

    Yet another small fix but now we have demo code producing MessageBox, HelloWin and Opengl 4 Port viewer.

    Despite their minuscule size, the executables are actually a bit bloated - with an un-needed export section.

    Below are the thinBasic PE scripts and the demo EXEs ready compiled. Only thinBasic with the latest Oxygen was required to produce these. No headers, linkers or any other dependencies.

    Attached Files Attached Files

  3. #13
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    68
    Posts
    3,865
    Rep Power
    405

    Re: Investigating PE format (EXE and DLL)

    Charles thanks for the demos all in one. Makes it easy for guys that have a hard time with this stuff, like me.
    9KB for cool opengl Demo is neat, I like how you said it is still bloated

    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  4. #14

    Re: Investigating PE format (EXE and DLL)

    Well they are bloated by 512 bytes with the exports section, and I have not attempted any tricks like combining sections or using UBX compression.

    Once the EXE is loaded into memory the minimum section size is 4K which means that these demos inflate to around 20k. But of course Opengl demands major resources so the overall memory size ends up around 8 Megs! (Just to put things in perspective.)

    The next step is to write a thinBasic Module - so the exports section will be utilised. - 512 bytes will accommodate about 20 to 25 DLL function names.

  5. #15
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,154
    Rep Power
    736

    Re: Investigating PE format (EXE and DLL)

    Hi Charles,

    HellowWin in 3,584 bytes is really nice!


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #16
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10

    Re: Investigating PE format (EXE and DLL)

    Charles,

    I'm following your job here behind the curtains in a very silent way. I'm really fascinated about the possibilities I can just "smell" at the moment.
    To be honest, my knowledge of the matter let me understand just 25%-30% of what you have done so far but I try to read again and again your scripts. At every read I can get a little more.

    So, for the moment, thanks a lot for your job.
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #17
    Member zlatkoAB's Avatar
    Join Date
    Apr 2008
    Age
    55
    Posts
    287
    Rep Power
    45

    Re: Investigating PE format (EXE and DLL)

    Excelent job Charles

  8. #18

    Re: Investigating PE format (EXE and DLL)

    Thanks. Working on these longer programs and a thinBasic module DK gives me ample opportunity to sample my own porridge - ande detect any lumpy bits, (before any one else does! ) - also preparing the ground for higher level syntax.

    I've thought of calling my current piece: ThinBasic Oxygen Module Development Kit: TOMDK There's Tom & Dick but I couldn't think of a Harry

  9. #19
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,154
    Rep Power
    736

    Re: Investigating PE format (EXE and DLL)

    Nice name ,

    Charles, what is the purpose of TimeDateDecode in HelloWin creation?


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #20

    Re: Investigating PE format (EXE and DLL)

    Hi Petr,

    The DateTime stamp is a 32 bit value representing the time in seconds since 1 Jan 1970. My algorithm disagrees with this (compared with a GNU compiled EXE) by exactly 1 hour for some reason so I correct this with a fudge factor. And I dont know what PB uses - it may be an arbitrary value.

    Neither the TimeDate stamp nor the header checksum are operationally required. Though MS kernel DLLs require a header checksum

    I am making good headway with TOMDK, I did not appreciate that Having a LIBMAIN is mandatory, even though it is not present in the exprt functions table. It is the main entry point of the module and is called when the module is loaded, and again just before the module is unloaded by the OS.


Page 2 of 2 FirstFirst 12

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •