http://www.bay12games.com/dwarves/mantisbt/view.php?id=5994 Original code: .text:008629BD mov edi, [eax+38h] .text:008629C0 mov eax, [eax+3Ch] .text:008629C3 mov [esp+1Ch], eax .text:008629C7 cmp edi, eax .text:008629C9 jnb short loc_862A22 .text:008629CB jmp short loc_8629D0 .text:008629CD lea ecx, [ecx+0] ... .text:00862A19 add edi, 4 .text:00862A1C cmp edi, [esp+1Ch] .text:00862A20 jb short loc_8629D0 Patch: 0x461dbd 8B 78 38 8B 40 3C 89 44 24 1C 3B F8 8B 78 3C 8B 40 38 89 44 24 1C 39 F8 .text:008629BD mov edi, [eax+3Ch] .text:008629C0 mov eax, [eax+38h] .text:008629C3 mov [esp+1Ch], eax .text:008629C7 cmp eax, edi 0x461dcb EB 03 8D 49 00 83 EF 04 90 90 .text:008629CB sub edi, 4 .text:008629CE nop .text:008629CF nop 0x461e19 83 C7 04 3B 7C 24 1C 72 AE 83 EF 04 3B 7C 24 1C 73 AE .text:00862A19 sub edi, 4 .text:00862A1C cmp edi, [esp+1Ch] .text:00862A20 jnb short loc_8629D0 You can use this script to apply the generated patch below: http://stalkr.net/files/ida/idadif.py ----8<---- This difference file is created by The Interactive Disassembler Dwarf_Fortress 00461DBF: 38 3C 00461DC2: 3C 38 00461DC7: 3B 39 00461DCB: EB 83 00461DCC: 03 EF 00461DCD: 8D 04 00461DCE: 49 90 00461DCF: 00 90 00461E1A: C7 EF 00461E20: 72 73