Win32ASM Консольный ввод, томограф IDA и скальпель SoftICE



    d8ef8794     

Задача 6.


Ну вот, мы и подошли к самой интересной части марлезонского балета. Сейчас мы готовы проанализировать нашу программу на предмет того, чего она там вытворяет с локальными переменными. :00401000 NumberOfCharsWritten= dword ptr -90h :00401000 nNumberOfCharsToWrite= dword ptr -8Ch :00401000 hConsoleInput = dword ptr -88h :00401000 hConsoleOutput = dword ptr -84h :00401000 Buffer = byte ptr -80h :00401000 :00401000 push ebp :00401001 mov ebp, esp :00401003 add esp, 0FFFFFF70h :00401009 push offset aInputOutput ; lpConsoleTitle :0040100E call SetConsoleTitleA :00401013 push 0FFFFFFF5h ; nStdHandle :00401015 call GetStdHandle :0040101A mov [ebp+hConsoleOutput], eax :00401020 push 0 ; lpReserved :00401022 lea eax, [ebp+NumberOfCharsWritten] :00401028 push eax ; lpNumberOfCharsWritten :00401029 push 11h ; nNumberOfCharsToWrite :0040102B push offset aTypeSomething ; lpBuffer :00401030 push [ebp+hConsoleOutput] ; hConsoleOutput :00401036 call WriteConsoleA :0040103B push 0FFFFFFF6h ; nStdHandle :0040103D call GetStdHandle :00401042 mov [ebp+hConsoleInput], eax :00401048 push 0 ; lpReserved :0040104A lea eax, [ebp+nNumberOfCharsToWrite] :00401050 push eax ; lpNumberOfCharsRead :00401051 push 80h ; nNumberOfCharsToRead :00401056 lea eax, [ebp+Buffer] :00401059 push eax ; lpBuffer :0040105A push [ebp+hConsoleInput] ; hConsoleInput :00401060 call ReadConsoleA :00401065 push 0 ; lpReserved :00401067 lea eax, [ebp+NumberOfCharsWritten] :0040106D push eax ; lpNumberOfCharsWritten :0040106E push 0Ch ; nNumberOfCharsToWrite :00401070 push offset aYouTyped ; lpBuffer :00401075 push [ebp+hConsoleOutput] ; hConsoleOutput :0040107B call WriteConsoleA :00401080 push 0 ; lpReserved :00401082 lea eax, [ebp+NumberOfCharsWritten] :00401088 push eax ; lpNumberOfCharsWritten :00401089 push [ebp+nNumberOfCharsToWrite] ; nNumberOfCharsToWrite :0040108F lea eax, [ebp+Buffer] :00401092 push eax ; lpBuffer :00401093 push [ebp+hConsoleOutput] ; hConsoleOutput :00401099 call WriteConsoleA :0040109E push 7D0h ; dwMilliseconds :004010A3 call Sleep :004010A8 push 0 ; uExitCode :004010AA call ExitProcess




Содержание  Назад  Вперед