Skip to content

Commit

Permalink
Fix sigs for ServerBrowser 6153.
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Feb 5, 2024
1 parent 05a0e84 commit 8970c32
Showing 1 changed file with 42 additions and 4 deletions.
46 changes: 42 additions & 4 deletions Plugins/VGUI2Extension/GameUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,37 @@ bool VGUI2_IsPanelSetSize(PVOID Candidate)
auto pinst = (cs_insn*)inst;
auto ctx = (VGUI2_IsPanelSetSize_SearchContext*)context;

//call [exx+10h]
if (!ctx->bFoundCall10h &&
pinst->id == X86_INS_CALL &&
pinst->detail->x86.op_count == 1 &&
pinst->detail->x86.operands[0].type == X86_OP_MEM &&
pinst->detail->x86.operands[0].mem.base &&
pinst->detail->x86.operands[0].mem.base != X86_REG_ESP &&
pinst->detail->x86.operands[0].mem.base != X86_REG_EBP &&
pinst->detail->x86.operands[0].mem.disp == 0x10)
{
ctx->bFoundCall10h = true;
return TRUE;
}

//mov exx, [exx+10h]
if (!ctx->bMov10h &&
pinst->id == X86_INS_MOV &&
pinst->detail->x86.op_count == 2 &&
pinst->detail->x86.operands[0].type == X86_OP_REG &&
pinst->detail->x86.operands[1].type == X86_OP_MEM &&
pinst->detail->x86.operands[1].mem.base &&
pinst->detail->x86.operands[1].mem.base != X86_REG_ESP &&
pinst->detail->x86.operands[1].mem.base != X86_REG_EBP &&
pinst->detail->x86.operands[1].mem.disp == 0x10)
{
ctx->bMov10h = true;
ctx->instCount_Mov10h = instCount;
ctx->reg_Mov10h = pinst->detail->x86.operands[0].reg;
}

//add exx, 10
if (!ctx->bAdd10h &&
pinst->id == X86_INS_ADD &&
pinst->detail->x86.op_count == 2 &&
Expand All @@ -140,6 +160,7 @@ bool VGUI2_IsPanelSetSize(PVOID Candidate)
ctx->reg_Add10h = pinst->detail->x86.operands[0].reg;
}

//mov exx, [exx]
if (ctx->bAdd10h &&
!ctx->bMov10h &&
pinst->id == X86_INS_MOV &&
Expand All @@ -153,8 +174,8 @@ bool VGUI2_IsPanelSetSize(PVOID Candidate)
ctx->reg_Mov10h = pinst->detail->x86.operands[0].reg;
}

if (ctx->bAdd10h &&
ctx->bMov10h &&
//call exx
if (ctx->bMov10h &&
instCount > ctx->instCount_Mov10h &&
instCount < ctx->instCount_Mov10h + 5 &&
pinst->id == X86_INS_CALL &&
Expand Down Expand Up @@ -204,12 +225,30 @@ bool VGUI2_IsPanelSetMinimumSize(PVOID Candidate)
pinst->detail->x86.op_count == 1 &&
pinst->detail->x86.operands[0].type == X86_OP_MEM &&
pinst->detail->x86.operands[0].mem.base &&
pinst->detail->x86.operands[0].mem.base != X86_REG_ESP &&
pinst->detail->x86.operands[0].mem.base != X86_REG_EBP &&
pinst->detail->x86.operands[0].mem.disp == 0x18)
{
ctx->bFoundCall18h = true;
return TRUE;
}

//mov exx, [exx+18h]
if (!ctx->bMov18h &&
pinst->id == X86_INS_MOV &&
pinst->detail->x86.op_count == 2 &&
pinst->detail->x86.operands[0].type == X86_OP_REG &&
pinst->detail->x86.operands[1].type == X86_OP_MEM &&
pinst->detail->x86.operands[1].mem.base &&
pinst->detail->x86.operands[1].mem.base != X86_REG_ESP &&
pinst->detail->x86.operands[1].mem.base != X86_REG_EBP &&
pinst->detail->x86.operands[1].mem.disp == 0x18)
{
ctx->bMov18h = true;
ctx->instCount_Mov18h = instCount;
ctx->reg_Mov18h = pinst->detail->x86.operands[0].reg;
}

if (!ctx->bAdd18h &&
pinst->id == X86_INS_ADD &&
pinst->detail->x86.op_count == 2 &&
Expand All @@ -235,8 +274,7 @@ bool VGUI2_IsPanelSetMinimumSize(PVOID Candidate)
ctx->reg_Mov18h = pinst->detail->x86.operands[0].reg;
}

if (ctx->bAdd18h &&
ctx->bMov18h &&
if (ctx->bMov18h &&
instCount > ctx->instCount_Mov18h &&
instCount < ctx->instCount_Mov18h + 5 &&
pinst->id == X86_INS_CALL &&
Expand Down

0 comments on commit 8970c32

Please sign in to comment.