Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
Convert C++ codecave function to VB6
Results 1 to 6 of 6

Thread: Convert C++ codecave function to VB6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Convert C++ codecave function to VB6

    Hello, guys.

    Please, may someone help convert this function to vb6?

    The code in C++

    Code:
    void walk(HANDLE pHandle, DWORD baseAddress, int direction, bool dash)
    {
        BYTE codeCave[32]{
            0x60,                          //PUSHAD
            0x9C,                          //PUSHFD
            0x68, 0x00, 0x00, 0x00, 0x00, //PUSH DASH
            0x68, 0x00, 0x00, 0x00, 0x00, //PUSH DIRECTION
            0xB9, 0x00, 0x00, 0x00, 0x00, //MOVE ECX, GAME ADDRESS
            0xB8, 0x00, 0x00, 0x00, 0x00, //MOVE EAX, WALK FUNCTION ADDRESS
            0xFF, 0xD0,                      //CALL
            0x9D,                          //POPFD
            0x61,                          //POPAD
            0x68, 0x00, 0x00, 0x00, 0x00, //PUSH OriginalEIP
            0xC3                          //RETURN
        };
    
        DWORD gameAddress = baseAddress + 0x8036f0;
        DWORD walkFunctionAddress = baseAddress + 0x11FD3;
    
        int caveLenght = sizeof(codeCave);
        LPVOID remoteCave = VirtualAllocEx(pHandle, 0, caveLenght, MEM_COMMIT, PAGE_EXECUTE);
    
        DWORD mainThreadId = getProcessThreadId(pHandle);
        HANDLE hThread = OpenThread((THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME | THREAD_SET_CONTEXT), false, mainThreadId);
        SuspendThread(hThread);
        CONTEXT threadContext;
        threadContext.ContextFlags = CONTEXT_CONTROL;
        GetThreadContext(hThread, &threadContext);
    
        memcpy(&codeCave[3], &dash, 1);
        memcpy(&codeCave[8], &direction, 4);
        memcpy(&codeCave[13], &gameAddress, 4);
        memcpy(&codeCave[18], &walkFunctionAddress, 4);
        memcpy(&codeCave[27], &threadContext.Eip, 4);
        WriteProcessMemory(pHandle, remoteCave, codeCave, caveLenght, NULL);
    
        threadContext.Eip = (DWORD)remoteCave;
        threadContext.ContextFlags = CONTEXT_CONTROL;
        SetThreadContext(hThread, &threadContext);
        ResumeThread(hThread);
        CloseHandle(hThread);
        VirtualFreeEx(pHandle, remoteCave, caveLenght, MEM_RELEASE);

  2. #2
    My first attempt:

    Code:
    Public Function Walk(pHandle As Long, lBaseAddres As Long, direction As Long, dash As Boolean)
    Dim codeCave(31) As Byte
    
    codeCave(0) = &H60
    codeCave(1) = &H9C
    codeCave(2) = &H68
    codeCave(3) = &H0
    codeCave(4) = &H0
    codeCave(5) = &H0
    codeCave(6) = &H0
    codeCave(7) = &H68
    codeCave(8) = &H0
    codeCave(9) = &H0
    codeCave(10) = &H0
    codeCave(11) = &H0
    codeCave(12) = &HB9
    codeCave(13) = &H0
    codeCave(14) = &H0
    codeCave(15) = &H0
    codeCave(16) = &H0
    codeCave(17) = &HB8
    codeCave(18) = &H0
    codeCave(19) = &H0
    codeCave(20) = &H0
    codeCave(21) = &H0
    codeCave(22) = &HFF
    codeCave(23) = &HD0
    codeCave(24) = &H9D
    codeCave(25) = &H61
    codeCave(26) = &H68
    codeCave(27) = &H0
    codeCave(28) = &H0
    codeCave(29) = &H0
    codeCave(30) = &H0
    codeCave(31) = &HC3
    
    Dim var As Variant
    var = codeCave
    
    Dim gameAddress As Long
    gameAddress = lProcessBase + mainAddress
    Dim walkFunctionAddress As Long
    walkFunctionAddress = lProcessBase + &H11FD3
    
    Dim caveLenght As Long
    caveLenght = UBound(codeCave)
    Dim remoteCave As Long
    remoteCave = VirtualAllocEx(pHandle, 0, caveLenght, MEM_COMMIT, PAGE_EXECUTE)
    
    Dim mainThreadId As Long
    mainThreadId = GetProcessID(pHandle) 'lProcessID
    Dim hthread As Long
    'hThread = OpenThread (THREAD_GET_CONTEXT | THREAD_SUSPEND_RESUME | THREAD_SET_CONTEXT), false, mainThreadId
    hthread = OpenThread(THREAD_GET_CONTEXT, False, mainThreadId)
    hthread = OpenThread(THREAD_SUSPEND_RESUME, False, mainThreadId)
    hthread = OpenThread(THREAD_SET_CONTEXT, False, mainThreadId)
    SuspendThread (hthread)
    Dim threadContext As CONTEXT
    threadContext.ContextFlags = CONTEXT_CONTROL
    GetThreadContext hthread, threadContext
    
    CopyMemory codeCave(2), dash, 1
    CopyMemory codeCave(7), direction, 4
    CopyMemory codeCave(12), gameAddress, 4
    CopyMemory codeCave(17), &H11FD3, 4
    CopyMemory codeCave(26), threadContext.Eip, 4
    WriteProcessMemory pHandle, remoteCave, var, caveLenght, 0
    
    threadContext.Eip = remoteCave
    threadContext.ContextFlags = CONTEXT_CONTROL
    SetThreadContext hthread, threadContext
    ResumeThread (hthread)
    CloseHandle (hthread)
    VirtualFreeEx pHandle, remoteCave, caveLenght, MEM_RELEASE
    Declarations:
    Code:
    Public Declare Function OpenThread Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwThreadId As Long) As Long
    Public Declare Function GetThreadContext Lib "kernel32" (ByVal hthread As Long, lpContext As CONTEXT) As Long
    Public Declare Function SetThreadContext Lib "kernel32" (ByVal hthread As Long, lpContext As CONTEXT) As Long
    Public Declare Function SuspendThread Lib "kernel32" (ByVal hthread As Long) As Long
    Public Declare Function ResumeThread Lib "kernel32" (ByVal hthread As Long) As Long
    Public Declare Sub CopyMemory Lib "kernel32" Alias _
        "RtlMoveMemory" (ByVal Destination As Long, ByVal _
        Source As Long, ByVal Length As Integer)
    Public Declare Function VirtualAllocEx Lib "kernel32" _
    (ByVal hProcess As Long, lpAddress As Any, dwSize As Any, _
    ByVal flAllocationType As Long, ByVal flProtect As Long) As Long
    Public Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As Long, ByVal lpAddress As Any, ByVal dwSize As Long, ByVal dwFreeType As Long) As Long
        
    Public Const SIZE_OF_80387_REGISTERS = 80
    
    'Public Const MEM_COMMIT = &H1000
    Public Const MEM_RELEASE = &H8000
    Public Const PAGE_EXECUTE = &H10
    Public Const THREAD_GET_CONTEXT = &H8
    Public Const THREAD_SUSPEND_RESUME = &H2
    Public Const THREAD_SET_CONTEXT = &H10
    Public Const CONTEXT_CONTROL = &H1
    
    Type FLOATING_SAVE_AREA
       ControlWord As Long
       StatusWord As Long
       TagWord As Long
       ErrorOffset As Long
       ErrorSelector As Long
       DataOffset As Long
       DataSelector As Long
       RegisterArea(SIZE_OF_80387_REGISTERS) As Byte
       Cr0NpxState As Long
    End Type
    
    Type CONTEXT
       ContextFlags As Long
       Dr0 As Long
       Dr1 As Long
       Dr2 As Long
       Dr3 As Long
       Dr6 As Long
       Dr7 As Long
       FloatSave As FLOATING_SAVE_AREA
       SegGs As Long
       SegFs As Long
       SegEs As Long
       SegDs As Long
       Edi As Long
       Esi As Long
       Ebx As Long
       Edx As Long
       Ecx As Long
       Eax As Long
       Ebp As Long
       Eip As Long
       SegCs As Long
       EFlags As Long
       Esp As Long
       SegSs As Long
    End Type

  3. #3
    Senior Member
    Join Date
    Feb 2024
    Location
    SLOT GACOR
    Posts
    1,010

    Top Rated Product Site

    Please try Google before asking about Cool Product Info 8b8_595

  4. #4
    Senior Member
    Join Date
    Feb 2024
    Location
    SLOT GACOR
    Posts
    1,010

    Updated Link Slot Gacor Site

    In reply to the lady talking about slot yang ada rtp, link jackpot slot, main slot online, slot gacor apa saja, cuan slot login, slot wins, website game slot, cuan 777 slot login, agen slot judi, slot yang lagi gacor saat ini, I highly suggest this link about MPO007 site or slot agen gacor, casino slot online game, 777 online, agen judi casino, slot virtual, tempat judi 777, judi slot maxwin, link game online slot, mpo agen, agen slot game, alongside all this top MPO007 forum as well as game judi online slot, cuan 777 slot login, dunia maxwin, agen gacor slot, casino 7, link cuan slot, depo judi slot, link judi slot gacor, play online slot, slot player, on top of this recommended gampang menang maxwin link which is also great. Also, have a look at this total stranger about slot gacor link as well as web casino online, livechat slot, agen slot maxwin, judi slot online terbaru, slot site, web gacor online, slot resmi pragmatic, apa itu agen slot, situs judi slot yang lagi gacor, rtp live mpo, not to mention this helpful hints on slot gacor tips with mega bet slot, agen gacor slot, link cuan slot, judi slot, slot internet, all in spin slot, judi 777 online, judi slot online, link slot yang gacor, judi gacor, for good measure. Check more @ Awesome Botox Treatment Site 8f6fd6b

  5. #5
    Senior Member
    Join Date
    Feb 2024
    Location
    SLOT GACOR
    Posts
    1,010

    New BC Game Casino Site

    In response to the person talking about best smart contract crypto, online cryptocurrency casino, crypto casino reviews, games crypto, stable coin definition, binance crypto exchange, crypto online gambling, free crypto gambling, best casino crypto, lightning network channels, I highly suggest this awesome bc game tips or best us crypto casino, id for binance, blockchain binance, ada cryptocurrency news, crypto gaming, crypto casino crash, best crypto memes, hal crypto, crypto based games, hash dice, and don't forget this recommended reading for bcgame link alongside all binance crypto trading, online casino cryptocurrency, hashdice, cryptocurrency yield farming, crypto casino online, binance exchange website, crypto token games, steps to invest in cryptocurrency, crypto gambling games, blockchain pillars, alongside all this had me going about bc game info which is also great. Also, have a look at this additional resources on bcgame link alongside all crypto casino bonuses, ada crypto prediction, ada coin news today, crypto app games, crypto backed stablecoins, crypto betting game, binance beginner guide, stable crypto coins, crash online casino game, casino with crypto, as well as this read this post here for bcgame link with games that pay in crypto, crypto gambling casino, pool crypto mining, yield farm crypto, crypto trading on binance, best crypto stable coin, exchange crypto binance, blockchain ada, currency ada, online casino cryptocurrency, for good measure. Check more @ Great BC Game Site e98b6_c

  6. #6
    Senior Member
    Join Date
    Feb 2024
    Location
    SLOT GACOR
    Posts
    1,010

    Cool Car Rental Blog

    To the man asking about scrap my vehicle near me, we buy the car, sell your car for scrap, used car scrap, we buy any car cash, selling my car, sell my car for parts, sale price of my car, value a car to buy, same day cash for cars, I highly recommend this best car rental tips or places that buy cars in any condition, vehicle valuation services near me, scrap used car, sell my car for parts online, cars on cash, remove scrap car, scrap it car, find a value of a car, a car worth, best valuation for my car, on top of this more help about car rental details not to mention checking market value of car, instant scrap car valuation, car valuation free, sell car quickly for cash, sell unwanted car, scrap car what do i need to do, government car valuation, car scrap value, any buy any car, we buy in car, and don't forget this consultant about car rental url which is also great. Also, have a look at this awesome car rental site as well as vehicle valuation services, scrap my car free collection, scrap lorries, sell used car that needs work, sold car for scrap, sell car for scrap metal, car valuation at home, vehicle current value, we buy any car price promise, we will sell your car, as well as this awesome rent a car info with scrap yard near me that takes cars, we buy any car paperwork, car valuation online, car scrap value, best scrap car website, money for scrap cars, places that buys car parts, sell my car for parts, we can buy any car, money for vehicles, for good measure. Check more @ Cool Car Rental Info 6b89d22

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •