需要帮助解释以下程序

Need help explaining the following program

您好,我正在反汇编程序,我似乎无法确定程序的这一部分是用来做什么的。我知道 eax 是一个寄存器,push eax 将它放入堆栈等,但是 push offset aTaskmgr 有什么作用?

如有解释,将不胜感激。

.text:00404867 loc_404867:                             ; CODE XREF: .text:00404870j
.text:00404867                 mov     cx, [eax]
.text:0040486A                 add     eax, 2
.text:0040486D                 test    cx, cx
.text:00404870                 jnz     short loc_404867
.text:00404872                 sub     eax, edx
.text:00404874                 sar     eax, 1
.text:00404876                 jz      loc_404927
.text:0040487C                 lea     ecx, [esp+1389Ch]
.text:00404883                 push    ecx
.text:00404884                 call    __wcslwr
.text:00404889                 push    offset aTaskmgr ; "taskmgr"
.text:0040488E                 push    eax
.text:0040488F                 call    _wcsstr
.text:00404894                 add     esp, 0Ch
.text:00404897                 test    eax, eax
.text:00404899                 jnz     short loc_404917
.text:0040489B                 lea     edx, [esp+1389Ch]
.text:004048A2                 push    edx
.text:004048A3                 call    __wcslwr
.text:004048A8                 push    offset aProcexp ; "procexp"
.text:004048AD                 push    eax
.text:004048AE                 call    _wcsstr
.text:004048B3                 add     esp, 0Ch
.text:004048B6                 test    eax, eax
.text:004048B8                 jnz     short loc_404917
.text:004048BA                 lea     eax, [esp+1389Ch]
.text:004048C1                 push    eax
.text:004048C2                 call    __wcslwr
.text:004048C7                 push    offset aRegedit ; "regedit"
.text:004048CC                 push    eax
.text:004048CD                 call    _wcsstr
.text:004048D2                 add     esp, 0Ch
.text:004048D5                 test    eax, eax
.text:004048D7                 jnz     short loc_404917
.text:004048D9                 lea     ecx, [esp+1389Ch]
.text:004048E0                 push    ecx
.text:004048E1                 call    __wcslwr
.text:004048E6                 push    offset aMsconfig ; "msconfig"
.text:004048EB                 push    eax
.text:004048EC                 call    _wcsstr
.text:004048F1                 add     esp, 0Ch
.text:004048F4                 test    eax, eax
.text:004048F6                 jnz     short loc_404917
.text:004048F8                 lea     edx, [esp+1389Ch]
.text:004048FF                 push    edx
.text:00404900                 call    __wcslwr
.text:00404905                 push    offset aCmd_exe ; "cmd.exe"
.text:0040490A                 push    eax
.text:0040490B                 call    _wcsstr
.text:00404910                 add     esp, 0Ch
.text:00404913                 test    eax, eax
.text:00404915                 jz      short loc_404920

谢谢

这段代码似乎是首先对字符串中的字符进行计数,寻找空字符(在本例中为两个字节)。它是一个 "wide" 字符串 - 即 16 位 unicode,基于它每次循环都会将 eax 递增 2 的事实。它将长度存储在 eax 中,虽然我们看不到它,但看起来 edx 有一个指向字符串开头的指针。从 eax 中减去 edx,将 eax 从指针变为长度计数。

您提供给我们的其余代码使用 wcsstr,这是一个在另一个宽字符串中查找一个宽字符串并返回找到它的位置的函数。它正在与各种提供的字符串进行比较,当它通过测试 eax 以查看它是否为非零(测试 eax、eax ;jnz ...)找到匹配项时,它会跳转到您为我们提供的内容之后的代码。

它似乎正在根据正在比较的字符串遍历进程列表。我相信周围的代码会使其余部分更加清晰。

希望对您有所帮助。