看流星社区

 找回密码
 注册账号
查看: 4115|回复: 7

DLL已经注入到游戏里面了!可是还有些疑问!!请大家帮帮我!急急!

[复制链接]

该用户从未签到

发表于 2011-3-10 11:02:51 | 显示全部楼层 |阅读模式
看COOLTOOLS的关于完美选怪函数!  
我用DEIPHI 写了一个DLL 然后用VB向游戏注入这个DLL,用CreateRemoteThread+DLL的方法  

DLL的内容是带一个参数也就是用来传入怪ID的.现在  CreateRemoteThread后以经得到了新的线程的ID..我下一步应该怎么做.才能和那个注入到游戏里的DLL通信!因
为我调用他!给他传怪的ID.好让他能实现用CALL 选怪的功能(本人实在太菜,还不知道这么想行不行)有写的不明白的地方!请见谅!  

DLL 内容如下(不会DELPHI .还不知道写的对不对.但VB又不能做DLL .没办法硬写了一个)  
Function MyMax ( GID : LongWord ) : integer ; stdcall ;
    var
    SendAdr : Pointer   ;


    begin
    Sendadr:=Pointer( $0057D8A0) ;
    asm

    pushad
    push GID//怪物ID,流水号  
    MOV EAX,DWORD PTR DS:[$08E0A7C]
    MOV ECX,DWORD PTR DS:[EAX+$20]
    ADD ECX,$0EC
    CALL SendAdr
    popad
    end ;
    MyMax:= 1   ;
    end ;

该用户从未签到

发表于 2011-3-10 11:04:12 | 显示全部楼层
SendMessage
PostMessage
PostThreadMessage
内存映象

该用户从未签到

发表于 2011-3-10 11:04:58 | 显示全部楼层
我没搞过,不过我有个思路,不知道对不  

DLL里应该加入消息钩子,注入到游戏中  
外挂向游戏发送消息  
消息钩子先接到消息,执行你的代码  

请高手指教

该用户从未签到

发表于 2011-3-10 11:05:29 | 显示全部楼层
你可以下载 Delphi下深入Windows核心编程来看一下,第一章就有讲EXE与DLL之间的通信,可以满足你的要求

该用户从未签到

发表于 2011-3-10 11:05:44 | 显示全部楼层
带参的函数是可以的,在目标的内存里面分配空间,然后把参数写进去,先CreateRemoteThread调用目标进程的函数就行了,不过只能一个参数。想要多个参数可以用一个结构体把参数封装起来,传递及构体指针就好了。

该用户从未签到

