You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using the stock templat as given below to add an import to a file. However, I am not able to see the import added to the binary.
Please let me know where I am going wrong.
PeNet.PeFile peFile = new PeNet.PeFile(@"D:\Sample\7z.exe");
peFile.AddImport("gdi32.dll", "StartPage");
I imported the package via NuGet and compiled the code.
The code exits as expected but doesn't provide the expected results.
The text was updated successfully, but these errors were encountered:
Had the same issue and worked around it by saving the rawFile buffer to file (it seems like AddImport doesn't apply changes to the binary).
So in your case do this:
// add importPeNet.PeFilepeFile=newPeNet.PeFile(@"D:\Sample\7z.exe");peFile.AddImport("gdi32.dll","StartPage");// save binary to diskFile.WriteAllBytes(@"D:\Sample\7z.exe",peFile.rawFile.ToArray());
I tried using the stock templat as given below to add an import to a file. However, I am not able to see the import added to the binary.
Please let me know where I am going wrong.
I imported the package via NuGet and compiled the code.
The code exits as expected but doesn't provide the expected results.
The text was updated successfully, but these errors were encountered: