• Категории
    • Последние
    • Метки
    • Популярные
    • Пользователи
    • Группы
    • Зарегистрироваться
    • Войти
    1. Главная
    2. MasterGH
    3. Сообщения
    Не в сети
    • Профиль
    • Подписки 1
    • Подписчики 1
    • Темы 110
    • Сообщения 225
    • Группы 4

    Сообщения

    Последние Лучшие сообщения Спорные
    • RE: Защита Трейнера

      Посмотрел. Что-то быстро ответить не получается. Лучше завтра, на свежую голову. У тебя уже скрипты идут все сложнее и сложнее. Сегодня понакидаю статеек, а завтра на свежую голову попробую снова глянуть

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Рубрика "Lua код сегодня" №4

      Это C - язык программирования.

      написал в Статьи и видео
      MasterGHM
      MasterGH
    • CE Вывод иерархии компонентов

      Скрипт позволит вывести иерархию компонентов CE в виде текста.
      3e71723a-06d5-4c3b-aea2-57d9db42938e-изображение.png
      Иерархия компонентов CE нужна для написания плагинов.

      Например, для ColorPicker и для смены шрифта (подобротнее об этом было где-то было в блоге).

      print("Controls list for CE "..getCEVersion()..'\n')
      
      function PrintComponents(obj, tabCount)
        local tabLine = string.rep('    ', tabCount)
        local componentCount = obj.ComponentCount
      
        if obj.Caption == nil then
           print(tabLine..obj.Name..'('..obj.ClassName..')')
        else
           print(tabLine..obj.Name..'('..obj.ClassName..') -> "'..obj.Caption..'"')
        end
      
        for i = 0, componentCount - 1 do
          local subObject = obj.Component[i]
          PrintComponents(subObject, tabCount + 1)
        end
      end
      
      PrintComponents(MainForm, 1)
      

      Результат

      Controls list for CE 7.4

      MainForm(TMainForm) -> "Cheat Engine 7.4"
      Splitter1(TSplitter)
      Panel1(TPanel) -> ""
      Panel4(TPanel) -> ""
      advancedbutton(TSpeedButton) -> "Advanced Options"
      CommentButton(TSpeedButton) -> "Table Extras"
      lblSigned(TLabel) -> "This table has been signed by
      Someone"
      Panel5(TPanel) -> ""
      ProcessLabel(TLabel) -> "No Process Selected"
      foundcountlabel(TLabel) -> "0"
      ScanText(TLabel) -> "Value:"
      lblScanType(TLabel) -> "Scan Type"
      lblValueType(TLabel) -> "Value Type"
      LoadButton(TSpeedButton) -> ""
      SaveButton(TSpeedButton) -> ""
      Label6(TLabel) -> "Found:"
      SpeedButton2(TSpeedButton) -> ""
      SpeedButton3(TSpeedButton) -> ""
      btnNewScan(TButton) -> "First Scan"
      gbScanOptions(TGroupBox) -> "Memory Scan Options"
      ScanOptionsModuleList(TComboBox)
      Panel2(TPanel) -> ""
      cbCopyOnWrite(TCheckBox) -> "CopyOnWrite"
      cbWritable(TCheckBox) -> "Writable"
      cbExecutable(TCheckBox) -> "Executable"
      Panel3(TPanel) -> ""
      Label2(TLabel) -> "Stop"
      Label1(TLabel) -> "Start"
      ToAddress(TEdit)
      FromAddress(TEdit)
      Panel6(TPanel) -> ""
      cbFastScan(TCheckBox) -> "Fast Scan"
      edtAlignment(TEdit)
      cbPauseWhileScanning(TCheckBox) -> "Pause the game while scanning"
      Panel8(TPanel) -> ""
      rbfsmLastDigts(TRadioButton) -> "Last Digits"
      rbFsmAligned(TRadioButton) -> "Alignment"
      btnNextScan(TButton) -> "Next Scan"
      ScanType(TComboBox)
      VarType(TComboBox)
      ProgressBar(TProgressBar)
      UndoScan(TButton) -> "Undo Scan"
      scanvalue(TEdit)
      Panel7(TPanel) -> ""
      sbOpenProcess(TSpeedButton) -> ""
      btnFirst(TButton) -> "First Scan2"
      btnNext(TButton) -> "Next scan 2"
      LogoPanel(TPanel) -> ""
      Logo(TImage)
      SettingsButton(TSpeedButton) -> "Settings"
      pnlScanValueOptions(TPanel) -> ""
      rbBit(TRadioButton) -> "Bits"
      rbDec(TRadioButton) -> "Decimal"
      cbHexadecimal(TCheckBox) -> "Hex"
      Panel9(TPanel) -> ""
      pnlScanOptions(TPanel) -> ""
      pnlFloat(TPanel) -> ""
      rt3(TRadioButton) -> "Truncated"
      rt1(TRadioButton) -> "Rounded (default)"
      rt2(TRadioButton) -> "Rounded (extreme)"
      cbUnicode(TCheckBox) -> "UTF-16"
      cbCaseSensitive(TCheckBox) -> "Case sensitive"
      cbFloatSimple(TCheckBox) -> "Simple values only"
      cbpercentage(TCheckBox) -> "Percent"
      cbNot(TCheckBox) -> "Not"
      cbCodePage(TCheckBox) -> "Codepage"
      cbRepeatUntilStopped(TCheckBox) -> "Repeat"
      cbLuaFormula(TCheckBox) -> "Lua formula"
      cbNewLuaState(TCheckBox) -> "Separate Lua state"
      Panel10(TPanel) -> ""
      cbUnrandomizer(TCheckBox) -> "Unrandomizer"
      cbSpeedhack(TCheckBox) -> "Enable Speedhack"
      Panel14(TPanel) -> ""
      Label54(TLabel) -> "Speed"
      lblSH0(TLabel) -> "0"
      lblSH20(TLabel) -> "500"
      btnSetSpeedhack2(TButton) -> "Apply"
      editSH2(TEdit)
      tbSpeed(TTrackBar)
      scanvalue2(TEdit)
      ScanText2(TLabel) -> "Scan Value"
      andlabel(TLabel) -> "and"
      Foundlist3(TListView)
      (TCustomListViewEditor)
      btnAddAddressManually(TButton) -> "Add Address Manually"
      btnMemoryView(TButton) -> "Memory View"
      cbCompareToSavedScan(TCheckBox) -> "Compare to first/saved scan"
      lblcompareToSavedScan(TLabel) -> "<xxxx>"
      UpdateTimer(TTimer)
      FreezeTimer(TTimer)
      PopupMenu2(TPopupMenu)
      (TMenuItem) -> ""
      (TMenuItem) -> "Add to new group"
      miAutoAssembleErrorMessage(TMenuItem) -> "<Error message here>"
      Deletethisrecord1(TMenuItem) -> "Delete this record"
      Change1(TMenuItem) -> "Change record"
      Description1(TMenuItem) -> "Description"
      Address1(TMenuItem) -> "Address"
      Type1(TMenuItem) -> "Type"
      Value1(TMenuItem) -> "Value"
      miUndoValue(TMenuItem) -> "Undo last edit"
      Smarteditaddresses1(TMenuItem) -> "Smart edit address(es)"
      Browsethismemoryregion1(TMenuItem) -> "Browse this memory region"
      miDisassemble(TMenuItem) -> "Disassemble this memory region"
      miShowAsSigned(TMenuItem) -> "Show as signed"
      Showashexadecimal1(TMenuItem) -> "Show as hexadecimal"
      miZeroTerminate(TMenuItem) -> "Zero-Terminate string"
      miShowAsBinary(TMenuItem) -> "Show as binary"
      miChangeColor(TMenuItem) -> "Change Color"
      SetHotkey1(TMenuItem) -> "Assign Hotkey"
      miSetDropdownOptions(TMenuItem) -> "Set/Change dropdown selection options"
      Freezealladdresses2(TMenuItem) -> "Toggle Selected Records"
      miFreezePositive(TMenuItem) -> "Freeze Positive"
      miFreezeNegative(TMenuItem) -> "Freeze Negative"
      Changescript1(TMenuItem) -> "Change script"
      miAsyncScript(TMenuItem) -> "Execute asynchronous"
      N5(TMenuItem) -> "-"
      miGeneratePointermap(TMenuItem) -> "Generate pointermap"
      Pointerscanforthisaddress1(TMenuItem) -> "Pointer scan for this address"
      Findoutwhataccessesthisaddress1(TMenuItem) -> "Find out what accesses this address"
      Setbreakpoint1(TMenuItem) -> "Find out what writes to this address"
      sep2(TMenuItem) -> "-"
      miDBVMFindWhatWritesOrAccesses(TMenuItem) -> "DBVM Find out what writes or accesses this address"
      sep1(TMenuItem) -> "-"
      Calculatenewvaluepart21(TMenuItem) -> "Recalculate new addresses"
      Forcerechecksymbols1(TMenuItem) -> "Force recheck symbols"
      N4(TMenuItem) -> "-"
      Cut1(TMenuItem) -> "Cut"
      Copy1(TMenuItem) -> "Copy"
      Paste1(TMenuItem) -> "Paste"
      MenuItem1(TMenuItem) -> "Select All"
      N1(TMenuItem) -> "-"
      CreateGroup(TMenuItem) -> "Create Header"
      miGroupconfig(TMenuItem) -> "Group config"
      miHideChildren(TMenuItem) -> "Hide children when deactivated"
      miBindActivation(TMenuItem) -> "Activating this entry activates it's children"
      miBindDeactivation(TMenuItem) -> "Deactivating this entry deactivates it's children"
      miRecursiveSetValue(TMenuItem) -> "Setting a value to this entry sets same value to children"
      miAllowCollapse(TMenuItem) -> "Allow left and right arrow keys to collapse and expand"
      miManualExpandCollapse(TMenuItem) -> "Manual expand/collapse"
      miAlwaysHideChildren(TMenuItem) -> "Always hide children"
      Plugins1(TMenuItem) -> "Plugins"
      foundlistpopup(TPopupMenu)
      (TMenuItem) -> ""
      miAddAddress(TMenuItem) -> "Add selected addresses to the addresslist"
      miChangeValue(TMenuItem) -> "Change value of selected addresses"
      miChangeValueBack(TMenuItem) -> "Change value of selected addresses back to previous/saved value"
      Browsethismemoryarrea1(TMenuItem) -> "Browse this memory region"
      Browsethismemoryregioninthedisassembler1(TMenuItem) -> "Disassemble this memory region"
      Removeselectedaddresses1(TMenuItem) -> "Remove selected addresses"
      Copyselectedaddresses1(TMenuItem) -> "Copy selected addresses"
      Selectallitems1(TMenuItem) -> "Select all items"
      MenuItem4(TMenuItem) -> "-"
      miShowPreviousValue(TMenuItem) -> "Show previous value column(s)"
      miOnlyShowCurrentCompareToColumn(TMenuItem) -> "Only show current "compare to" column"
      MenuItem13(TMenuItem) -> "-"
      miForgotScan(TMenuItem) -> "Reload the previous value list (Forgot value scan)"
      MenuItem14(TMenuItem) -> "-"
      miFlFindWhatAccesses(TMenuItem) -> "Find out what accesses this address"
      miFlFindWhatWrites(TMenuItem) -> "Find out what writes to this address"
      N2(TMenuItem) -> "-"
      miFoundListPreferences(TMenuItem) -> "Preferences"
      MenuItem19(TMenuItem) -> "-"
      miDisplayHex(TMenuItem) -> "Hexadecimal"
      miDisplayDefault(TMenuItem) -> "Default"
      miDisplayByte(TMenuItem) -> "Byte"
      miDisplay2Byte(TMenuItem) -> "2 Bytes"
      miDisplay4Byte(TMenuItem) -> "4 Bytes"
      miDisplay8Byte(TMenuItem) -> "8 Bytes"
      miDisplayFloat(TMenuItem) -> "Float"
      miDisplayDouble(TMenuItem) -> "Double"
      OpenDialog1(TOpenDialog)
      SaveDialog1(TSaveDialog)
      TopDisabler(TTimer)
      emptypopup(TPopupMenu)
      (TMenuItem) -> ""
      MenuItem2(TMenuItem) -> "New Item1"
      ccpmenu(TPopupMenu)
      (TMenuItem) -> ""
      Cut2(TMenuItem) -> "Cut"
      Copy2(TMenuItem) -> "Copy"
      Paste2(TMenuItem) -> "Paste"
      ActionList1(TActionList)
      actSave(TAction) -> ""
      actOpen(TAction) -> ""
      actAutoAssemble(TAction) -> "actAutoAssemble"
      actMemoryView(TAction) -> "actMemoryView"
      actOpenProcesslist(TAction) -> ""
      actOpenDissectStructure(TAction) -> "actOpenDissectStructure"
      actOpenLuaEngine(TAction) -> "actOpenLuaEngine"
      UpdateFoundlisttimer(TTimer)
      AutoAttachTimer(TTimer)
      MainMenu1(TMainMenu)
      (TMenuItem) -> ""
      (TMenuItem) -> "English"
      (TMenuItem) -> "Save scan session"
      (TMenuItem) -> "Load scan session"
      (TMenuItem) -> "-"
      File1(TMenuItem) -> "&File"
      miAddTab(TMenuItem) -> "Add scan tab"
      New1(TMenuItem) -> "Clear list"
      MenuItem8(TMenuItem) -> "Open Process"
      miOpenFile(TMenuItem) -> "Open File"
      miSaveFile(TMenuItem) -> "Save File"
      N7(TMenuItem) -> "-"
      miSave(TMenuItem) -> "Save"
      Save1(TMenuItem) -> "Save As..."
      Load1(TMenuItem) -> "Load"
      miLoadRecent(TMenuItem) -> "Load Recent"
      miSignTable(TMenuItem) -> "Sign table"
      MenuItem3(TMenuItem) -> "-"
      miSaveScanresults(TMenuItem) -> "Save current scanresults"
      miDeleteSavedScanResults(TMenuItem) -> "Delete scanresult"
      MenuItem6(TMenuItem) -> "-"
      MenuItem9(TMenuItem) -> "Generate generic trainer lua script from table"
      MenuItem5(TMenuItem) -> "-"
      MenuItem7(TMenuItem) -> "Quit"
      Edit3(TMenuItem) -> "&Edit"
      Settings1(TMenuItem) -> "Settings"
      Process1(TMenuItem) -> "&Process"
      OpenProcess1(TMenuItem) -> "Open Process window"
      CreateProcess1(TMenuItem) -> "Create Process"
      N6(TMenuItem) -> "-"
      a1(TMenuItem) -> "a"
      b1(TMenuItem) -> "b"
      c1(TMenuItem) -> "c"
      d1(TMenuItem) -> "d"
      e1(TMenuItem) -> "e"
      miTable(TMenuItem) -> "Table"
      miShowLuaScript(TMenuItem) -> "Show Cheat Table Lua Script"
      MenuItem10(TMenuItem) -> "-"
      miCreateLuaForm(TMenuItem) -> "Create form"
      miResyncFormsWithLua(TMenuItem) -> "Resynchronize forms with Lua"
      miLuaFormsSeperator(TMenuItem) -> "-"
      miAddFile(TMenuItem) -> "Add file"
      mi3d(TMenuItem) -> "D3D"
      miHookD3D(TMenuItem) -> "Hook Direct3D"
      MenuItem11(TMenuItem) -> "-"
      miSetCrosshair(TMenuItem) -> "Set custom crosshair"
      miWireframe(TMenuItem) -> "Toggle wireframe mode"
      miZbuffer(TMenuItem) -> "Toggle disabled zbuffer"
      miLockMouseInGame(TMenuItem) -> "Lock mouse in game window"
      miSetupSnapshotKeys(TMenuItem) -> "Start and configure snapshot recording"
      miSnapshothandler(TMenuItem) -> "Snapshot handler"
      ools1(TMenuItem) -> "&Tools"
      miDotNET(TMenuItem) -> ".Net"
      miGetDotNetObjectList(TMenuItem) -> "Get object list"
      miNetwork(TMenuItem) -> "Network"
      miCompression(TMenuItem) -> "Compression"
      miScanDirtyOnly(TMenuItem) -> "Scan changed regions only"
      miScanPagedOnly(TMenuItem) -> "Scan paged (physical) memory only"
      Plugins2(TMenuItem) -> "P&lugins"
      miLanguages(TMenuItem) -> "Languages"
      miHelp(TMenuItem) -> "&Help"
      Helpindex1(TMenuItem) -> "Cheat Engine Help"
      miLuaDocumentation(TMenuItem) -> "Lua documentation"
      miTutorial(TMenuItem) -> "Cheat Engine Tutorial"
      MenuItem12(TMenuItem) -> "Cheat Engine Tutorial (64-Bit)"
      MenuItem15(TMenuItem) -> "Cheat Engine Tutorial Games"
      miEnableLCLDebug(TMenuItem) -> "Generate errorlogs"
      N8(TMenuItem) -> "-"
      miAbout(TMenuItem) -> "About"
      pmTablist(TPopupMenu)
      (TMenuItem) -> ""
      miRenameTab(TMenuItem) -> "Rename"
      miTablistSeperator(TMenuItem) -> "-"
      miCloseTab(TMenuItem) -> "Close tab"
      pmValueType(TPopupMenu)
      (TMenuItem) -> ""
      miDefineNewCustomType(TMenuItem) -> "Define new custom type (Auto Assembler)"
      miDefineNewCustomTypeLua(TMenuItem) -> "Define new custom type (LUA)"
      miEditCustomType(TMenuItem) -> "Edit selected custom type"
      miDeleteCustomType(TMenuItem) -> "Delete selected custom type"
      miShowCustomTypeDebug(TMenuItem) -> "Show custom type debug info"
      ColorDialog1(TColorDialog)
      pmResetRange(TPopupMenu)
      (TMenuItem) -> ""
      miResetRange(TMenuItem) -> "Reset range"
      pmScanRegion(TPopupMenu)
      (TMenuItem) -> ""
      miPresetAll(TMenuItem) -> "Preset: Scan all memory"
      miPresetWritable(TMenuItem) -> "Preset: Scan writable memory"
      MainMenu2(TMainMenu)
      (TMenuItem) -> ""
      tLuaGCPassive(TTimer)
      tLuaGCActive(TTimer)
      mfImageList(TImageList)
      frmAutoInject(TfrmAutoInject) -> "Lua script: Cheat Table"
      Panel1(TPanel) -> ""
      Panel3(TPanel) -> ""
      btnExecute(TButton) -> "Execute script"
      Panel2(TPanel) -> ""
      MainMenu1(TMainMenu)
      (TMenuItem) -> ""
      File1(TMenuItem) -> "File"
      miNewWindow(TMenuItem) -> "New Window"
      miNewTab(TMenuItem) -> "New Tab"
      Load1(TMenuItem) -> "Open"
      Save1(TMenuItem) -> "Save"
      SaveAs1(TMenuItem) -> "Save As..."
      miLuaSyntaxCheck(TMenuItem) -> "Syntax Check"
      Assigntocurrentcheattable1(TMenuItem) -> "Assign to current cheat table"
      N2(TMenuItem) -> "-"
      Exit1(TMenuItem) -> "Exit"
      View1(TMenuItem) -> "View"
      Syntaxhighlighting1(TMenuItem) -> "Syntax highlighting"
      MenuItem3(TMenuItem) -> "Auto assembler syntax highlighting preferences"
      MenuItem2(TMenuItem) -> "Lua syntax highlighting preferences"
      MenuItem1(TMenuItem) -> "C highlighting preferences"
      AAPref1(TMenuItem) -> "Preferences"
      emplate1(TMenuItem) -> "Template"
      Codeinjection1(TMenuItem) -> "Code injection"
      APIHook1(TMenuItem) -> "API Hook"
      Coderelocation1(TMenuItem) -> "Code relocation"
      miCallLua(TMenuItem) -> "Call CE lua function"
      menuAOBInjection(TMenuItem) -> "AOB Injection"
      menuFullInjection(TMenuItem) -> "Full Injection"
      CheatTablecompliantcodee1(TMenuItem) -> "Cheat Table framework code"
      Inject1(TMenuItem) -> "Inject"
      Injectincurrentprocess1(TMenuItem) -> "Inject into current process"
      Injectintocurrentprocessandexecute1(TMenuItem) -> "Inject into current process and execute"
      OpenDialog1(TOpenDialog)
      SaveDialog1(TSaveDialog)
      PopupMenu1(TPopupMenu)
      (TMenuItem) -> ""
      miCut(TMenuItem) -> "Cu&t"
      miCopy(TMenuItem) -> "&Copy"
      miPaste(TMenuItem) -> "&Paste"
      miUndo(TMenuItem) -> "&Undo"
      miRedo(TMenuItem) -> "Redo"
      N6(TMenuItem) -> "-"
      miFind(TMenuItem) -> "&Find..."
      mifindNext(TMenuItem) -> "Find Next"
      mifindPrevious(TMenuItem) -> "Find Previous"
      miReplace(TMenuItem) -> "Replace"
      TabMenu(TPopupMenu)
      (TMenuItem) -> ""
      miMoveLeft(TMenuItem) -> "Move left"
      miMoveRight(TMenuItem) -> "Move right"
      miRenameTab(TMenuItem) -> "Rename"
      Close1(TMenuItem) -> "Close"
      FindDialog1(TFindDialog)
      undotimer(TTimer)
      ReplaceDialog1(TReplaceDialog)
      aaImageList(TImageList)
      (TSynAASyn)
      (TSynCppSyn)
      (TSynLuaSyn)
      Assemblescreen(TSynEditPlus)
      (TSynBeautifier)
      SynLeftGutterPartList1(TSynGutterPartList)
      SynGutterMarks1(TSynGutterMarks)
      SynGutterLineNumber1(TSynGutterLineNumber)
      SynGutterChanges1(TSynGutterChanges)
      SynGutterSeparator1(TSynGutterSeparator)
      SynGutterCodeFolding1(TSynGutterCodeFolding)
      SynRightGutterPartList1(TSynRightGutterPartList)
      (TTimer)
      (TAddresslist) -> ""
      List(TTreeviewWithScroll)
      (TTimer)
      (TTimer)
      Header(THeaderControl)
      (TPopupMenu)
      (TMenuItem) -> ""
      (TMenuItem) -> "Sort on click"
      (TTimer)

      написал в CE Plugins ce plugin ce lua ce components
      MasterGHM
      MasterGH
    • Рубрика "Lua код сегодня" №4

      Иногда Lua-код слишком медленный, а на asm писать слишком много, тогда на помощь придет CCODE

      C inline вставки позволяют писать C-код вместо ассемблера
      Справочник по C-коду можно найти в Интернете.

      Примерчик будет:

      {$CCODE base=EBX}
         int* myHealth=base+0x4B0;
         *myHealth = 999;
      {$asm}
      
      [ENABLE]
      aobscanmodule(INJECT_test,Tutorial-i386.exe,29 83 B0 04 00 00) 
      alloc(newmem,$1000)
      label(code)
      label(return)
      
      newmem:
      {$CCODE base=EBX}
         int* myHealth=base+0x4B0;
         *myHealth = 999;
      {$asm}
      
      code:
        //sub [ebx+000004B0],eax
        jmp return
      
      INJECT_test:
        jmp newmem
        nop
      return:
      registersymbol(INJECT_test)
      
      [DISABLE]
      INJECT_test:
        db 29 83 B0 04 00 00
      
      unregistersymbol(INJECT_test)
      dealloc(newmem)
      
      {
      // ORIGINAL CODE - INJECTION POINT: Tutorial-i386.exe+25A6F
      
      Tutorial-i386.exe+25A49: 8D 55 DC           - lea edx,[ebp-24]
      Tutorial-i386.exe+25A4C: 8D 4D F4           - lea ecx,[ebp-0C]
      Tutorial-i386.exe+25A4F: E8 8C 7D FE FF     - call Tutorial-i386.exe+D7E0
      Tutorial-i386.exe+25A54: E8 37 E4 FD FF     - call Tutorial-i386.exe+3E90
      Tutorial-i386.exe+25A59: 50                 - push eax
      Tutorial-i386.exe+25A5A: 85 C0              - test eax,eax
      Tutorial-i386.exe+25A5C: 0F 85 CE 00 00 00  - jne Tutorial-i386.exe+25B30
      Tutorial-i386.exe+25A62: B8 05 00 00 00     - mov eax,00000005
      Tutorial-i386.exe+25A67: E8 C4 93 FE FF     - call Tutorial-i386.exe+EE30
      Tutorial-i386.exe+25A6C: 83 C0 01           - add eax,01
      // ---------- INJECTING HERE ----------
      Tutorial-i386.exe+25A6F: 29 83 B0 04 00 00  - sub [ebx+000004B0],eax
      // ---------- DONE INJECTING  ----------
      Tutorial-i386.exe+25A75: 8D 45 D4           - lea eax,[ebp-2C]
      Tutorial-i386.exe+25A78: E8 53 DF FD FF     - call Tutorial-i386.exe+39D0
      Tutorial-i386.exe+25A7D: 8B 83 B0 04 00 00  - mov eax,[ebx+000004B0]
      Tutorial-i386.exe+25A83: 68 FF 00 00 00     - push 000000FF
      Tutorial-i386.exe+25A88: 8D 8D D4 FE FF FF  - lea ecx,[ebp-0000012C]
      Tutorial-i386.exe+25A8E: BA FF FF FF FF     - mov edx,FFFFFFFF
      Tutorial-i386.exe+25A93: E8 68 F2 FD FF     - call Tutorial-i386.exe+4D00
      Tutorial-i386.exe+25A98: 8D 4D D4           - lea ecx,[ebp-2C]
      Tutorial-i386.exe+25A9B: 66 31 D2           - xor dx,dx
      Tutorial-i386.exe+25A9E: 8D 85 D4 FE FF FF  - lea eax,[ebp-0000012C]
      }
      
      написал в Статьи и видео ce ccode ce aa ce memrec обучалка
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      Ок, посмотрю

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      @Pitronic посмотрю завтра

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Защита Трейнера
      \-- если процесс не открыт, то подкючиться к нему
      if (getProcessIDFromProcessName("Pet Show Craze.exe")==nil) then
           OpenProcess("Pet Show Craze.exe")
           И здесь останови таймер пока
      end
      

      Тем самым ты подключишь процесс.

      Далее жди события подключения процесса. Как его ждать? Ищем в справке

      onOpenProcess(processid):
      

      После подключения вызввай активацию записи

      function onOpenProcess(processid)
         SetStateRecord("Activation", true)
      end
      

      Попробуй сам расписать на бумаги логику.

      Сначала проверяем открыт ли процесс.
      Если нет, то открыть его. Перед тем как его открыть, то, наверно, надо подождать события его открытия onOpenProcess(processid), а после этого события активировать запись.

      Или подожди до вечера пятницы. Как дома буду запущу ce 7.5. За 5 минут разберешься.

      Я сейчас, пока не могу ответить нормально без cheat engibe с телефона

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      Наверно CE у меня 6.8.3 была на старом ноуте, с которого писал. А сейчас я с телефона, уставший с работы. С 8ми утра кодили до позднего вечера. Позже, наверно, напишу, как отдохну. Можешь написать больше вопросов

      P.s Пиши, пожалуйста, мне на "ты", а то не удобно себя чувствую.

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      Судя по названию ошибки нет закрывающих скобок для текста.
      local aa_script =
      [[
      Здесь текст
      ]]

      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      Да, можно. Скорее всего, желательно для флагов отдельную память делать. Чтобы флаги были выровнены по адресам и не смешивались с опкодами. Можно, этого и не делать. На твое усмотрение.

      написал в Вопросы
      MasterGHM
      MasterGH
    • Рубрика "Lua код сегодня" №3

      1befdd4e-3df6-44c7-b7d6-c916953906e3-изображение.png

      Создать пустую запись чтобы пробовать вывод названия записи через lua

      {$lua}
      print(memrec.Description)
      [ENABLE]
      print('is  on')
      [DISABLE]
      print('is  off')
      

      a351481e-040c-40a1-bb88-b011c5633f53-изображение.png

      Поля memrec многочисленны и описываются в документации. См. MemoryRecord Class: в ...\Cheat Engine 6.8.3\celua.txt

      написал в Статьи и видео ce memrec ce aa ce lua ce .ct обучалка
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      У меня другая версия CE

      local aa_script = [[aobscanmodule(INJECT,Tutorial-x86_64.exe,29 93 90 07 00 00) // should be unique
      alloc(newmem,$1000,"Tutorial-x86_64.exe"+2B2D7)
      alloc(newmem2,$1000,"Tutorial-x86_64.exe"+2B2D7)
      registersymbol(flag)
      label(code)
      label(return)
      
      newmem2:
      flag:
      dd 0
      
      newmem:
      
      code:
        sub [rbx+00000790],edx
        jmp return
      
      INJECT:
        jmp newmem
        nop
      return:
      
      registersymbol(INJECT)]]
      
      autoAssemble(aa_script)
      
      написал в Вопросы
      MasterGHM
      MasterGH
    • Асинхронное выполнение сценариев

      Записи в таблице CE представим как сценарии, которые должны выполнятся асинхронно. Т.е. они что-от делают некоторое время одновременно, например, сканируют память. При этом ничего зависает.

      Для этого будем актировать такую опцию
      5a911696-ae56-4772-bf1e-7b32fab46d53-изображение.png

      Если эту опцию поставить на записи, то появляются вот такие часики
      29546916-8f04-4fa5-99df-d43ae5016af3-изображение.png

      АА-шные скрипты могут искать в этот момент сигнатуру.

      Lua скрипты потестить было интересно, узнать действительно ли асинхронно выполняется. Например, один скрипт выполняет счет, второй выполняет счет. По выполнении выводится результат.

      [ENABLE]
      {$lua}
        local _, counter, _, async = memrec.Description:match('(Cunt.=.)(%d*).*(Async.=.)(%w*)')
        memrec.Async = async == 'true'
        for i = 1, counter do end
        local currentTime = os.date("%c"):gsub('/','.')
        print('Finish record:' .. memrec.Description..', at time ' .. currentTime)
        memrec.Active = false
      
        function onMemRecPostExecute(memoryrecord, newState, succeeded)
         if (memoryrecord == memrec and newState == true) then
           memrec.Active = false
         end
        end
      {$asm}
      [DISABLE]
      

      03992ff1-2202-400d-9c53-71d3d71d4163-изображение.png

      После выполнения
      b8fdfa10-52dd-4ad2-8ede-445f363c967c-изображение.png

      Если продублировать 4 скрипта, то видим, что нельзя запустить асинхронно более двух скриптов
      c0aeea14-3aa7-457c-9685-f1fb4bc3859f-изображение.png

      Вот такой вариант еще

      [ENABLE]
      {$Lua}
        function threadFunction(th)
          th.freeOnTerminate(false)
          th.Name = 'myThread'
          for b = 1, 200000000 do
            --checkSynchronize()
          end
          --while not th.Terminated do
          --  myvar=myvar+1
          --  synchronize(function() MainForm.Caption = 'myvar '..myvar end)
           -- sleep(2000)
          --end
          synchronize(function() print("1") end)
        end
      
        --myvar=0
        local myThread = createNativeThreadSuspended(threadFunction)
        myThread.resume()
      {$Asm}
      
      [DISABLE]
      {$Lua}
        if myThread then
           myThread.terminate()
           myThread.waitfor()
           myThread.destroy()
           myThread=nil
        end
      {$Asm}
      

      таблица
      Asynchronous testing.CT

      написал в Статьи и видео ce .ct ce aa ce async фишки
      MasterGHM
      MasterGH
    • Рубрика "Lua код сегодня" №2
      local address = 0x0170A490
      local x, y, z = 0, 100, 100
      writeDouble(address, x)
      writeDouble(address + 8, y)
      writeDouble(address + 16, z)
      

      Данный код позволяет записать значение координат и переместить персонажа.
      Обычно, адреса координат идут последовательно x,y,z и имеют тип float или double.

      Чтобы переместить персонажа нужно узнать его адрес координат и выполнить код в Lua консоли
      30d5c11d-7b9e-4706-a9c9-221f601d2731-изображение.png

      И убедиться, что данные записались в память процесса
      0e82af37-125b-41b1-9331-fe1bbc2f3042-изображение.png

      Далее мы с вами будем очень много программировать короткими примерами в консоли управляя данными процесса и в том числе связывать это с базами данных. Например, такой-то пользователь, для такого-то персонажа создал таблицу телепортации с локациями и координатами. Этой таблицей можно будет очень удобно пользоваться. Также вы изучите принцип программирования, который используется при работе с СУБД.

      написал в Статьи и видео ce lua обучалка
      MasterGHM
      MasterGH
    • RE: Сделать большой брейкпоинт на структуру через dbk_useKernelmodeOpenProcess

      Пользователь @Pitronic написал в Сделать большой брейкпоинт на структуру через dbk_useKernelmodeOpenProcess:

      Мы знаем что адрес таймера на выстрел во первых лежит в одной структуре с патронами, во вторых адрес в начале меняется в момент выстрела одновременно с уменьшением патронов и в пределах от одной до 100 миллисекунд возвращается в прежнее значение. может lua скрипт специальный можно сделать?

      Я бы сделал без скриптов.

      1. делаешь dessect structure
        6b8ca47d-ed90-46ea-95e7-cd454196cb74-изображение.png
      2. Далее как обычно. Создаешь структуру. Затем вот это (следить за изменениями)
        17867765-a66b-43e9-9242-482b0b8c7cf3-изображение.png
      3. ну а дальше воспроизводишь свой выстрел
      4. потом создаешь структуру из изменившихся данных (потому что их будешь очень много наверняка)
        783b72ad-84e9-4444-9d5f-c02f5beb20c3-изображение.png
      5. затем делаешь lock на структуру, чтобы значения зафиксирвать
        a8243497-20b9-4ad1-9a14-056b452cace1-изображение.png
      6. затем рядом создаешь второй ряд по ctrl +a и смотрим изменения в реальном времени (игра должна быть в оконном режим, чтобы мы видели как цифры скачут)
        227628c2-13fe-485d-8632-0defed52710b-изображение.png
      7. чтобы увидеть изменения менее 100мс нужно поставить интервал меньше
        5dff820a-cb72-45a6-b625-04112696daec-изображение.png

      По идее это должно сработать

      написал в Статьи и видео
      MasterGHM
      MasterGH
    • RE: Делаем EFLAGS таблицу

      Ответил

      написал в Статьи и видео
      MasterGHM
      MasterGH
    • RE: Защита Трейнера

      Пользователь @Pitronic написал в Защита Трейнера:

      Я как понял это скрипт в таблицу

      Этот скрипт не в таблицу. Ты можешь писать свои флаги здесь

      local scriptStr = [[
      [ENABLE]
      // здесь твой флаг
      
      [DISABLE]
      // здесь твой флаг
      ]]
      local enabledOk, disableInfo = autoAssemble(scriptStr)
      
      if enabledOk then
        print('>The auto assembler script was enabled successfully.')
      else
        print('>There was an error enabling the auto assembler script.')
      end
      
      print(disableInfo)
      local disabledOk = autoAssemble(scriptStr, disableInfo)
      
      if disabledOk then
        disableInfo = nil
        print('>The auto assembler script was disabled successfully.')
      else
        print('>There was an error disabling the auto assembler script.')
      end
      
      написал в Вопросы
      MasterGHM
      MasterGH
    • RE: Пошаговая отладка Lua скриптов

      Открываем Lua консоль из дизассемблера

      Пишем Lua скрипт

      Дальше по шагам как на картинке
      e5a13ca4-cfba-4cba-ad07-6e9f2b56197b-изображение.png

      Если мы пишем какую-то функцию и она дает сбой, то её можно отладить как на скриншоте. Это может быть и не функция.

      Например, код прочитал какой-то файл с текстом сохраненных параметров и подсмотрели в пошаговой Lua отладке что происходит дальше.

      *Действуют горячие клавиши. Например, F7— шаг, F9 — запуск без остановки.

      написал в Статьи и видео
      MasterGHM
      MasterGH
    • Делаем EFLAGS таблицу

      Таблица флагов нужна для определения срабатывания условного прыжка в пошаговой отладке
      8d7c71bd-be7f-45d5-85c8-7065520c965c-изображение.png
      6ad9a581-7655-44b3-a163-52849b60de83-изображение.png

      function ToBits(num, bits)
      	local t = {}
      	for b = bits, 1, -1 do
      		rest = math.fmod(num,2)
      		t[b] = math.floor(rest)
      		num = (num-rest)/2
      	end
      	
      	if num == 0 then
      		return t
      	else
      		return {'Not enough bits to represent this number'}
      	end
      end
      
      local bitsTable = ToBits(EFLAGS, 16)
      
      local tableEFLAGS =
      {
      	OF = bitsTable[17-12],
      	DF = bitsTable[17-11],
      	SF = bitsTable[17-8],
      	ZF = bitsTable[17-7],
      	AF = bitsTable[17-5],
      	PF = bitsTable[17-3],
      	CF = bitsTable[17-1]
      }
      
      for k,v in pairs(tableEFLAGS) do
      	print (k..' = '..v)
      end
      
      print(EFLAGS)
      local s = ''
      for i=1,#bitsTable do
      	s = s..bitsTable[i]
      end
      print(s)
      
      написал в Статьи и видео шаблоны фишки ce lua
      MasterGHM
      MasterGH
    • Выход из рутины до ближайшего цикла

      собенности

      1. переход на следующий адрес по инструкциям ветвления вычисляется Lua кодом по ret, jmp, jmp condition до исполнения кода
      2. определение опкодов ветвления по readmem без дизассемблериования
      3. по тестам последний брейкпоинт снимается на ближайшем цикле

      Пример лога до близжайшего цикла, когда поднимается из рутины вверх

      > RET    :00454684 - C3 - ret  
      > -->>    :0045468C - 5B - pop ebx
      > RET    :0045468F - C3 - ret  
      > -->>    :00454695 - C3 - ret  
      > RET    :00454695 - C3 - ret  
      > -->>    :00437F36 - 5B - pop ebx
      > RET    :00437F37 - C3 - ret  
      > -->>    :004272EB - 5B - pop ebx
      > RET    :004272EC - C3 - ret  
      > -->>    :004273E9 - 5E - pop esi
      > RET    :004273EA - C3 - ret  
      > -->>    :00437A2E - 5F - pop edi
      > RET    :00437A34 - C3 - ret  
      > -->>    :0043B749 - 5B - pop ebx
      > RET    :0043B74D - C3 - ret  
      > -->>    :00427195 - 5F - pop edi
      > RET    :00427198 - C3 - ret  
      > -->>    :004376BB - 8B 45 FC  - mov eax,[ebp-04]
      > RET    :004376C2 - C2 0400 - ret 0004
      > -->>    :0043B880 - 89 46 0C  - mov [esi+0C],eax
      > RET    :0043B88A - C3 - ret  
      > -->>    :0043BFF4 - 84 C0  - test al,al
      > isCJMP    :0043BFF6 - 75 09 - jne 0043C001
      > RET    :0043C003 - C3 - ret  
      > -->>    :0044DFAD - 5E - pop esi
      > RET    :0044DFAF - C3 - ret  
      > -->>    :00437A2E - 5F - pop edi 
      
      \--[[
      	Версия: 0.01.b1
      	Выход из рутины до близжайшего цикла
      ]]--
      
      mainAddress = 0x0045B5A4 -- адрес некоторого параметра в игре
      nextAddress = nil
      is64bits = targetIs64Bit()
      
      tableInstruction ={}
      tableBreakpointsAddress ={}
      
      
      function ContaintsBeakPoint(address)
      	for i = 1, #tableBreakpointsAddress do
      		if tableBreakpointsAddress[i] == address then
      			return true
      		end
      	end
      	return false
      end
      
      \-- Возвращает адрес по ret
      function GetNextAddressFromRET(address)
      	if is64bits then
      		nextAddress = readPointer(RSP)
      	else
      		nextAddress = readPointer(ESP)
      	end
      	return nextAddress
      end
      \-- Возвращает адрес по Jmp
      function GetNextAddressFromJMP(address)
      	local disassembledstring = nil
      	if is64bits then
      		local disassembledstring = disassemble(RIP)
      	else
      		local disassembledstring = disassemble(EIP)
      	end
      	local _, opcode, _, _ = splitDisassembledString(disassembledstring)
      	return GetAddressFromOpcode(opcode)
      end
      
      
      function ToBits(num, bits)
      	local t = {}
      	for b = bits, 1, -1 do
      		rest = math.fmod(num,2)
      		t[b] = math.floor(rest)
      		num = (num-rest)/2
      	end
      	
      	if num == 0 then
      		return t
      	else
      		return {'Not enough bits to represent this number'}
      	end
      end
      
      
      function GetEFLAGS()
      	local bitsTable = ToBits(EFLAGS, 16)
      
      	local tableEFLAGS =
      	{
      		OF = bitsTable[17-12],
      		DF = bitsTable[17-11],
      		SF = bitsTable[17-8],
      		ZF = bitsTable[17-7],
      		AF = bitsTable[17-5],
      		PF = bitsTable[17-3],
      		CF = bitsTable[17-1]
      	}
      	
      	--for k,v in pairs(tableEFLAGS) do
      	--	print (k..' = '..v)
      	--end
      	--
      	--print(EFLAGS)
      	--local s = ''
      	--for i=1,#bitsTable do
      	--	s = s..bitsTable[i]
      	--end
      	--print(s)		
      	return tableEFLAGS	
      end
      
      \-- Возвращает адрес из опкода jmp dword ptr [edi*4+07895D88] или jmp 07895D88
      \--print(string.format('%08X', newAddress))
      function GetAddressFromOpcode (opcode)
      
      	local rightLine = string.match(opcode, '%S*%s*(%S*)')
      	local isPointer = string.match(opcode, '%[')
      	if isPointer then
      		rightLine = string.match(opcode, '%[(.*)%]')
      		--00454664 - 8B 83 60030000        - mov eax,[ebx+00000360]
      		if string.match(opcode, 'eax') then rightLine = string.gsub(rightLine, 'eax', EAX) end
      		if string.match(opcode, 'ebx') then rightLine = string.gsub(rightLine, 'ebx', EBX) end
      		if string.match(opcode, 'ecx') then rightLine = string.gsub(rightLine, 'ecx', ECX) end
      		if string.match(opcode, 'edx') then rightLine = string.gsub(rightLine, 'edx', EDX) end
      		if string.match(opcode, 'esi') then rightLine = string.gsub(rightLine, 'esi', ESI) end
      		if string.match(opcode, 'edi') then rightLine = string.gsub(rightLine, 'edi', EDI) end
      		if string.match(opcode, 'esp') then rightLine = string.gsub(rightLine, 'esp', ESP) end
      		if string.match(opcode, 'ebp') then rightLine = string.gsub(rightLine, 'ebp', EBP) end
      		
      		if is64bits then
      			if string.match(opcode, 'rax') then rightLine = string.gsub(rightLine, 'rax', RAX) end
      			if string.match(opcode, 'rbx') then rightLine = string.gsub(rightLine, 'rbx', RBX) end
      			if string.match(opcode, 'rcx') then rightLine = string.gsub(rightLine, 'rcx', RCX) end
      			if string.match(opcode, 'rdx') then rightLine = string.gsub(rightLine, 'rdx', RDX) end
      			if string.match(opcode, 'rsi') then rightLine = string.gsub(rightLine, 'rsi', RSI) end
      			if string.match(opcode, 'rdi') then rightLine = string.gsub(rightLine, 'rdi', RDI) end
      			if string.match(opcode, 'rsp') then rightLine = string.gsub(rightLine, 'rsp', RSP) end
      			if string.match(opcode, 'rbp') then rightLine = string.gsub(rightLine, 'rbp', RBP) end
      			
      			if string.match(opcode, 'r8') then rightLine = string.gsub(rightLine, 'r8', R8) end
      			if string.match(opcode, 'r9') then rightLine = string.gsub(rightLine, 'r9', R9) end
      			if string.match(opcode, 'r10') then rightLine = string.gsub(rightLine, 'r10', R10) end
      			if string.match(opcode, 'r11') then rightLine = string.gsub(rightLine, 'r11', R11) end
      			if string.match(opcode, 'r12') then rightLine = string.gsub(rightLine, 'r12', R12) end
      			if string.match(opcode, 'r13') then rightLine = string.gsub(rightLine, 'r13', R13) end
      			if string.match(opcode, 'r14') then rightLine = string.gsub(rightLine, 'r14', R14) end
      			if string.match(opcode, 'r15') then rightLine = string.gsub(rightLine, 'r15', R15) end
      		end
      		
      		return getAddress('%['..rightLine..'%]')
      	end
      	
      	return getAddress(rightLine)
      end
      
      \-- Возвращает адрес по Jmp condition, когда тот выполняется или не выполняется
      function GetNextAddressFromConditionJMP(address, size)
      
      	local _,opcode,_,_ = splitDisassembledString(disassemble(address))
      	local leftString = string.match(opcode, '%S*')
      	local eflags = GetEFLAGS()
      	
      	if (leftString == 'jnz' or leftString == 'jne') 										then	if eflags.ZF == 0 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'je' or leftString == 'jz') 								then if eflags.ZF == 1 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jg' or leftString == 'jnle')								then if eflags.ZF == 0 and eflags.SF == eflags.OF 	then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jb' or leftString == 'jc' or leftString == 'jnae') 	then if eflags.CF == 1 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jae')															then	if eflags.CF == 0											then return GetAddressFromOpcode(opcode) end 
      		elseif (leftString == 'ja') 															then if eflags.CF == 0 and eflags.ZF == 0 				then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jbe') 															then if eflags.CF == 1 and eflags.ZF == 1 				then return GetAddressFromOpcode(opcode) end	
      		elseif (leftString == 'jl' or leftString == 'jnge') 								then if eflags.SF ~= eflags.OF 								then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jle' or leftString == 'jng') 								then if eflags.ZF == 1 or eflags.SF ~= eflags.OF 		then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jna') 															then if eflags.CF == 1 or eflags.ZF == 1 					then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jc') 															then if eflags.CF == 1 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jp' or leftString == 'jpe') 								then	if eflags.PF == 1											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jnp' or leftString == 'jpo') 								then if eflags.PF == 0 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jnb' or leftString == 'jnc') 								then if eflags.CF == 0 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jnbe') 														then if eflags.CF == 0 and eflags.ZF == 0 				then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jno') 															then	if eflags.OF == 0 											then return GetAddressFromOpcode(opcode) end	
      		elseif (leftString == 'jns') 															then	if eflags.SF == 0 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jo') 															then if eflags.OF == 1 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'js') 															then if eflags.SF == 1 											then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jge' or leftString == 'jnl') 								then if eflags.CF == 1 and eflags.OF == 1 				then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jrcxz') 														then if RCX == 0 												then return GetAddressFromOpcode(opcode) end
      		elseif (leftString == 'jecxz') 														then if ECX == 0 												then return GetAddressFromOpcode(opcode) end
      	end
      	return address + size
      end
      
      function IsRet(address)
         local value = readBytes(address,1, false)
         return value == 0xC3 or value == 0xCB or  value == 0xC2 or value == 0xCA
      end
      
      function IsCall(address)
         local value = readBytes(address,1, false)
         return value == 0xFF or value == 0xE8 -- or  value == 0x9A
      end
      
      function IsJMP(address)
      	local value = readBytes (address, 1, false)
      	if value == 0xFF then
      		if readBytes (address + 1, 1, false) == 05 then
      			return false
      		end
      	end
      	return value == 0xEB or value == 0xE9 or  value == 0xFF -- or value == 0xEA
      \--[[
      	078921A8 - EB 38                 		- jmp 078921E2
      	0789242D - E9 E2000000     			- jmp 07892514
      	07894F4C - FF E2                 			- jmp edx
      	07895C67 - FF 24 BD 885D8907     - jmp dword ptr [edi*4+07895D88]
      ]]--	
      end
      
      
      
      
      function IsConditionJMP(address)
      	local value = readBytes (address, 1, false)
      	return  
      		value == 0x77 or value == 0x73 or value == 0x72 or value == 0x76 or
      		value == 0xE3 or value == 0x74 or value == 0x7F or value == 0x7D or
      		value == 0x7C or value == 0x7E or value == 0x75 or value == 0x71 or
      		value == 0x7B or value == 0x79 or value == 0x70 or value == 0x7A or
      		value == 0x78 or value == 0x0F
      end
      
      \-- Возвращает адрес, на который, будет прыжок
      function GetNextAddress(addressXIP)
      	-- Определить на какой инструкции мы находимся, чтобы узнать на какую следующу инструкцию ставить бряк
      	-- ret				- прыжок по смещению ESP/RSP
      	-- jmp				- прыжок без условия
      	-- je, jne, jxx	- прыжок с улосвием
      	
      	-- Определить размер инструкции, тип инструкции на текущем addressXIP
      	local findIndex = -1
      	for i = 1, #tableInstruction do
      		if tableInstruction[i].XIP == addressXIP then
      			findIndex = i
      			break
      		end
      	end
      	
      	local size = 0
      	local isRet = false
      	local isJMP = false
      	local isCJMP = false
      		
      	if findIndex ==  -1 then
      		-- Если нет данных
      		---------------- ЗАПОМИНАТЬ РАЗМЕР ИНСТРУКЦИИ (чтобы не дизассемблировать повторно)
      		size = getInstructionSize(addressXIP)
      		isRet = IsRet(addressXIP)
      		isJMP = IsJMP(addressXIP)
      		isCJMP = IsConditionJMP(addressXIP)
      		table.insert(tableInstruction, {XIP = addressXIP, SIZE = size, ISRET = isRet, ISJMP = isJMP,  ISCJMP = isCJMP})
      	else
      		-- Если данные есть
      		size = tableInstruction[findIndex].SIZE
      		isRet = tableInstruction[findIndex].ISRET
      		isJMP = tableInstruction[findIndex].ISJMP
      		isCJMP = tableInstruction[findIndex].ISCJMP
      	end	
      	---------------
      	
      	if isRet then
      		print('> RET	:' ..disassemble(nextAddress))
      		nextAddress = GetNextAddressFromRET(addressXIP)
      		print('> -->>	:' ..disassemble(nextAddress))
      	elseif isJMP then
      		print('> isJMP	:' ..disassemble(nextAddress))
      		nextAddress =  GetNextAddressFromJMP(addressXIP)
      	elseif isCJMP then
      		print('> isCJMP	:' ..disassemble(nextAddress))
      		nextAddress = GetNextAddressFromConditionJMP(addressXIP, size)
      	else
      		nextAddress = addressXIP + size
      	end
      	
      	return nextAddress
      end
      
      
      function debugger_onBreakpoint()
      
      	local isContaintsBreakPoint = false
      	
      	-- Удалить прошлый брейкпоинт
      	if(nextAddress ~= nil) then
      		 isContaintsBreakPoint = ContaintsBeakPoint(nextAddress)
      		 if isContaintsBreakPoint then
      			debug_removeBreakpoint(nextAddress)
      		end
      	end	
      	
      	-- Поставить брейкпоинт на следующую инструкцию не входя в call-ы
      	local XIP = 0
      	if is64bits then XIP = EIP	else	XIP = RIP end
      	
      	nextAddress = GetNextAddress(XIP)
      	if not ContaintsBeakPoint(nextAddress) then
      		debug_setBreakpoint(nextAddress, 1, bptExecute, bpmDebugRegister)
      		table.insert(tableBreakpointsAddress, nextAddress)
      	end
      	
      	return 1 --1 не показывать дизассемблер
      end
      
      if getOpenedProcessID() == 0 then
        openProcess('test.exe')
      end
      
      
      \--bptWrite
      \--bptAccess
      debug_removeBreakpoint()
      debug_setBreakpoint(mainAddress, 4, bptWrite, bpmDebugRegister)
      

      Справка

      77 cb JA rel8 D Valid Valid Jump short if above (CF=0 and ZF=0).
      73 cb JAE rel8 D Valid Valid Jump short if above or equal (CF=0).
      72 cb JB rel8 D Valid Valid Jump short if below (CF=1).
      76 cb JBE rel8 D Valid Valid Jump short if below or equal (CF=1 or ZF=1).
      72 cb JC rel8 D Valid Valid Jump short if carry (CF=1).
      E3 cb JCXZ rel8 D N.E. Valid Jump short if CX register is 0.
      E3 cb JECXZ rel8 D Valid Valid Jump short if ECX register is 0.
      E3 cb JRCXZ rel8 D Valid N.E. Jump short if RCX register is 0.
      74 cb JE rel8 D Valid Valid Jump short if equal (ZF=1).
      7F cb JG rel8 D Valid Valid Jump short if greater (ZF=0 and SF=OF).
      7D cb JGE rel8 D Valid Valid Jump short if greater or equal (SF=OF).
      7C cb JL rel8 D Valid Valid Jump short if less (SF≠ OF).
      7E cb JLE rel8 D Valid Valid Jump short if less or equal (ZF=1 or SF≠ OF).
      76 cb JNA rel8 D Valid Valid Jump short if not above (CF=1 or ZF=1).
      72 cb JNAE rel8 D Valid Valid Jump short if not above or equal (CF=1).
      73 cb JNB rel8 D Valid Valid Jump short if not below (CF=0).
      77 cb JNBE rel8 D Valid Valid Jump short if not below or equal (CF=0 andZF=0).
      73 cb JNC rel8 D Valid Valid Jump short if not carry (CF=0).
      75 cb JNE rel8 D Valid Valid Jump short if not equal (ZF=0).
      7E cb JNG rel8 D Valid Valid Jump short if not greater (ZF=1 or SF≠ OF).
      7C cb JNGE rel8 D Valid Valid Jump short if not greater or equal (SF≠ OF).
      7D cb JNL rel8 D Valid Valid Jump short if not less (SF=OF).
      7F cb JNLE rel8 D Valid Valid Jump short if not less or equal (ZF=0 and SF=OF).
      71 cb JNO rel8 D Valid Valid Jump short if not overflow (OF=0).
      7B cb JNP rel8 D Valid Valid Jump short if not parity (PF=0).
      79 cb JNS rel8 D Valid Valid Jump short if not sign (SF=0).
      75 cb JNZ rel8 D Valid Valid Jump short if not zero (ZF=0).
      70 cb JO rel8 D Valid Valid Jump short if overflow (OF=1).
      7A cb JP rel8 D Valid Valid Jump short if parity (PF=1).
      7A cb JPE rel8 D Valid Valid Jump short if parity even (PF=1).
      7B cb JPO rel8 D Valid Valid Jump short if parity odd (PF=0).
      78 cb JS rel8 D Valid Valid Jump short if sign (SF=1).
      74 cb JZ rel8 D Valid Valid Jump short if zero (ZF = 1).
      0F 87 cw JA rel16 D N.S. Valid Jump near if above (CF=0 and ZF=0). Not supported in 64-bit mode.
      0F 87 cd JA rel32 D Valid Valid Jump near if above (CF=0 and ZF=0).
      0F 83 cw JAE rel16 D N.S. Valid Jump near if above or equal (CF=0). Not supported in 64-bit mode.
      0F 83 cd JAE rel32 D Valid Valid Jump near if above or equal (CF=0).
      0F 82 cw JB rel16 D N.S. Valid Jump near if below (CF=1). Not supported in 64-bit mode.
      0F 82 cd JB rel32 D Valid Valid Jump near if below (CF=1).
      0F 86 cw JBE rel16 D N.S. Valid Jump near if below or equal (CF=1 or ZF=1). Not supported in 64-bit mode.
      0F 86 cd JBE rel32 D Valid Valid Jump near if below or equal (CF=1 or ZF=1).
      0F 82 cw JC rel16 D N.S. Valid Jump near if carry (CF=1). Not supported in 64-bit mode.
      0F 82 cd JC rel32 D Valid Valid Jump near if carry (CF=1).
      0F 84 cw JE rel16 D N.S. Valid Jump near if equal (ZF=1). Not supported in 64-bit mode.
      0F 84 cd JE rel32 D Valid Valid Jump near if equal (ZF=1).
      0F 84 cw JZ rel16 D N.S. Valid Jump near if 0 (ZF=1). Not supported in 64-bit mode.
      0F 84 cd JZ rel32 D Valid Valid Jump near if 0 (ZF=1).
      0F 8F cw JG rel16 D N.S. Valid Jump near if greater (ZF=0 and SF=OF). Notsupported in 64-bit mode.
      0F 8F cd JG rel32 D Valid Valid Jump near if greater (ZF=0 and SF=OF).
      0F 8D cw JGE rel16 D N.S. Valid Jump near if greater or equal (SF=OF). Not supported in 64-bit mode.
      0F 8D cd JGE rel32 D Valid Valid Jump near if greater or equal (SF=OF).
      0F 8C cw JL rel16 D N.S. Valid Jump near if less (SF≠ OF). Not supported in 64-bit mode.
      0F 8C cd JL rel32 D Valid Valid Jump near if less (SF≠ OF).
      0F 8E cw JLE rel16 D N.S. Valid Jump near if less or equal (ZF=1 or SF≠ OF). Not supported in 64-bit mode.
      0F 8E cd JLE rel32 D Valid Valid Jump near if less or equal (ZF=1 or SF≠ OF). 
      0F 86 cw JNA rel16 D N.S. Valid Jump near if not above (CF=1 or ZF=1). Not supported in 64-bit mode.
      0F 86 cd JNA rel32 D Valid Valid Jump near if not above (CF=1 or ZF=1).
      0F 82 cw JNAE rel16 D N.S. Valid Jump near if not above or equal (CF=1). Not supported in 64-bit mode.
      0F 82 cd JNAE rel32 D Valid Valid Jump near if not above or equal (CF=1).
      0F 83 cw JNB rel16 D N.S. Valid Jump near if not below (CF=0). Not supported in 64-bit mode.
      0F 83 cd JNB rel32 D Valid Valid Jump near if not below (CF=0).
      0F 87 cw JNBE rel16 D N.S. Valid Jump near if not below or equal (CF=0 and ZF=0). Not supported in 64-bit mode.
      0F 87 cd JNBE rel32 D Valid Valid Jump near if not below or equal (CF=0 and ZF=0).
      0F 83 cw JNC rel16 D N.S. Valid Jump near if not carry (CF=0). Not supported in 64-bit mode.
      0F 83 cd JNC rel32 D Valid Valid Jump near if not carry (CF=0).
      0F 85 cw JNE rel16 D N.S. Valid Jump near if not equal (ZF=0). Not supported in 64-bit mode.
      0F 85 cd JNE rel32 D Valid Valid Jump near if not equal (ZF=0).
      0F 8E cw JNG rel16 D N.S. Valid Jump near if not greater (ZF=1 or SF≠ OF). Not supported in 64-bit mode.
      0F 8E cd JNG rel32 D Valid Valid Jump near if not greater (ZF=1 or SF≠ OF).
      0F 8C cw JNGE rel16 D N.S. Valid Jump near if not greater or equal (SF≠ OF). Not supported in 64-bit mode.
      0F 8C cd JNGE rel32 D Valid Valid Jump near if not greater or equal (SF≠ OF). 
      0F 8D cw JNL rel16 D N.S. Valid Jump near if not less (SF=OF). Not supported in 64-bit mode.
      0F 8D cd JNL rel32 D Valid Valid Jump near if not less (SF=OF).
      0F 8F cw JNLE rel16 D N.S. Valid Jump near if not less or equal (ZF=0 and SF=OF). Not supported in 64-bit mode.
      0F 8F cd JNLE rel32 D Valid Valid Jump near if not less or equal (ZF=0 and SF=OF).
      0F 81 cw JNO rel16 D N.S. Valid Jump near if not overflow (OF=0). Not supported in 64-bit mode.
      0F 81 cd JNO rel32 D Valid Valid Jump near if not overflow (OF=0).
      0F 8B cw JNP rel16 D N.S. Valid Jump near if not parity (PF=0). Not supported in 64-bit mode.
      0F 8B cd JNP rel32 D Valid Valid Jump near if not parity (PF=0).
      0F 89 cw JNS rel16 D N.S. Valid Jump near if not sign (SF=0). Not supported in 64-bit mode.
      0F 89 cd JNS rel32 D Valid Valid Jump near if not sign (SF=0).
      0F 85 cw JNZ rel16 D N.S. Valid Jump near if not zero (ZF=0). Not supported in 64-bit mode.
      0F 85 cd JNZ rel32 D Valid Valid Jump near if not zero (ZF=0).
      0F 80 cw JO rel16 D N.S. Valid Jump near if overflow (OF=1). Not supported in 64-bit mode.
      0F 80 cd JO rel32 D Valid Valid Jump near if overflow (OF=1).
      0F 8A cw JP rel16 D N.S. Valid Jump near if parity (PF=1). Not supported in 64-bit mode.
      0F 8A cd JP rel32 D Valid Valid Jump near if parity (PF=1).
      0F 8A cw JPE rel16 D N.S. Valid Jump near if parity even (PF=1). Not supported in 64-bit mode.
      0F 8A cd JPE rel32 D Valid Valid Jump near if parity even (PF=1).
      0F 8B cw JPO rel16 D N.S. Valid Jump near if parity odd (PF=0). Not supported in 64-bit mode.
      0F 8B cd JPO rel32 D Valid Valid Jump near if parity odd (PF=0).
      0F 88 cw JS rel16 D N.S. Valid Jump near if sign (SF=1). Not supported in 64-bit mode.
      0F 88 cd JS rel32 D Valid Valid Jump near if sign (SF=1).
      0F 84 cw JZ rel16 D N.S. Valid Jump near if 0 (ZF=1). Not supported in 64-bit mode.
      0F 84 cd JZ rel32 D Valid Valid Jump near if 0 (ZF=1).
      

      Если трейсить трейслогом 1000 инструкций поверх call, то видим многократное повторение пути внутри цикла между 00437A34 и 0044DFAF.
      1d498e8e-9dce-4fd3-8327-6b8551202bb1-изображение.png
      С помощью скрипта можно выйти на цикл не используя трейслог

      Можно использоваться функции определения куда прыгнет поток, до его выполнения.

      Можно оперировать таблицей адресов с брейкпоинтами в пошаговой отладке.

      написал в Статьи и видео шаблоны ce lua фишки
      MasterGHM
      MasterGH
    • 1 / 1