GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Recognize PLT entries on x86 Linux · Vector35/binaryninja-api@a401883

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • api.pro
  • binaryninjaapi.h
  • functionrecognizer.cpp
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎api.pro‎

Copy file name to clipboardExpand all lines: api.pro
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ SOURCES += \
2929
tempfile.cpp \
3030
lowlevelil.cpp \
3131
type.cpp \
32+
functionrecognizer.cpp \
3233
../core/json/jsoncpp.cpp
3334

3435
HEADERS += binaryninjaapi.h
Collapse file

‎binaryninjaapi.h‎

Copy file name to clipboardExpand all lines: binaryninjaapi.h
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,4 +1260,16 @@ namespace BinaryNinja
12601260

12611261
void Finalize();
12621262
};
1263+
1264+
class FunctionRecognizer
1265+
{
1266+
static bool RecognizeLowLevelILCallback(void* ctxt, BNBinaryView* data, BNFunction* func, BNLowLevelILFunction* il);
1267+
1268+
public:
1269+
FunctionRecognizer();
1270+
1271+
static void RegisterGlobalRecognizer(FunctionRecognizer* recog);
1272+
1273+
virtual bool RecognizeLowLevelIL(BinaryView* data, Function* func, LowLevelILFunction* il);
1274+
};
12631275
}
Collapse file

‎functionrecognizer.cpp‎

Copy file name to clipboard
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "binaryninjaapi.h"
2+
3+
using namespace BinaryNinja;
4+
5+
6+
FunctionRecognizer::FunctionRecognizer()
7+
{
8+
}
9+
10+
11+
bool FunctionRecognizer::RecognizeLowLevelILCallback(void* ctxt, BNBinaryView* data, BNFunction* func, BNLowLevelILFunction* il)
12+
{
13+
FunctionRecognizer* recog = (FunctionRecognizer*)ctxt;
14+
Ref<BinaryView> dataObj = new BinaryView(BNNewViewReference(data));
15+
Ref<Function> funcObj = new Function(BNNewFunctionReference(func));
16+
Ref<LowLevelILFunction> ilObj = new LowLevelILFunction(BNNewLowLevelILFunctionReference(il));
17+
return recog->RecognizeLowLevelIL(dataObj, funcObj, ilObj);
18+
}
19+
20+
21+
void FunctionRecognizer::RegisterGlobalRecognizer(FunctionRecognizer* recog)
22+
{
23+
BNFunctionRecognizer reg;
24+
reg.context = recog;
25+
reg.recognizeLowLevelIL = RecognizeLowLevelILCallback;
26+
BNRegisterGlobalFunctionRecognizer(&reg);
27+
}
28+
29+
30+
bool FunctionRecognizer::RecognizeLowLevelIL(BinaryView*, Function*, LowLevelILFunction*)
31+
{
32+
return false;
33+
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.