NO

Author Topic: A new crazy idea  (Read 3985 times)

HellOfMice

  • Guest
A new crazy idea
« on: February 05, 2025, 04:42:22 PM »
Salut,

I should like to know if the following is a good idea:

1-A program loads in memory an *.exe file.
2-It copies the Import Directory table
3-For each entries of this new table it calls GetProcAddress and replace the VirtualAddress with the new real one
4-It replaces the address into the IAT with address into the code (Loader)
5-It calls the entry-point of the program

When the loaded program calls a dll function the loaded program calls the loader which stores the input registers and calls the original DLL function
When the DLL returns the loader stores the registers values and returns

The ideal should be to modify the IAT when the program already is memory but I don't know how to do.

Have you any idea?

PhR
« Last Edit: February 05, 2025, 04:45:38 PM by HellOfMice »

HellOfMice

  • Guest
Re: A new crazy idea
« Reply #1 on: February 05, 2025, 04:53:34 PM »
No HOOK
The antivirus could block the program
I don't know if the antivirus could block a program modifying  the IAT or the bound import directory
The program there could have is that the two programs have not the same HINSTANCE parameter
The idea behind all that is to know if datas are going out my computer or if a connection has been established on my pc using internet other than windows update.






Offline Vortex

  • Member
  • *
  • Posts: 1000
    • http://www.vortex.masmcode.com
Re: A new crazy idea
« Reply #2 on: February 05, 2025, 06:26:54 PM »
Hi Philippe,

Loading and running EXEs and DLLs from memory :

https://masmforum.com/board/index.php/topic,3150.0.html

Code it... That's all...

HellOfMice

  • Guest
Re: A new crazy idea
« Reply #3 on: February 05, 2025, 06:32:21 PM »
Very interesting.
That's an idea, I don't ,know if I will do it. Actually I am working on my program. I have the disassembler to do, the reading of import and export data directories.


I was wondering if an exe could have an export table? Why not but the exported function will only be available when the exe is running.
In the import table windows does not store the full path what would arrived if two dlls export two functions with the same names?



« Last Edit: February 05, 2025, 06:37:26 PM by HellOfMice »

Offline Vortex

  • Member
  • *
  • Posts: 1000
    • http://www.vortex.masmcode.com
Re: A new crazy idea
« Reply #4 on: February 05, 2025, 07:07:03 PM »
Hi Philippe,

The second page of the same Masm Forum thread mentions about an EXE exporting functions.
Code it... That's all...

HellOfMice

  • Guest
Re: A new crazy idea
« Reply #5 on: February 05, 2025, 07:22:17 PM »
UI have read. I don't know why but I have in my head a call to VirtualProtect.

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2237
Re: A new crazy idea
« Reply #6 on: February 05, 2025, 07:50:04 PM »
Just another crazy idea ?
OS loader do it safe way ?
May the source be with you

HellOfMice

  • Guest
Re: A new crazy idea
« Reply #7 on: February 05, 2025, 07:54:18 PM »
No, I am reading how to get the import functions, some ideas, as crazy than I, came to my head.
I have read too much things, and I don't know where I am between import/export/IAT/Bound it a great melting pot

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2237
Re: A new crazy idea
« Reply #8 on: February 06, 2025, 03:14:33 PM »
program loader for virus scanner or sandbox purposes are interesting.
for other purpose finding functions can be interesting too.
for disassembler have to find function names to make output easier to understand.
Pelle's pope.exe is a good program for checking binaries.
May the source be with you

HellOfMice

  • Guest
Re: A new crazy idea
« Reply #9 on: February 06, 2025, 03:25:30 PM »
Hi Timo

I use Pope all the days, many times a day.

I am rewriting the data directories and sections parts because I want to be sure to disassemble the good section. Resources disassembly is not a good idea!

I have problems with Bound Import and IAT I think I don't need to disassemble them but they have not the same size.
Actually I have loaded sqlite3.dll I join my results.
« Last Edit: February 06, 2025, 04:12:16 PM by HellOfMice »