-
Data: 2017-08-19 17:40:49
Temat: Re: code for flushing imports to .idata in exe
Od: fir <p...@g...com> szukaj wiadomości tego autora
[ pokaż wszystkie nagłówki ]W dniu sobota, 19 sierpnia 2017 15:22:46 UTC+2 użytkownik fir napisał:
> I think i need some code that would work like
> that
>
> AddImportsForModule("KERNEL32.DLL", "ExitProcess", "GetModuleHandleA",
"GetProcAddress");
>
> AddImportsForModule("msvcrt.dll", "fopen", "free", "printf", "exit", "fclose",
"fread");
>
>
>
> well maybe it would be more like
>
> char* import_names[] = {"fopen", "free", "printf", "exit", "fclose", "fread");
>
> AddImportsForModule("msvcrt.dll", import_names);
>
> but this is detail
>
> the code just need to build binary block of .idata section that i can flush to exe
file
> when flushing exe to disk in my assembler
>
> im howewer a bit confused how weirdly this .idata binary is build, so maybe some
hints on that?
>
> btw some best info i found on this topic is here
>
> https://github.com/macton/x64-fasm-examples/blob/mas
ter/Windows/00_BasicOS/00_pe_return_03.asm
>
> or around here, so if someone would like to focus on this and give me some hints
may use it
>
> tnx
after contemplating that sht for a while
https://github.com/macton/x64-fasm-examples/blob/mas
ter/Windows/00_BasicOS/02_pe_messagebox_03.asm
it seems to me that i need to do such things
(say i got N modules of import)
- flush N of those 40-byte-long module describing records and finish it with zero
record
- flush N module names
- flush so called ILT and IAT for each module (slightly confused here)
- flush all function names (intermixed with 'hints')
would it be all? if so it seems less confusing i previously thought (though those
import-adding-api should be redefined as i need to build a wholle collection before
flushing it in last step
somethink like
AddImport("KERNEL32.DLL", "ExitProcess");
AddImport("KERNEL32.DLL", "GetModuleHandleA");
AddImport("KERNEL32.DLL", "GetProcAddress");
AddImport("msvcrt.dll", "fopen");
AddImport("msvcrt.dll", "free");
AddImport("msvcrt.dll", "printf");
AddImport("msvcrt.dll", ""exit");
AddImport("msvcrt.dll", "fclose");
AddImport("msvcrt.dll", "fread");
FlushIDataSection();
Następne wpisy z tego wątku
- 20.08.17 20:20 wół, wół roboczy, wół dojno roboczo obronny 'POPIS/EU
- 20.08.17 20:39 fir
Najnowsze wątki z tej grupy
- Do czego nadaje się QDockWidget z bibl. Qt?
- Bibl. Qt jest sztucznie ograniczona - jest nieprzydatna do celów komercyjnych
- Co sciaga kretynow
- AEiC 2024 - Ada-Europe conference - Deadlines Approaching
- Jakie są dobre zasady programowania programów opartych na wtyczkach?
- sprawdzanie słów kluczowych dot. zła
- Re: W czym sie teraz pisze programy??
- Re: (PDF) Surgical Pathology of Non-neoplastic Gastrointestinal Diseases by Lizhi Zhang
- CfC 28th Ada-Europe Int. Conf. Reliable Software Technologies
- Młodzi programiści i tajna policja
- Ada 2022 Language Reference Manual to be Published by Springer
- Press Release - AEiC 2023, Ada-Europe Reliable Softw. Technol.
- Ada-Europe - AEiC 2023 early registration deadline approaching
- Ada-Europe Int.Conf. Reliable Software Technologies, AEiC 2023
- Ile cykli zajmuje mnożenie liczb 64-bitowych?
Najnowsze wątki
- 2024-05-16 Samo rozładowywanie baterii trakcyjnej w elektryku.
- 2024-05-16 Warszawa => Senior PHP Developer (Symfony) <=
- 2024-05-16 Warszawa => Interactive/Experience Designer <=
- 2024-05-16 Wrocław => Consultant/Implementer Comarch ERP XL <=
- 2024-05-16 Zabrze => Junior HelpDesk <=
- 2024-05-16 Warszawa => Technical Lead ( (Java Background)) <=
- 2024-05-16 Szczecin => Senior DevOps Engineer <=
- 2024-05-16 Szczecin => Starszy inżynier oprogramowania (Rust) <=
- 2024-05-16 Śledztwo bodnatury "jak wyrok"? ["likwidator" Polskiego Radia donosi]
- 2024-05-16 Citi... zmiany warunków umowy o kartę kredytową Citibank?
- 2024-05-16 prawo jazdy z Nepalu
- 2024-05-15 Mini Netykieta polskich grup i list dyskusyjnych
- 2024-05-15 Warszawa => Key Account Manager <=
- 2024-05-15 Millenium czyli DEBILE bankowości
- 2024-05-15 Warszawa => Frontend Developer - React <=