首页
社区
课程
招聘
[原创]获取指定index的 OBJECTTYPE
发表于: 2015-8-27 14:05 5196

[原创]获取指定index的 OBJECTTYPE

2015-8-27 14:05
5196

ULONG64 onlythisfile_SreachFunctionAddress(ULONG64 uAddress, UCHAR *Signature, ULONG addopcodelength, ULONG addopcodedatasize)
{
        ULONG64        index = 0;
        UCHAR        *p = 0;
        ULONG64        uRetAddress = 0;
        ULONG32 temp64 = 0;
        if (uAddress == 0){ return 0; }

        p = (UCHAR*)uAddress;
        for (index = 0; index<0x3000; index++)
        {

                if (*p == Signature[0] &&
                        *(p + 1) == Signature[1] &&
                        *(p + 2) == Signature[2] &&
                        *(p + 3) == Signature[3] &&
                        *(p + 4) == Signature[4])
                {

                        uRetAddress = p+4;
                               

               

                        temp64 = (ULONG32)(*(ULONG32*)(uRetAddress + addopcodelength));
;
               
                        uRetAddress = temp64 + uRetAddress + addopcodedatasize;
                       
               
                        uRetAddress &= 0xfffffff0ffffffff;

                        return uRetAddress;
                }
                p++;

                DbgPrint("++ %p ", p);

        }
        return 0;
}
extern PVOID64 __fastcall   GetObjectByindex(ULONG64 index, ULONG64 ObTypeIndexTable);
void initgetobjectbbyindex(){
  UCHAR opcodethis[] = { 0x0f,0xb6,0x41,0xe8,0x48 };
  PVOID debugobject=0;
  ObTypeIndexTable = (PVOID)onlythisfile_SreachFunctionAddress(FUCKGetFunctionAddr(L"ObGetObjectType"), opcodethis, 3, 7);
  DbgPrint("ObTypeIndexTable %p   xx :%p", ObTypeIndexTable, FUCKGetFunctionAddr(L"ObGetObjectType"));

  debugobject=GetObjectByindex(0xb, ObTypeIndexTable);
  DbgPrint("debugobject %p", debugobject);
}
.asm 文件

.CODE

GetObjectByindex PROC

mov   rax, rcx
mov     rcx, rdx
mov     rax, [rcx+rax*8]
ret
GetObjectByindex ENDP
END


[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 3
支持
分享
最新回复 (3)
雪    币: 219
活跃值: (878)
能力值: (RANK:290 )
在线值:
发帖
回帖
粉丝
2
~asm x64
2015-8-27 14:12
0
雪    币: 256
活跃值: (48)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
3
void GetObjectTypeWin7x64()
{
        BOOLEAN i = 2;
        ULONG        j = 2;
        ULONG64 ObjectType;
        UNICODE_STRING ObjectName;
        RtlInitUnicodeString(&ObjectName,L"Process");
        while (ObGetObjectType(&i+0x18))
        {
                ObjectType = ObGetObjectType(&i + 0x18);
                KdPrint(("对象类型[%d]=%wZ\n", j, ObjectType+0x10));
                i++;
                j++;
        }
}
2015-8-29 04:32
0
雪    币: 256
活跃值: (48)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
4
NTKERNELAPI PVOID NTAPI
ObGetObjectType(
      IN PVOID pObject
      );
2015-8-29 04:35
0
游客
登录 | 注册 方可回帖
返回