I am doing a reverse engineering practice with radare2. I want to patch the vim binary file (linux), so that when a user presses "i" it is replaced with "e".
How I can find what is read from the keyboard in the disassembly file using radare2?
I am doing a reverse engineering practice with radare2. I want to patch the vim binary file (linux), so that when a user presses "i" it is replaced with "e".
How I can find what is read from the keyboard in the disassembly file using radare2?
Assuming that I could not read the source code, I will approach the problem as follows:
$>r2 /usr/bin/vim
[0x00072220]> #Perform analysis
[0x00072220]> aa
[x] Analyze all flags starting with sym. and entry0 (aa)
[0x00072220]> aae
[0x00072220]> #Search for the warning string from earlier
[0x00072220]> f~str~Changing
0x002a1db8 39 str.W10:_Warning:_Changing_a_readonly_file
[0x00072220]> #Find xref to string
[0x00072220]> axt 0x002a1db8
sym.change_warning 0x138f29 [STRING] lea rsi, str.W10:_Warning:_Changing_a_readonly_file
sym.change_warning 0x138f4c [STRING] lea rsi, str.W10:_Warning:_Changing_a_readonly_file
[0x00072220]> #Find xref to symbol
[0x00072220]> f~sym.change_warning
0x00138e70 369 sym.change_warning
[0x00072220]> axt 0x00138e70
sym.ex_diffgetput 0x8875a [CALL] call sym.change_warning
sym.edit 0x97242 [CALL] call sym.change_warning
sym.changed 0x139058 [CALL] call sym.change_warning
sym.u_undo 0x21d716 [CALL] call sym.change_warning
sym.u_savecommon 0x21de85 [CALL] call sym.change_warning
sym.undo_time 0x21f38c [CALL] call sym.change_warning
sym.undo_time 0x21f635 [CALL] call sym.change_warning
[0x00072220]>