mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-31 06:20:40 +08:00
Merge remote-tracking branch
'origin/GP-4173_ghidra1_ImproveBSimCommandLineOptions--SQUASHED' into patch (Closes #6054)
This commit is contained in:
@@ -69,7 +69,7 @@ This is equivalent to:
|
|||||||
Use a command-line like this to generate and commit signatures from a Ghidra Server
|
Use a command-line like this to generate and commit signatures from a Ghidra Server
|
||||||
repository to the Elasticsearch database created above:
|
repository to the Elasticsearch database created above:
|
||||||
|
|
||||||
bsim generatesigs ghidra://1.2.3.4/repo bsim=elastic://1.2.3.4:9200/repo
|
bsim generatesigs ghidra://1.2.3.4/repo --bsim elastic://1.2.3.4:9200/repo
|
||||||
|
|
||||||
Within Ghidra's BSim client, enter the same URL into the database connection
|
Within Ghidra's BSim client, enter the same URL into the database connection
|
||||||
panel in order to place queries to your Elasticsearch deployment. See the BSim
|
panel in order to place queries to your Elasticsearch deployment. See the BSim
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -214,7 +214,7 @@
|
|||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl start /path/to/datadir
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl start /path/to/datadir
|
||||||
port=8000</CODE></TD>
|
--port 8000</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
@@ -236,7 +236,7 @@
|
|||||||
be reused.</P>
|
be reused.</P>
|
||||||
|
|
||||||
<P>The <SPAN class="bold"><STRONG>start</STRONG></SPAN> command can take an optional
|
<P>The <SPAN class="bold"><STRONG>start</STRONG></SPAN> command can take an optional
|
||||||
<SPAN class="bold"><STRONG>port=</STRONG></SPAN> parameter. This can be used to specify
|
<SPAN class="bold"><STRONG>--port</STRONG></SPAN> parameter. This can be used to specify
|
||||||
a non-standard port for the PostgreSQL server to listen on. In this case, any
|
a non-standard port for the PostgreSQL server to listen on. In this case, any
|
||||||
subsequent reference to the BSim server, in the Ghidra client, or with the <SPAN class=
|
subsequent reference to the BSim server, in the Ghidra client, or with the <SPAN class=
|
||||||
"command"><STRONG>bsim</STRONG></SPAN> command described below, must specify the port.
|
"command"><STRONG>bsim</STRONG></SPAN> command described below, must specify the port.
|
||||||
@@ -293,7 +293,7 @@
|
|||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir
|
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir
|
||||||
auth=trust</CODE></P>
|
--auth trust</CODE></P>
|
||||||
|
|
||||||
<P>This is currently the default. No authentication is performed and privilege
|
<P>This is currently the default. No authentication is performed and privilege
|
||||||
is granted based on the user name presented. Masquerading is possible.</P>
|
is granted based on the user name presented. Masquerading is possible.</P>
|
||||||
@@ -304,7 +304,7 @@
|
|||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir
|
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir
|
||||||
auth=password</CODE></P>
|
--auth password</CODE></P>
|
||||||
|
|
||||||
<P>Users are authenticated via password. A default password 'changeme' is
|
<P>Users are authenticated via password. A default password 'changeme' is
|
||||||
established when the new user is created. Passwords can be changed by the user
|
established when the new user is created. Passwords can be changed by the user
|
||||||
@@ -315,12 +315,12 @@
|
|||||||
<DT><SPAN class="term"><SPAN class="bold"><STRONG>pki</STRONG></SPAN></SPAN></DT>
|
<DT><SPAN class="term"><SPAN class="bold"><STRONG>pki</STRONG></SPAN></SPAN></DT>
|
||||||
|
|
||||||
<DD>
|
<DD>
|
||||||
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir auth=pki
|
<P><CODE class="computeroutput">bsim_ctl start /path/to/datadir --auth pki
|
||||||
ca=/path/to/rootcert</CODE></P>
|
--cafile "/path/to/rootcert"</CODE></P>
|
||||||
|
|
||||||
<P>Users are authenticated by PKI certificates. Upon initialization, the BSim
|
<P>Users are authenticated by PKI certificates. Upon initialization, the BSim
|
||||||
server must be provided (via the <SPAN class=
|
server must be provided (via the <SPAN class=
|
||||||
"command"><STRONG>ca=</STRONG></SPAN> option) a file containing the public keys
|
"command"><STRONG>--cafile</STRONG></SPAN> option) a file containing the public keys
|
||||||
for the certificate authorities used to issue user's certificates. The file
|
for the certificate authorities used to issue user's certificates. The file
|
||||||
consists of the authoritative certificates in PEM format concatenated
|
consists of the authoritative certificates in PEM format concatenated
|
||||||
together.</P>
|
together.</P>
|
||||||
@@ -338,7 +338,7 @@
|
|||||||
<P>With PKI authentication enabled, at the time a new user role is established
|
<P>With PKI authentication enabled, at the time a new user role is established
|
||||||
with the server, the X.509 Distinguished Name, as bound to the user's
|
with the server, the X.509 Distinguished Name, as bound to the user's
|
||||||
certificate, must be associated with the user name via the <SPAN class=
|
certificate, must be associated with the user name via the <SPAN class=
|
||||||
"command"><STRONG>dn=</STRONG></SPAN> option. See <A class="xref" href=
|
"command"><STRONG>--dn</STRONG></SPAN> option. See <A class="xref" href=
|
||||||
"#PostAddUser" title="Adding Users to the Database">“Adding Users to the
|
"#PostAddUser" title="Adding Users to the Database">“Adding Users to the
|
||||||
Database”</A>.</P>
|
Database”</A>.</P>
|
||||||
</DD>
|
</DD>
|
||||||
@@ -358,7 +358,7 @@
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl changeauth
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl changeauth
|
||||||
/datadir/path auth=password</CODE></TD>
|
/datadir/path --auth password</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -401,7 +401,7 @@
|
|||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl adduser <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim_ctl adduser <SPAN class=
|
||||||
"emphasis"><EM>username</EM></SPAN> dn="C=US,ST=MD,CN=Firstname User"</CODE></TD>
|
"emphasis"><EM>username</EM></SPAN> --dn "C=US,ST=MD,CN=Firstname User"</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -410,7 +410,7 @@
|
|||||||
initially be set to 'changeme'. If PKI authentication has been set for the server, The
|
initially be set to 'changeme'. If PKI authentication has been set for the server, The
|
||||||
Distinguished Name, as bound to the new user's certificated must be provided when
|
Distinguished Name, as bound to the new user's certificated must be provided when
|
||||||
issuing the <SPAN class="command"><STRONG>adduser</STRONG></SPAN> command, via the
|
issuing the <SPAN class="command"><STRONG>adduser</STRONG></SPAN> command, via the
|
||||||
<SPAN class="command"><STRONG>dn=</STRONG></SPAN> option. The Distinguished Name must
|
<SPAN class="command"><STRONG>--dn</STRONG></SPAN> option. The Distinguished Name must
|
||||||
be presented as a string containing a comma separated sequence of attribute/value pairs
|
be presented as a string containing a comma separated sequence of attribute/value pairs
|
||||||
that uniquely identifies a certificate. Currently, the Common Name (CN=) is the only
|
that uniquely identifies a certificate. Currently, the Common Name (CN=) is the only
|
||||||
attribute inspected by the PostgreSQL server, so other attributes can be omitted.</P>
|
attribute inspected by the PostgreSQL server, so other attributes can be omitted.</P>
|
||||||
@@ -836,17 +836,17 @@ curl -k -u elastic:XXXXXX -X POST "https://localhost:9200/_security/user/ghidrau
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN> "name=BSim Database"</CODE></TD>
|
"emphasis"><EM>bsimURL</EM></SPAN> --name "BSim Database"</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN> "owner=Administrators"</CODE></TD>
|
"emphasis"><EM>bsimURL</EM></SPAN> --owner "Administrators"</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim setmetadata <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN> "description=Files of interest"</CODE></TD>
|
"emphasis"><EM>bsimURL</EM></SPAN> --description "Files of interest"</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -855,8 +855,8 @@ curl -k -u elastic:XXXXXX -X POST "https://localhost:9200/_security/user/ghidrau
|
|||||||
changed at any time and do not otherwise affect the records contained in the database.
|
changed at any time and do not otherwise affect the records contained in the database.
|
||||||
Multiple command-line parameters can be fed to <SPAN class="command"><STRONG>bsim
|
Multiple command-line parameters can be fed to <SPAN class="command"><STRONG>bsim
|
||||||
setmetadata</STRONG></SPAN> so long as each one starts with <SPAN class=
|
setmetadata</STRONG></SPAN> so long as each one starts with <SPAN class=
|
||||||
"bold"><STRONG>name=</STRONG></SPAN>, <SPAN class="bold"><STRONG>owner=</STRONG></SPAN>, or
|
"bold"><STRONG>--name</STRONG></SPAN>, <SPAN class="bold"><STRONG>--owner</STRONG></SPAN>, or
|
||||||
<SPAN class="bold"><STRONG>description=</STRONG></SPAN> respectively. Quoting may be
|
<SPAN class="bold"><STRONG>--description</STRONG></SPAN> respectively. Quoting of values may be
|
||||||
necessary to get some strings to be interpreted as a single command-line parameter.</P>
|
necessary to get some strings to be interpreted as a single command-line parameter.</P>
|
||||||
|
|
||||||
<DIV class="sect2">
|
<DIV class="sect2">
|
||||||
|
|||||||
@@ -112,20 +112,20 @@
|
|||||||
"command"><STRONG>bsim generatesigs</STRONG></SPAN> command. Signatures may be written as
|
"command"><STRONG>bsim generatesigs</STRONG></SPAN> command. Signatures may be written as
|
||||||
XML files to a local directory and/or committed directly to a specified BSim database. If
|
XML files to a local directory and/or committed directly to a specified BSim database. If
|
||||||
not immediately committing to a database and only storing the XML files an appropriate
|
not immediately committing to a database and only storing the XML files an appropriate
|
||||||
database <EM>config=</EM> may be specified in lieu of a BSim database URL
|
database configuration may be specified using the <EM>--config</EM> option in lieu of a BSim database URL
|
||||||
(<EM>bsimURL</EM>) if database specific executable categories and function tags are not
|
(--bsim <EM><bsimURL></EM>) if database specific executable categories and function tags are not
|
||||||
utilized. Use of the <EM>config=</EM> option does not require a running BSim server.</P>
|
utilized. Use of the <EM>--config</EM> option does not require a running BSim server.</P>
|
||||||
|
|
||||||
<DIV class="informalexample">
|
<DIV class="informalexample">
|
||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
||||||
<ghidraURL> </xmldirectory> config=<config_template>
|
<ghidraURL> </xmldirectory> --config <config_template>
|
||||||
[--overwrite]<BR>
|
[--overwrite]<BR>
|
||||||
$(ROOT)/support/bsim generatesigs <ghidraURL> </xmldirectory>
|
$(ROOT)/support/bsim generatesigs <ghidraURL> </xmldirectory>
|
||||||
bsim=<bsimURL> [--commit] [--overwrite]<BR>
|
--bsim <bsimURL> [--commit] [--overwrite]<BR>
|
||||||
$(ROOT)/support/bsim generatesigs <ghidraURL>
|
$(ROOT)/support/bsim generatesigs <ghidraURL>
|
||||||
bsim=<bsimURL></CODE></TD>
|
--bsim <bsimURL></CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
||||||
ghidra://localhost/repo/folder /xmldirectory
|
ghidra://localhost/repo/folder /xmldirectory
|
||||||
bsim=postgresql://localhost/repo</CODE></TD>
|
--bsim postgresql://localhost/repo</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -148,7 +148,7 @@
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generatesigs
|
||||||
ghidra://localhost/repo/folder /xmldirectory bsim=postgresql://localhost/repo
|
ghidra://localhost/repo/folder /xmldirectory --bsim postgresql://localhost/repo
|
||||||
--commit</CODE></TD>
|
--commit</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
the signature generation process, such as database specific executable categories or
|
the signature generation process, such as database specific executable categories or
|
||||||
function tags. As in the example above, configuration information
|
function tags. As in the example above, configuration information
|
||||||
is pulled from the BSim server and signatures are generated from the Ghidra Server
|
is pulled from the BSim server and signatures are generated from the Ghidra Server
|
||||||
executables. If the <SPAN class="bold"><STRONG>config=</STRONG></SPAN>
|
executables. If the <SPAN class="bold"><STRONG>--config</STRONG></SPAN>
|
||||||
option is used, assuming the template it specifies is the same one used to create the
|
option is used, assuming the template it specifies is the same one used to create the
|
||||||
database and there are no executable categories or function tags, the BSim server
|
database and there are no executable categories or function tags, the BSim server
|
||||||
does not need to be running.</P>
|
does not need to be running.</P>
|
||||||
@@ -199,7 +199,7 @@
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim commitsigs
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim commitsigs
|
||||||
postgresql://localhost/repo /xmldirectory [override=<EM>ghidraURL</EM>]</CODE></TD>
|
postgresql://localhost/repo /xmldirectory [--override <EM><ghidraURL></EM>]</CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -215,7 +215,7 @@
|
|||||||
"emphasis"><EM>repository</EM></SPAN> and <SPAN class="emphasis"><EM>path</EM></SPAN>
|
"emphasis"><EM>repository</EM></SPAN> and <SPAN class="emphasis"><EM>path</EM></SPAN>
|
||||||
associated with it in the form of a <SPAN class="emphasis"><EM>ghidra://</EM></SPAN> URL
|
associated with it in the form of a <SPAN class="emphasis"><EM>ghidra://</EM></SPAN> URL
|
||||||
that was recorded when the XML files were generated. This path can be overridden with the
|
that was recorded when the XML files were generated. This path can be overridden with the
|
||||||
optional <SPAN class="bold"><STRONG>override=</STRONG></SPAN> parameter where a revised
|
optional <SPAN class="bold"><STRONG>--override</STRONG></SPAN> option where a revised
|
||||||
Ghidra URL may be specified.</P>
|
Ghidra URL may be specified.</P>
|
||||||
|
|
||||||
<P>The <SPAN class="command"><STRONG>bsim commitsigs</STRONG></SPAN> command can be
|
<P>The <SPAN class="command"><STRONG>bsim commitsigs</STRONG></SPAN> command can be
|
||||||
@@ -526,21 +526,21 @@ public void adjustTags(Address myaddress) throws Exception {
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim delete <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim delete <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN> md5=<SPAN class=
|
"emphasis"><EM><bsimURL></EM></SPAN> --md5 <SPAN class=
|
||||||
"emphasis"><EM>7abf...</EM></SPAN></CODE></TD>
|
"emphasis"><EM>7abf...</EM></SPAN></CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim delete <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim delete <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN> name=<SPAN class=
|
"emphasis"><EM><bsimURL></EM></SPAN> --name <SPAN class=
|
||||||
"emphasis"><EM>...</EM></SPAN></CODE></TD>
|
"emphasis"><EM>...</EM></SPAN></CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
|
|
||||||
<P>In the <SPAN class="emphasis"><EM>md5</EM></SPAN> form, you specify the 32 character
|
<P>In the <SPAN class="emphasis"><EM>--md5</EM></SPAN> form, you specify the 32 character
|
||||||
hex representation of the md5 hash of the executable, which should identify it
|
hex representation of the md5 hash of the executable, which should identify it
|
||||||
uniquely. Using the <SPAN class="emphasis"><EM>name</EM></SPAN> form, there is the
|
uniquely. Using the <SPAN class="emphasis"><EM>--name</EM></SPAN> form, there is the
|
||||||
possibility that the name is not unique, in which case the command will fail.</P>
|
possibility that the name is not unique, in which case the command will fail.</P>
|
||||||
|
|
||||||
<P>If a unique executable is identified, its metadata record will be removed, and the
|
<P>If a unique executable is identified, its metadata record will be removed, and the
|
||||||
@@ -580,11 +580,11 @@ public void adjustTags(Address myaddress) throws Exception {
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generateupdates
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim generateupdates
|
||||||
<ghidraURL> </xmldirectory> config=<config_template>
|
<ghidraURL> </xmldirectory> --config <config_template>
|
||||||
[--overwrite]<BR>
|
[--overwrite]<BR>
|
||||||
$(ROOT)/support/bsim generateupdates <ghidraURL> </xmldirectory>
|
$(ROOT)/support/bsim generateupdates <ghidraURL> </xmldirectory>
|
||||||
bsim=<bsimURL> [--commit] [--overwrite]<BR>
|
--bsim <bsimURL> [--commit] [--overwrite]<BR>
|
||||||
$(ROOT)/support/bsim generateupdates <ghidraURL> bsim=<bsimURL><BR>
|
$(ROOT)/support/bsim generateupdates <ghidraURL> --bsim <bsimURL><BR>
|
||||||
<BR>
|
<BR>
|
||||||
$(ROOT)/support/bsim commitupdates <bsimURL>
|
$(ROOT)/support/bsim commitupdates <bsimURL>
|
||||||
</xmldirectory></CODE></TD>
|
</xmldirectory></CODE></TD>
|
||||||
@@ -596,11 +596,13 @@ public void adjustTags(Address myaddress) throws Exception {
|
|||||||
stripped down metadata XML files for every executable contained within the repository
|
stripped down metadata XML files for every executable contained within the repository
|
||||||
folder specified by the <EM>ghidraURL</EM>. Just like the <SPAN class=
|
folder specified by the <EM>ghidraURL</EM>. Just like the <SPAN class=
|
||||||
"bold"><STRONG>generatesigs</STRONG></SPAN> command, it can take an optional <SPAN
|
"bold"><STRONG>generatesigs</STRONG></SPAN> command, it can take an optional <SPAN
|
||||||
class="bold"><STRONG>config=<EM>config_template</EM></STRONG></SPAN> parameter, which
|
class="bold"><STRONG>--config <EM><config_template></EM></STRONG></SPAN> parameter, which
|
||||||
allows the command to execute without the BSim server running. It can also take an
|
allows the command to execute without the BSim server running, otherwise a <SPAN
|
||||||
|
class="bold"><STRONG>--bsim <EM><bsimURL></EM></STRONG></SPAN>
|
||||||
|
parameter is required. It can also take an
|
||||||
optional <SPAN class="bold"><STRONG>--overwrite</STRONG></SPAN> parameter, causing it
|
optional <SPAN class="bold"><STRONG>--overwrite</STRONG></SPAN> parameter, causing it
|
||||||
to overwrite any previously generated XML files. If a
|
to overwrite any previously generated XML files. If the
|
||||||
<STRONG>bsim=<EM>bsimURL</EM></STRONG> is specified with the <STRONG>--commit</STRONG>
|
<STRONG>--bsim</STRONG> option is specified with the <STRONG>--commit</STRONG>
|
||||||
option updates will be committed directly to the database. A BSim database commit is
|
option updates will be committed directly to the database. A BSim database commit is
|
||||||
always performed using the specified <EM>bsimURL</EM> if an <EM>xmldirectory</EM> is
|
always performed using the specified <EM>bsimURL</EM> if an <EM>xmldirectory</EM> is
|
||||||
not specified.</P>
|
not specified.</P>
|
||||||
@@ -635,7 +637,7 @@ public void adjustTags(Address myaddress) throws Exception {
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim dropindex <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim dropindex <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN></CODE></TD>
|
"emphasis"><EM><bsimURL></EM></SPAN></CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
@@ -646,7 +648,7 @@ public void adjustTags(Address myaddress) throws Exception {
|
|||||||
<TABLE border="0" summary="Simple list" class="simplelist">
|
<TABLE border="0" summary="Simple list" class="simplelist">
|
||||||
<TR>
|
<TR>
|
||||||
<TD><CODE class="computeroutput">$(ROOT)/support/bsim rebuildindex <SPAN class=
|
<TD><CODE class="computeroutput">$(ROOT)/support/bsim rebuildindex <SPAN class=
|
||||||
"emphasis"><EM>bsimURL</EM></SPAN></CODE></TD>
|
"emphasis"><EM><bsimURL></EM></SPAN></CODE></TD>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
</DIV>
|
</DIV>
|
||||||
|
|||||||
Executable → Regular
+440
-353
File diff suppressed because it is too large
Load Diff
@@ -245,7 +245,7 @@ public interface FunctionDatabase extends AutoCloseable {
|
|||||||
public static boolean checkSettingsForInsert(DescriptionManager manage,
|
public static boolean checkSettingsForInsert(DescriptionManager manage,
|
||||||
DatabaseInformation info) throws LSHException, DatabaseNonFatalException {
|
DatabaseInformation info) throws LSHException, DatabaseNonFatalException {
|
||||||
if (manage.numFunctions() == 0) {
|
if (manage.numFunctions() == 0) {
|
||||||
throw new DatabaseNonFatalException("ls ~/junk" + "");
|
throw new DatabaseNonFatalException("Empty signature file");
|
||||||
}
|
}
|
||||||
int res = info.checkSignatureSettings(manage.getMajorVersion(), manage.getMinorVersion(),
|
int res = info.checkSignatureSettings(manage.getMajorVersion(), manage.getMinorVersion(),
|
||||||
manage.getSettings());
|
manage.getSettings());
|
||||||
|
|||||||
+189
-170
File diff suppressed because it is too large
Load Diff
+14
-4
@@ -37,6 +37,7 @@ import ghidra.features.bsim.query.client.tables.ExeTable.ExeTableOrderColumn;
|
|||||||
import ghidra.features.bsim.query.description.*;
|
import ghidra.features.bsim.query.description.*;
|
||||||
import ghidra.features.bsim.query.protocol.*;
|
import ghidra.features.bsim.query.protocol.*;
|
||||||
import ghidra.features.bsim.query.protocol.ResponseDelete.DeleteResult;
|
import ghidra.features.bsim.query.protocol.ResponseDelete.DeleteResult;
|
||||||
|
import ghidra.framework.Application;
|
||||||
import ghidra.framework.client.ClientUtil;
|
import ghidra.framework.client.ClientUtil;
|
||||||
import ghidra.framework.protocol.ghidra.GhidraURL;
|
import ghidra.framework.protocol.ghidra.GhidraURL;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
@@ -184,6 +185,10 @@ public class BulkSignatures implements AutoCloseable {
|
|||||||
insertreq.path_override = GhidraURL.getProjectPathname(ghidraOverrideURL);
|
insertreq.path_override = GhidraURL.getProjectPathname(ghidraOverrideURL);
|
||||||
}
|
}
|
||||||
loadSignatureXml(file, insertreq.manage);
|
loadSignatureXml(file, insertreq.manage);
|
||||||
|
if (insertreq.manage.numFunctions() == 0) {
|
||||||
|
Msg.warn(this, file.getName() + ": does not define any functions");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (insertreq.execute(querydb) == null) {
|
if (insertreq.execute(querydb) == null) {
|
||||||
Error lastError = querydb.getLastError();
|
Error lastError = querydb.getLastError();
|
||||||
if ((lastError.category == ErrorCategory.Format) ||
|
if ((lastError.category == ErrorCategory.Format) ||
|
||||||
@@ -646,7 +651,7 @@ public class BulkSignatures implements AutoCloseable {
|
|||||||
establishQueryServerConnection(false);
|
establishQueryServerConnection(false);
|
||||||
ExeTableOrderColumn sortEnum;
|
ExeTableOrderColumn sortEnum;
|
||||||
if (sortCol != null) {
|
if (sortCol != null) {
|
||||||
sortEnum = ExeTableOrderColumn.valueOf(sortCol);
|
sortEnum = ExeTableOrderColumn.valueOf(sortCol.toUpperCase());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sortEnum = ExeTableOrderColumn.MD5;
|
sortEnum = ExeTableOrderColumn.MD5;
|
||||||
@@ -961,11 +966,12 @@ public class BulkSignatures implements AutoCloseable {
|
|||||||
protected File establishTemporaryDirectory(String xmldir) throws IOException {
|
protected File establishTemporaryDirectory(String xmldir) throws IOException {
|
||||||
File dir;
|
File dir;
|
||||||
if (xmldir == null) {
|
if (xmldir == null) {
|
||||||
String tempDirString = System.getProperty("java.io.tmpdir");
|
File tmpDir = Application.getUserTempDirectory();
|
||||||
if (tempDirString == null) {
|
if (tmpDir == null) {
|
||||||
throw new IOException("Could not find temporary directory");
|
throw new IOException("Could not find temporary directory");
|
||||||
}
|
}
|
||||||
dir = new File(tempDirString, "bulkinsert_xml");
|
dir = new File(tmpDir, "bulkinsert_xml");
|
||||||
|
deleteTemporaryDirectory(dir);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dir = new File(xmldir);
|
dir = new File(xmldir);
|
||||||
@@ -983,6 +989,9 @@ public class BulkSignatures implements AutoCloseable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void deleteTemporaryDirectory(File tempDir) throws IOException {
|
private void deleteTemporaryDirectory(File tempDir) throws IOException {
|
||||||
|
if (!tempDir.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
File[] listFiles = tempDir.listFiles();
|
File[] listFiles = tempDir.listFiles();
|
||||||
if (listFiles == null) {
|
if (listFiles == null) {
|
||||||
throw new IOException(
|
throw new IOException(
|
||||||
@@ -1106,6 +1115,7 @@ public class BulkSignatures implements AutoCloseable {
|
|||||||
if (manager.numFunctions() == 0) {
|
if (manager.numFunctions() == 0) {
|
||||||
Msg.warn(this, program.getDomainFile().getName() +
|
Msg.warn(this, program.getDomainFile().getName() +
|
||||||
" contains no functions with signatures");
|
" contains no functions with signatures");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
FileWriter fwrite = new FileWriter(file);
|
FileWriter fwrite = new FileWriter(file);
|
||||||
manager.saveXml(fwrite);
|
manager.saveXml(fwrite);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Command-line script for interacting with a BSim database
|
# Command-line script for interacting with a BSim database
|
||||||
|
|
||||||
# maximum heap memory (may be increased)
|
# maximum heap memory (may be increased)
|
||||||
MAXMEM=1G
|
MAXMEM=2G
|
||||||
|
|
||||||
# launch mode (fg, bg, debug, debug-suspend)
|
# launch mode (fg, bg, debug, debug-suspend)
|
||||||
LAUNCH_MODE=fg
|
LAUNCH_MODE=fg
|
||||||
|
|||||||
@@ -3,9 +3,8 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal
|
setlocal
|
||||||
|
|
||||||
:: Maximum heap memory may be changed if default is inadequate. This will generally be up to 1/4 of
|
:: maximum heap memory (may be increased)
|
||||||
:: the physical memory available to the OS. Uncomment MAXMEM setting if non-default value is needed.
|
set MAXMEM=2G
|
||||||
::set MAXMEM=2G
|
|
||||||
|
|
||||||
:: launch mode (fg, bg, debug, debug-suspend)
|
:: launch mode (fg, bg, debug, debug-suspend)
|
||||||
set LAUNCH_MODE=fg
|
set LAUNCH_MODE=fg
|
||||||
|
|||||||
@@ -23,13 +23,13 @@ Non-shared projects are locked when open, and the lock will prevent the signatur
|
|||||||
|
|
||||||
<pre><code class="language-bash">cd <ghidra_install_dir>/support
|
<pre><code class="language-bash">cd <ghidra_install_dir>/support
|
||||||
mkdir ~/bsim_sigs
|
mkdir ~/bsim_sigs
|
||||||
./bsim generatesigs ghidra:/<ghidra_project_dir>/postgres_object_files bsim=file:/<database_dir>/example ~/bsim_sigs
|
./bsim generatesigs ghidra:/<ghidra_project_dir>/postgres_object_files --bsim file:/<database_dir>/example ~/bsim_sigs
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>The <code>ghidra:/</code> argument is the local project which holds the analyzed binaries.
|
<li>The <code>ghidra:/</code> argument is the local project which holds the analyzed binaries.
|
||||||
Note that there is only one forward slash in the URL for a local project.</li>
|
Note that there is only one forward slash in the URL for a local project.</li>
|
||||||
<li>The <code>bsim=</code> argument is the URL of the BSim database.
|
<li>The <code>--bsim</code> argument is the URL of the BSim database.
|
||||||
This command does not add any signatures to the database, but it does query the database for its settings.</li>
|
This command does not add any signatures to the database, but it does query the database for its settings.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ To generate the signature files, execute the following commands in a shell (adju
|
|||||||
```bash
|
```bash
|
||||||
cd <ghidra_install_dir>/support
|
cd <ghidra_install_dir>/support
|
||||||
mkdir ~/bsim_sigs
|
mkdir ~/bsim_sigs
|
||||||
./bsim generatesigs ghidra:/<ghidra_project_dir>/postgres_object_files bsim=file:/<database_dir>/example ~/bsim_sigs
|
./bsim generatesigs ghidra:/<ghidra_project_dir>/postgres_object_files --bsim file:/<database_dir>/example ~/bsim_sigs
|
||||||
```
|
```
|
||||||
|
|
||||||
- The ``ghidra:/`` argument is the local project which holds the analyzed binaries.
|
- The ``ghidra:/`` argument is the local project which holds the analyzed binaries.
|
||||||
Note that there is only one forward slash in the URL for a local project.
|
Note that there is only one forward slash in the URL for a local project.
|
||||||
- The ``bsim=`` argument is the URL of the BSim database.
|
- The ``--bsim`` argument is the URL of the BSim database.
|
||||||
This command does not add any signatures to the database, but it does query the database for its settings.
|
This command does not add any signatures to the database, but it does query the database for its settings.
|
||||||
|
|
||||||
## Committing Signature Files
|
## Committing Signature Files
|
||||||
|
|||||||
Reference in New Issue
Block a user