发表于 2011-3-10 11:06:22 | 显示全部楼层
CreateRemoteThread
         
        Creates a thread that runs in the virtual address space of another process.
         
         
        HANDLE WINAPI CreateRemoteThread(
        HANDLE hProcess,
        LPSECURITY_ATTRIBUTES lpThreadAttributes,
        SIZE_T dwStackSize,
        LPTHREAD_START_ROUTINE lpStartAddress,
        LPVOID lpParameter,
        DWORD dwCreationFlags,
        LPDWORD lpThreadId
        );
         
        Parameters
        hProcess  
        [in] A handle to the process in which the thread is to be created. The handle must have the PROCESS_CREATE_THREAD, PROCESS_QUERY_INFORMATION, PROCESS
        _VM_OPERATION, PROCESS_VM_WRITE, and PROCESS_VM_READ access rights. For more information, see Process Security and Access Rights.   
        lpThreadAttributes  
        [in] A pointer to a SECURITY_ATTRIBUTES structure that specifies a security descriptor for the new thread and determines whether child processes can inherit the returne
        d handle. If lpThreadAttributes is NULL, the thread gets a default security descriptor and the handle cannot be inherited. The access control lists (ACL) in the default securit
        y descriptor for a thread come from the primary token of the creator.
        Windows XP/2000/NT: The ACLs in the default security descriptor for a thread come from the primary or impersonation token of the creator. This behavior changed with Wi
        ndows XP SP2 and Windows Server 2003.
        dwStackSize  
        [in] The initial size of the stack, in bytes. The system rounds this value to the nearest page. If this parameter is 0 (zero), the new thread uses the default size for the executa
        ble. For more information, see Thread Stack Size.  
        lpStartAddress  
        [in] A pointer to the application-defined function of type LPTHREAD_START_ROUTINE to be executed by the thread and represents the starting address of the thread in th
        e remote process. The function must exist in the remote process. For more information, see ThreadProc.  
        lpParameter  
        [in] A pointer to a variable to be passed to the thread function.  
        dwCreationFlags  
        [in] The flags that control the creation of the thread. If the CREATE_SUSPENDED flag is specified, the thread is created in a suspended state and does not run until the Re
        sumeThread function is called. If this value is zero, the thread runs immediately after creation.  
        If the STACK_SIZE_PARAM_IS_A_RESERVATION flag is specified, the dwStackSize parameter specifies the initial reserve size of the stack. Otherwise, dwStackSize specifi
        es the commit size.
         
        Windows 2000/NT: The STACK_SIZE_PARAM_IS_A_RESERVATION flag is not supported.
        lpThreadId  
        [out] A pointer to a variable that receives the thread identifier.  
        If this parameter is NULL, the thread identifier is not returned.
         
        Return Value
        If the function succeeds, the return value is a handle to the new thread.
         
        If the function fails, the return value is NULL. To get extended error information, call GetLastError.
         
        Note that CreateRemoteThread may succeed even if lpStartAddress points to data, code, or is not accessible. If the start address is invalid when the thread runs, an except
        ion occurs, and the thread terminates. Thread termination due to a invalid start address is handled as an error exit for the thread's process. This behavior is similar to the a
        synchronous nature of CreateProcess, where the process is created even if it refers to invalid or missing dynamic-link libraries (DLL).
         
        Remarks
        The CreateRemoteThread function causes a new thread of execution to begin in the address space of the specified process. The thread has access to all objects that the
        process opens.
         
        Terminal Services isolates each terminal session by design. Therefore, CreateRemoteThread fails if the target process is in a different session than the calling process.  
         
        The new thread handle is created with full access to the new thread. If a security descriptor is not provided, the handle may be used in any function that requires a thread o
        bject handle. When a security descriptor is provided, an access check is performed on all subsequent uses of the handle before access is granted. If the access check deni
        es access, the requesting process cannot use the handle to gain access to the thread.
         
        The thread is created with a thread priority of THREAD_PRIORITY_NORMAL. Use the GetThreadPriority and SetThreadPriority functions to get and set the priority value of
        a thread.
         
        When a thread terminates, the thread object attains a signaled state, which satisfies the threads that are waiting for the object.  
         
        The thread object remains in the system until the thread has terminated and all handles to it are closed through a call to CloseHandle.  
         
        The ExitProcess, ExitThread, CreateThread, CreateRemoteThread functions, and a process that is starting (as the result of a CreateProcess call) are serialized between e
        ach other within a process. Only one of these events occurs in an address space at a time. This means the following restrictions hold:  
         
         
         
        During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process.   
        Only one thread in a process can be in a DLL initialization or detach routine at a time.  
        ExitProcess returns after all threads have completed their DLL initialization or detach routines.  
        A common use of this function is to inject a thread into a process that is being debugged to issue a break. However, this use is not recommended, because the extra threa
        d is confusing to the person debugging the application and there are several side effects to using this technique:
         
         
        It converts single-threaded applications into multi-threaded applications.  
        It changes the timing and memory layout of the process.  
        It results in a call to the entry point of each DLL in the process.  
        Another common use of this function is to inject a thread into a process to query heap or other process information. This can cause the same side effects mentioned in the
        previous paragraph. Also, the application can deadlock if the thread attempts to obtain ownership of locks that another thread is using.  
         
        Requirements
        Client Requires Windows Vista, Windows XP, Windows 2000 Professional, or Windows NT Workstation.  
        Server Requires Windows Server "Longhorn", Windows Server 2003, Windows 2000 Server, or Windows NT Server.  
        Header Declared in Winbase.h; include Windows.h.
         
        Library Use Kernel32.lib.
         
        DLL Requires Kernel32.dll.
         
        这是msdn里的说明  
        lpParameter  
        [in] A pointer to a variable to be passed to the thread function.   、//参数传递  
        看到这应该明白了吧

该用户从未签到

发表于 2011-3-10 11:07:04 | 显示全部楼层
建议使用钩子注入,然后在回调函数里做文章
用CreateRemoteThread很多杀毒软件会报警的

该用户从未签到

发表于 2014-6-20 15:07:50 | 显示全部楼层
建议使用钩子注入,然后在回调函数里做文章
用CreateRemoteThread很多杀毒软件会报警的
点击按钮快速添加回复内容: 支持 高兴 激动 给力 加油 苦寻 生气 回帖 路过 感恩
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

小黑屋|手机版|Archiver|看流星社区 |网站地图

GMT+8, 2024-5-19 10:19

Powered by Kanliuxing X3.4

© 2010-2019 kanliuxing.com

快速回复 返回顶部 返回列表