News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Changing some data in the data section

Started by Magnum, December 05, 2012, 01:56:29 AM

Previous topic - Next topic

KeepingRealBusy

Quote from: Magnum on December 06, 2012, 07:26:05 AM
I respect your opinion, but I am not coming close to violating ANY laws.

I had already planned that I will NOT be posting the source here.

I may post very small snips in another language to get help as well as dummy code.

Have a beer and relax.  :biggrin:

I sometimes think the worst in situations.

Andy

You might check with Alex (Antaryi). He had a way to modify the code section (in the old forum), but it slowed down the execution. Not good for single use, but might be useful for a high use function that could be tailored for a specific operational state. I tried to find the example, but no luck.

Dave.

hutch--

It will depend exactly what it does, patching a binary file is simple file IO but if anything even vaguely looks like search and destroy patcher, we will remove it.

hfheatherfox07

Thank you for the clarification ..... :biggrin:

I came across that source that Magnum was referring to when I was looking for a Hex conversion routine ....that was all I needed (not the actual patcher)
I believe that patcher than to be a No, No...
It is a Blank patcher that loads any file! search pattern and bye bye

Your code and your skills will be assimilated. Your programming language is irrelevant.
We are the ASM Borg and you will become part of us. Compile and be assembled.

jj2007

Quote from: KeepingRealBusy on December 06, 2012, 10:07:57 AM
You might check with Alex (Antaryi). He had a way to modify the code section (in the old forum), but it slowed down the execution. Not good for single use, but ...

No rocket science involved. You need VirtualProtect to allow writing to your own code space, and two lines to get EIP:
include \masm32\include\masm32rt.inc

.code
start:
call @F
@@: pop eax    ; address 401005
inkey hex$(eax)
exit

end start

sinsi

Copy original.exe to a temp directory as temp.exe.
Run temp.exe with some command line params, "/patch original.exe offset value" then exit.
Let the temp.exe patch original.exe, optionally restart original.exe

edit:
Have you looked at the imagehlp functions? Things like ImageRvaToVa are in there
🍺🍺🍺

Magnum

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Magnum

I see several different methods that you guys have come up with.

I also would like to develop Hutch's method of storing the "fixer" into the executable.

I think Linux Mint code could use some fixing.  :t

Andy

Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

Magnum

Sinsi,

I will look into the imagehlp functions.

Andy
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org