IDA patching, How to add new code, create new variable?

1k Views Asked by At

I have a very basic knowledge about IDA and patching. From my understanding, I can change a line of code by doing Edit -> Patch program -> Assembly. But how to I go about adding new lines of code into program?

The existing variable can also be change by doing Patch program-> Change byte, how can new variable be added?

1

There are 1 best solutions below

0
On

add new code: as CherryDT said,Find an unused place to put your code (or create one by adding a section to the file). jump to ...then jump return.

create new variable: no need to do this,"add new code" can do everything.