吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 2092|回复: 10
收起左侧

[讨论] CE如何利用注入代码反复调用创建的线程?

[复制链接]
wdfdiablo 发表于 2021-1-8 21:54
本帖最后由 wdfdiablo 于 2021-1-8 22:44 编辑

createthread创建线程后,可以同时用注入代码循环调用这个线程吗?如何实现?请教高手!

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

古月不傲 发表于 2021-1-8 22:42
本帖最后由 古月不傲 于 2021-1-8 22:44 编辑

理论上是可以的阿,你会调用普通函数,把线程入口地址和参数传过去call应该是可行的,自己弄个demo试试呗
 楼主| wdfdiablo 发表于 2021-1-8 22:44
本帖最后由 wdfdiablo 于 2021-1-8 22:48 编辑
古月不傲 发表于 2021-1-8 22:42
理论上是可以的阿,你会调用普通函数,那么把线程入口和参数传过去就行了,自己弄个demo试试呗

试过了,游戏崩溃。

[ENABLE]
//code from here to '[DISABLE]' will be used to enable the cheat
alloc(mythread,128)
createthread(mythread)
alloc(newmem,512)
label(returnhere)
label(originalcode)
label(exit)

mythread:
call 00483c70
ret
jmp originalcode
newmem: //this is allocated memory, you have read,write,execute access
//place your code here

push eax
mov eax,[007CCAAC]
mov ecx,eax
pop eax
jmp mythread

originalcode:
mov [ebx+2C],ecx
test dl,01

exit:
jmp returnhere

"DF.EXE"+87671:
jmp newmem
nop
returnhere:




[DISABLE]
//code from here till the end of the code will be used to disable the cheat
dealloc(newmem)
"DF.EXE"+87671:
mov [ebx+2C],ecx
test dl,01
//Alt: db 89 4B 2C F6 C2 01
古月不傲 发表于 2021-1-8 22:56
wdfdiablo 发表于 2021-1-8 22:44
试过了,游戏崩溃。

[ENABLE]

[C++] 纯文本查看 复制代码
#include <iostream>
#include <pthread.h>
#include <mutex>

void *test(void *args)
{
        int a = *(int *)args;
        while (1)
        {
                if (a == 1)
                        break;
        }

        printf("a = %d\n", a);

        return nullptr;
}

int main(void)
{
        pthread_t pid;
        int a = 0;
        pthread_create(&pid, nullptr, test, (void *)&a);

        int b = 1;
        test((void *)&b);
        pthread_join(pid, nullptr);

        return 0;
}


linux上这种调用是可行的,windows肯定也可行,汇编调用或者线程代码应该有问题,我也没试过,只调用过普通函数
古月不傲 发表于 2021-1-8 23:02
wdfdiablo 发表于 2021-1-8 22:44
试过了,游戏崩溃。

[ENABLE]

用C语言试试,不会ce
65302666 发表于 2021-1-8 23:04
//我分享下我朋友写的代码,希望对你有帮助
// RtlMoveMemory 内存复制函数
[ENABLE]
registersymbol(GodProtect)
alloc(GodProtect,256)
label(GodSleep)
registersymbol(GodCode)
alloc(GodCode,256)
createthread(GodProtect)

GodCode:
db DB BD F1 2B C2 8D 5F C9 30 70 EA 7D


GodProtect:
cmp [MapleStory.exe+7DD490],0
je GodSleep
cmp [MapleStory.exe+7DD6F0],0
je GodSleep

mov eax,[MapleStory.exe+7DD490]
cmp eax,0
je GodSleep

push #12                //24个字节参数
push GodCode        //GodCode字节码
PUSH 00BE5174                //EAX指针?  03F77708 ?
call RtlMoveMemory //复制内存
jmp GodSleep        //跳回线程等待?

GodSleep:
mov eax,1F4        //500毫秒?
push 00BE5174                //EAX指针?  03F77708 ?
call Sleep                // call  线程等待
jmp GodProtect

[DISABLE]
unregistersymbol(GodProtect)
dealloc(GodProtect,256)
unregistersymbol(GodCode)
dealloc(GodCode,256)
GodProtect:
xor eax,eax
ret
 楼主| wdfdiablo 发表于 2021-1-8 23:07
65302666 发表于 2021-1-8 23:04
//我分享下我朋友写的代码,希望对你有帮助
// RtlMoveMemory 内存复制函数
[ENABLE]

谢谢,我借鉴下试试。
65302666 发表于 2021-1-8 23:08
wdfdiablo 发表于 2021-1-8 23:07
谢谢,我借鉴下试试。

别忘记加延时参数跟call sleep
 楼主| wdfdiablo 发表于 2021-1-8 23:12
古月不傲 发表于 2021-1-8 22:56
[mw_shl_code=cpp,true]#include
#include
#include

谢谢,不懂C
fjlong163 发表于 2021-1-9 00:47
过来学习&#128522;
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止回复与主题无关非技术内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-16 19:27

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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