2

In Ollydbg 1.1, when I create on the fly patches, they're automatically disabled when I restart the application (the debugged one, not Olly) and I have to enable them manually again. Is there a menu option I missed, or a script that can keep those enabled between restarts ?

  • This post is more appropriate as a comment vs an answer. Last time I had a similar hassle where I wanted keep on the fly changes in olly, I just wrote up a dll patch and after injecting attached olly. But there was a significant number of patches so it was worth the effort. – Viktor Jul 31 '15 at 18:19
2

Fly patches are what they are : fly patches. So it is the normal behavior that they don't load whenever you restart the program.

If you want to keep your patches between two executions, you've got two solutions :

  • Patch definitely your binary, so you won't have to do the patches again : After you make a change to the code, highlight the changes, right click on it, choose 'Copy To Executable'. You can choose the current selection of what you just changed, or, you can choose to copy all changes to the executable. When you select one, it will popup a new window which is the new file, right click in the new window that popped up, and choose 'Save file' and it will save the changes to the given file that you choose. Step by step animation : http://i.imgur.com/G1J7EVP.gif

  • Use a plugin such as Multiline Ultimate Assembler so you can write your patches, save them and load them whenever you want during execution time.

| improve this answer | |
2

ctrl+p -> space keep it pressed for multiple activation

source code for enable patch plugin (to automate the keystrokes posted above)

#include <windows.h>
#include "plugin.h"
#pragma comment(lib,"user32.lib")
#pragma comment(lib,"odbgvc10.lib")
/*
compiled and linked with
@call "C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
cl /nologo /Zi /Zp1 /W4 /EHsc /O1 /J /FD /c /analyze /TP /WX patcha.cpp
link /nologo /dll  /RELEASE /incremental:no /debug patcha.obj
*/
int Enablepatch() { //use once to activate use again to deactivate all patches
  Createpatchwindow();
  t_table *patch = (t_table *)Plugingetvalue(VAL_PATCHES);
  int patches = patch->data.n;
  Selectandscroll(patch,0,2);  
  for(int i=0;i<patches;i++) {
    SendMessage(patch->hw,WM_KEYDOWN,VK_SPACE,MapVirtualKey(VK_SPACE,0));
  }
  return 0;
};

BOOL WINAPI DllMain( HINSTANCE , DWORD , LPVOID ) { return 1; }

extc int _export _cdecl ODBG_Plugindata( char shortname[32] ) {
  strcpy_s( shortname,30, "patcha" );
  return PLUGIN_VERSION;
};

extc int _export _cdecl ODBG_Plugininit( int ollydbgversion, HWND , PULONG ){
  if (ollydbgversion<PLUGIN_VERSION) { return -1; }
  Addtolist( 0, 1, "patcha Plugin by blabb" );
  return 0;
};

extc int _export _cdecl ODBG_Pluginmenu( int origin, char data[4096], PVOID ) {
  switch (origin) {
  case PM_MAIN:
    strcpy_s( data, 4000, "0 &patcha" );
    return 1;
  default: break;
  };
  return 0;
};

extc void _export _cdecl ODBG_Pluginaction( int origin, int action, PVOID ) {
  if (origin==PM_MAIN) {
    switch (action) {
    case 0:
      Enablepatch();
      break;
    default:
      break;
    };
  };
};           

                   .
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.