How can I suppress "batch job completion" in Win7 cmd.exe

As discussed in another question , is it possible to fix cmd.exe to suppress "Finish batch job (Y / N)?" message. Correction instructions are available for Windows XP.

Unfortunately, these fixes are deprecated for Windows 7, and I don’t know enough builds to update them. (I know how to use the hex editor and was able to follow the instructions for WinXP.)

Based on these WinXP instructions, how can I update cmd.exe in Windows 7 to fix this nasty bug?

+3
source share
2 answers

The webpage author gave me an offset offset:

.text:000000004AD1CF53 48 83 3D 8D 02 01 00 00                 cmp     cs:CurrentBatchFile, 0
.text:000000004AD1CF5B 74 3D                                   jz      short loc_4AD1CF9A
.....
.text:000000004AD1CF5D BA 7B 23 00 00                          mov     edx, 237Bh
.text:000000004AD1CF62 33 C9                                   xor     ecx, ecx
.text:000000004AD1CF64 44 8D 42 AD                             lea     r8d, [rdx-53h]
.text:000000004AD1CF68 E8 E3 7B 00 00                          call    PromptUser
.text:000000004AD1CF6D 83 F8 01                                cmp     eax, 1
.text:000000004AD1CF70 74 0B                                   jz      short loc_4AD1CF7D
.text:000000004AD1CF72 E8 B9 51 FE FF                          call    ResetCtrlC
^F.text:000000004AD1CF77 90                                      nop
.text:000000004AD1CF78 E9 46 54 FE FF                          jmp     loc_4AD023C3
.....
.text:000000004AD1CF7D                         loc_4AD1CF7D:                           ; CODE XREF:
CheckCtrlC+1ABC0^Xj
.text:000000004AD1CF7D 48 8B 1D 64 02 01 00                    mov     rbx, cs:CurrentBatchFile
.text:000000004AD1CF84 EB 0F                                   jmp     short loc_4AD1CF95

In 64-bit win7 cmd.exe, which is 0x20 bytes, starting at offset 0x1c35d

+3
source

Write a real executable file that then launches your bat file and channels, inputs and outputs back and forth without explicitly passing Ctrl + Break?

+1
source

Source: https://habr.com/ru/post/1720325/


All Articles