Questions tagged [hotpatching]
21 questions
13
votes
2 answers
Anyone knows what "mov edi,edi " does?
69A8AB13 int 3
69A8AB14 int 3
69A8AB15 mov edi,edi
69A8AB17 push ebp
69A8AB18 mov ebp,esp
mov edi,edi doesn't make sense for me,what's it for?

COMer
- 1,117
- 4
- 14
- 24
6
votes
1 answer
Can modules be hotpatched?
I want to be able to hotpatch modules while the program is running for a project I'm working on. I tried this, but it doesn't work:
qx[rm -r .precomp/*];
try require PSBot;
try PSBot.test;
Is it possible to do? If so, how can I do it?

Kaiepi
- 3,230
- 7
- 27
5
votes
1 answer
Is it guaranteed that x86 instruction fetch is atomic, so that rewriting an instruction with a short jump is safe for concurrent thread execution?
I thought hot-patching assumed that overwriting any instruction that is 2 or more bytes long with a 2 byte jump is safe for concurrent execution of the same code.
So instruction fetch is assumed to be atomic.
Is it indeed atomic, taking into account…

Alex Guteniev
- 12,039
- 2
- 34
- 79
4
votes
1 answer
Hooking - hotpatching
I'm trying to hook the Windows API function FindWindowA(). I successfully did it with the code below without "hotpatching" it: I've overwritten the bytes at the beginning of the function. myHook() is called and a message box shows up when…

GuiTeK
- 1,561
- 5
- 20
- 39
3
votes
3 answers
Calculating offset for hotpatching/inline function hooking
From http://lastfrag.com/hotpatching-and-inline-hooking-explained/,
Q1) Does code proceed from high memory to low memory or vice versa?
Q2) More importantly, during the calculation of the replacement offset, why is it that you have to minus the…

user962460
- 153
- 1
- 8
2
votes
1 answer
Is the Hot Patching padding always a multiple of 16?
Created a Windows executable with options /hotpatch and /FUNCTIONPADMIN:195 which adds 195 bytes of padding to the beginning of main().
// Windows x86 null-free WinExec Calc.exe shellcode.
char shellcode[195] =…

vengy
- 1,548
- 10
- 18
2
votes
2 answers
What happens to the CPU pipeline when the memory with the instructions is changed by another core?
I'm trying to understand how the "fetch" phase of the CPU pipeline interacts with memory.
Let's say I have these instructions:
4: bb 01 00 00 00 mov $1,%ebx
9: bb 02 00 00 00 mov $2,%ebx
e: b3 03 mov …

Daniel
- 2,869
- 4
- 26
- 28
2
votes
0 answers
Jump label patching in userspace
Jump label patching is a neat mechanism in the Linux kernel allowing for branch optimization. In general, some branches check a "static" condition which is not likely to change. One example for usage for this mechanism is in kernel tracing where an…

smichak
- 4,716
- 3
- 35
- 47
2
votes
0 answers
How can I update javascript/css assets on a long lived page after a release?
Assuming a site with multiple long lived apps, are there some easy strategies for hot swapping javascript/css code in production?
I've seen some websites (pivotal tracker for instance) show a banner that says "there are updates, please refresh."…

Parris
- 17,833
- 17
- 90
- 133
1
vote
1 answer
Azure app service instance history and versions of patch updates
I have multiple App Service instances (not VMs). In the portal, where do I find when and if my instance was patched (e.g. on patch Tuesday)? Is there a log or a report?

G. D'Seas
- 45
- 6
1
vote
1 answer
During hot patch in nginx ruby on rails can I reload the specific file instead of whole application by server restart?
Sometimes I have to hot patch production code due to an error/bug (mostly in a single file) but I have set eager_load and cache_classes to true in the development environment. Because of these two, the server takes around 2 and half minutes to load…

Zohaib
- 33
- 4
1
vote
1 answer
How can I apply the hot patch to fix bugs in the symfony project?
I have an application using symfony3 and some customers use it. I plan to fix the bug by downloading the patch code online.
But you know that when the patch code overwrites the project code, you must execute the following command to make the patch…

slince
- 21
- 2
1
vote
0 answers
Does MSVC/Win32 guarantee function start address is aligned
This question is about hotpatching. The core of hotpatching is to
replace the first two bytes instruction with a two bytes short
jump instruction. Microsoft guarantees the first instruction of a
hotpatchable function is at least two bytes. Let's…

amanjiang
- 1,213
- 14
- 33
1
vote
1 answer
Hooking framework (Detours-like)
I am looking for a C library/framework that allows me to replace functions in memory and redirect them to my own implementations, while still allowing my implementation to call the original implementation.
This seems to be a rather rare need on…

dom0
- 7,356
- 3
- 28
- 50
1
vote
1 answer
x64 MOV, JMP instruction crashes program
I'm learning how to hotpatch functions and I have the following code which works fine in 32-bit programs. However, I'm trying to get it to work in 64-bit programs as well but it just crashes.
#ifndef __x86_64
std::uint8_t Store[8] =…

Brandon
- 22,723
- 11
- 93
- 186