Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

Read/Write EoF (end-of-file) or extra data | NEW CLASS+++

Read and write extra data (EoF) of a PE file.

Methods:
public static void SetExtraData(String fileName, Byte[] extraData)
public static Byte[] GetExtraData(String fileName)
public static Int64 GetSizeOfPE(String fileName)

[Image: Syr3DlV.png]
You can change:
Code
if (information.Exists)
{
    //few lines of code here
}
return -1;
To:
Code
if(!information.Exists)
    return -1
//few lines of code here
Since there is no else statement anyways, and so all the code inside will not be indented anymore. This just makes it a bit nicer to read.
Yeah that's good advice thanks. Currently working on UDP chat with smileys. Then possibly I'll take on re-creating bahnahnahs netcore project.
[Image: Syr3DlV.png]
the sizeofoptionalheader is not always 0xE0 its not gonna work with 64bit app.
[Image: bitcoin.png] Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
(Mar 12, 2018 03:18 AM)HFDone Wrote:  the sizeofoptionalheader is not always 0xE0 its not gonna work with 64bit app.

It reads numberofsections and sizeofheader, adds sizeofheader and raw size of each section to calculate the size. Looking at a 64-bit assembly and a 32-bit assembly in CFF explorer the math seems to add up.
[Image: Syr3DlV.png]
(Mar 12, 2018 06:47 PM)gigajew Wrote:  It reads numberofsections and sizeofheader, adds sizeofheader and raw size of each section to calculate the size. Looking at a 64-bit assembly and a 32-bit assembly in CFF explorer the math seems to add up.

stream.Seek((e_lfanew + 0xf8 + (i * 40)) + 0x10, SeekOrigin.Begin);
[Image: bitcoin.png] Be Nice For Once 15hVUVz7xA4kazHdk2BuErENGCskVwjYXP
(Mar 13, 2018 03:08 AM)HFDone Wrote:  stream.Seek((e_lfanew + 0xf8 + (i * 40)) + 0x10, SeekOrigin.Begin);

Ah thanks for the input, I'll change it once i get on my pc
[Image: Syr3DlV.png]


Possibly Related Threads...
Thread / Author Replies Views Last Post
by NobleJul 17, 2024 08:13 AM 4 182 Jul 17, 2024 08:13 AM
Last Post: ShadowCipher
[Python] by Luffy-_-Jan 11, 2022 08:14 AM 5 162 Jan 11, 2022 08:14 AM
Last Post: Hackers
[Python] by SkunT3lloJun 29, 2021 01:59 PM 2 192 Jun 29, 2021 01:59 PM
Last Post: SkunT3llo