.text:00466E00 .text:00466E00 loc_466E00: ; CODE XREF: sub_466D40+9Fj .text:00466E00 ; sub_466D40+B7j .text:00466E00 push offset aWarning_4 ; "WARNING" .text:00466E05 lea eax, [ebp+Caption] .text:00466E0B push eax ; LPSTR .text:00466E0C call ds:wsprintfA .text:00466E12 add esp, 8 .text:00466E15 mov ecx, [ebp+var_10C] .text:00466E1B cmp ecx, [ebp+var_214] .text:00466E21 jnb loc_466EF0 ; 【重要】要修改的指令! .text:00466E27 movzx edx, word_5072F8 .text:00466E2E and edx, 80h .text:00466E34 jz short loc_466E93 .text:00466E36 push offset aWarning_5 ; "WARNING!!" .text:00466E3B lea eax, [ebp+Caption] .text:00466E41 push eax ; LPSTR .text:00466E42 call ds:wsprintfA .text:00466E48 add esp, 8 .text:00466E4B push offset aYouAreAboutToF ; "You are about to flash your BIOS to an "... .text:00466E50 lea ecx, [ebp+Text] .text:00466E56 push ecx ; LPSTR .text:00466E57 call ds:wsprintfA .text:00466E5D add esp, 8 .text:00466E60 push 31h ; uType .text:00466E62 lea edx, [ebp+Caption] .text:00466E68 push edx ; lpCaption .text:00466E69 lea eax, [ebp+Text] .text:00466E6F push eax ; lpText .text:00466E70 push 0 ; hWnd .text:00466E72 call ds:MessageBoxA .text:00466E78 cmp eax, 1 .text:00466E7B jnz short loc_466E87
大概浏览一下这个函数,发现第11行代码:“jnb loc_466EF0” 就是关键分支点,如果 var_10C < var_204 ,他就会弹出我们最后见到的那个 MessageBox,否则他就会跳转到附近的 00466EF0 位置去正常的刷 bios。所以这里只要把 jnb 改成 jb,程序就会完全以相反逻辑运行(把正在刷低版本 bios 当成刷高版本)。
为了修改汇编代码,还需要参考 intel 的官方文档:《64 ia 32 architectures software developer manual 325462》。对照文档可以指导我们如何修改指令。
在 IDA 中显示 jnb loc_466EF0 指令对应的是 6 个字节:“0F 83 C9 00 00 00”,对照文档的介绍可知,前两个字节"0F 83" 是 JNB 的操作码(Opcode),后面四个字节“C9 00 00 00” 代表地址偏移量是 0xC9 (201)个字节(即: if not below, then EIP = EIP + 0xC9)。
接下来就是修改这条跳转指令,有多种方法(以下操作码中的操作数均为相对值,即偏移量):
(1)把 JNB 改成 JB(操作码:0F 82)。只有待刷版本低于当前版本才刷。
(2)把 JNB 改成 JNZ (操作码:0F 85)。只要待刷版本和当前版本不同就刷。
(3)把 JNB 改成 JMP(操作码:E9)。无条件刷。(因为 JMP 操作码只有一个字节,所以需要补一个 NOP ),有可能还需要修改一个版本相等的跳转,我没有认真细看了。










