Skip to content

Commit

Permalink
Fix several bugs
Browse files Browse the repository at this point in the history
* set $ida_path$ of the conf file after installation
* able to call the ida script whose path has a space
* able to index binary on the admin page
* correct typos
* released installer is updated
  • Loading branch information
steven-hh-ding committed Oct 4, 2015
1 parent 549a890 commit 197d2a4
Show file tree
Hide file tree
Showing 24 changed files with 35 additions and 64 deletions.
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,7 @@ docs/_build/
# PyBuilder
target/
Kam1n0WinSetupProject/bin_release/Kam1n0-distribution/Kam1n0-0.1.0.jar
Kam1n0WinSetupProject/bin/Debug/Kam1n0WinSetupProject.wixpdb
Kam1n0WinSetupProject/bin/Debug/Kam1n0WinSetupProject.msi
Kam1n0WinSetupProject/bin/Release/
Kam1n0WinSetupProject/bin/Debug/
*.dll
*.pdb
49 changes: 6 additions & 43 deletions CustomActions/KamActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@ namespace CustomActions
{
public class KamActions
{

public static void main()
{

}


public static void setPath(string distrPath, string setDataPath)
{
string confFile = distrPath + "\\kam1n0-conf.xml";
string logFile = distrPath + "\\log4j2.xml";
string confStr = File.ReadAllText(confFile);
string logStr = File.ReadAllText(logFile);
string identifier = @"$PATH_DATA$";
confStr = confStr.Replace(identifier, setDataPath);
logStr = logStr.Replace(identifier, setDataPath);
File.WriteAllText(confFile, confStr);
File.WriteAllText(logFile, logStr);
}

public static bool CheckIfIsIdaPluginsFolder(String selectedPath)
{
bool isCorrectFolder = false;
Expand Down Expand Up @@ -73,34 +53,17 @@ public static ActionResult ValidaIDAPRO(Session session)
string selectedPath = session[selectedVar];
session.Log(selectedPath);
if (CheckIfIsIdaPluginsFolder(selectedPath))
{
session["INSTALL_DIR_VALID"] = "1";
session["PATH_IDA"] = (new DirectoryInfo(selectedPath)).Parent.FullName;
}
else
{
session["INSTALL_DIR_VALID"] = "0";
session["PATH_IDA"] = "";
}

return ActionResult.Success;
}

[CustomAction]
public static ActionResult UpdateConfFiles(Session session)
{

session.Log("here");
session.Log("here");
session.Log("here");

string intallVar = session["INSTALL_DIR"];
string installPath = session[intallVar];
string dataVar = session["DATA_DIR"];
string dataPath = session[dataVar];

setPath(installPath, dataPath);

return ActionResult.Success;
}





}
}
Binary file modified CustomActions/bin/Debug/CustomActions.CA.dll
Binary file not shown.
Binary file modified CustomActions/bin/Debug/CustomActions.dll
Binary file not shown.
Binary file modified CustomActions/bin/Debug/CustomActions.pdb
Binary file not shown.
Binary file modified CustomActions/obj/x86/Debug/CustomActions.CA.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@ C:\ding\IDA 6.7\plugins\Kam1n0WinSetupProject\CustomActions\bin\Debug\Microsoft.
C:\ding\IDA 6.7\plugins\Kam1n0WinSetupProject\CustomActions\bin\Debug\Microsoft.Deployment.WindowsInstaller.xml
C:\ding\IDA 6.7\plugins\Kam1n0WinSetupProject\CustomActions\obj\x86\Debug\CustomActions.dll
C:\ding\IDA 6.7\plugins\Kam1n0WinSetupProject\CustomActions\obj\x86\Debug\CustomActions.pdb
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\bin\Debug\CustomActions.dll
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\bin\Debug\CustomActions.CA.dll
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\bin\Debug\CustomActions.pdb
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\bin\Debug\Microsoft.Deployment.WindowsInstaller.dll
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\bin\Debug\Microsoft.Deployment.WindowsInstaller.xml
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\obj\x86\Debug\CustomActions.dll
E:\GitRepo\Kam1n0-Plugin-IDA-Pro\CustomActions\obj\x86\Debug\CustomActions.pdb
Binary file modified CustomActions/obj/x86/Debug/CustomActions.dll
Binary file not shown.
Binary file modified CustomActions/obj/x86/Debug/CustomActions.pdb
Binary file not shown.
Binary file modified Kam1n0WinSetupProject.v12.suo
Binary file not shown.
1 change: 1 addition & 0 deletions Kam1n0WinSetupProject/GroupDistribution.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<Component Id="cmp387A9B7B00334EBEB1B608DBDA717DCA" Guid="{53C9B447-17A0-41DC-B909-863C934414AB}">
<File Id="fil6FF9EA9D029E0D5373A2BA745B7885AE" KeyPath="yes" Source="$(var.dir_src_distribution)\kam1n0-conf.xml" />
<util:XmlFile Id="FileConfXmlE" Action="setValue" ElementPath="/Kam1n0-Configuration/entry/string[\[]text()='$PATH_DATA$'[\]]" File="[DISTRIBUTIONDIR]\kam1n0-conf.xml" Value="[KAM_DATA_DIR]"/>
<util:XmlFile Id="FileConfXmlE.IDA.PATH" Action="setValue" ElementPath="/Kam1n0-Configuration/entry/string[\[]text()='$PATH_IDA$'[\]]" File="[DISTRIBUTIONDIR]\kam1n0-conf.xml" Value="[PATH_IDA]"/>
</Component>
<Component Id="cmp0F399B4ED81C3C9C333EB81B8DA3C2E3" Guid="{A157AE6F-0BC6-4595-96C1-954E3B51EE32}">
<File Id="Kam1n0.exe" KeyPath="yes" Source="$(var.dir_src_distribution)\Kam1n0.exe" >
Expand Down
20 changes: 10 additions & 10 deletions Kam1n0WinSetupProject/InstallerUI.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@
<Binary Id="bkImgW" SourceFile="images/bgw.bmp"/>
<Binary Id="bkImgB" SourceFile="images/bgb.bmp"/>
<Binary Id="bkImgR" SourceFile="images/bgr.bmp"/>
<Binary Id="cover" SourceFile="images/cover.png"/>
<Binary Id="cvImg" SourceFile="images/cover.png"/>
<Binary Id="cover" SourceFile="images/cover.bmp"/>
<Binary Id="cvImg" SourceFile="images/cover.bmp"/>
<Binary Id="btnCancel" SourceFile="images/cancelbtn.bmp"/>
<Binary Id="btnInstall" SourceFile="images/installbtn.png"/>
<Binary Id="btnInstall" SourceFile="images/installbtn.bmp"/>
<Binary Id="side" SourceFile="images/side.bmp"/>
<Binary Id="error_folder" SourceFile="images/folder_error.png"/>
<Binary Id="error_folder" SourceFile="images/folder_error.bmp"/>
<Binary Id="up_folder" SourceFile="images/folder_up.ico"/>
<Binary Id="add_folder" SourceFile="images/folder_add.ico"/>
<Binary Id="icnT" SourceFile="images/icon.bmp"/>
Expand All @@ -80,7 +80,7 @@
<Control Id="explanationText" X="5" Y="140" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="300" Height="100" Text="{\TahomaNormal}To continue with the setup click on the Install button. If you choose not to install this application, close this dialog to exit." />
<Control Id="explanationTextBk" Type="Bitmap" Text="bkImgR" Height="23" Width="305" X="0" Y="140" TabSkip="no" />

<Control Id="introText5" Type="Text" X="5" Y="188" Width="500" Height="20" Transparent="yes" Text="{\TahomaNormalBold}Contributors: Benjamin C. M. Fung and Steven H. H. Ding" />
<Control Id="introText5" Type="Text" X="5" Y="188" Width="500" Height="20" Transparent="yes" Text="{\TahomaNormalBold}Contributors: Steven H. H. Ding and Benjamin C. M. Fung" />
<Control Id="introText56Bk" Type="Bitmap" Text="bkImgB" Height="12" Width="280" X="0" Y="188" TabSkip="no" />

<Control Id="installButton" Type="PushButton" Text="btnInstall" Height="31" Width="90" X="500" Y="159" Bitmap="yes">
Expand Down Expand Up @@ -184,7 +184,7 @@

<Control Id="introText" Type="Text" X="145" Y="20" Width="400" Height="25" Transparent="yes" Text="{\TahomaHeader}Selecting the Installation Location" />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}Please choose where you would like us to install the software." />
<Control Id="explanationText2" X="165" Y="80" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}The plugin has to be installed at the plugins folder under IDA-Pro folder. Please select the $IDAPRO$/plugins as the installation path. Typically on x86 windows it will be C:\Program Files\IDA 6.7\plugins." />
<Control Id="explanationText2" X="165" Y="80" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}The plugin has to be installed at the plugins folder under IDA-Pro folder. Please select the $IDAPRO$/plugins as the installation path. Typically on x86 windows it will be C:\Program Files\IDA 6.8\plugins." />
<Control Id="explanationText3" X="145" Y="200" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}We will validate the selected path before next step to ensure it will be working properly." />

<Control Id="FolderLabel" X="145" Y="135" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}The plugins folder under IDA-Pro installation path:" />
Expand Down Expand Up @@ -219,7 +219,7 @@
<Control Id="OK" Type="PushButton" X="102" Y="57" Width="56" Height="17" Default="yes" Cancel="yes" Text="OK)">
<Publish Event="EndDialog" Value="Return">1</Publish>
</Control>
<Control Id="Text" Type="Text" X="48" Y="22" Width="194" Height="30" Text="{\TahomaNormalBlk}The selected installaton path is not valid." Transparent="yes" />
<Control Id="Text" Type="Text" X="48" Y="22" Width="194" Height="30" Text="{\TahomaNormalBlk}The selected installation path is not valid." Transparent="yes" />
<Control Id="Icon" Type="Bitmap" Text="error_folder" Height="32" Width="32" X="15" Y="15" TabSkip="no" />
</Dialog>

Expand Down Expand Up @@ -290,7 +290,7 @@


<Control Id="introText" Type="Text" X="145" Y="20" Width="400" Height="25" Transparent="yes" Text="{\TahomaHeader}Features to be Installed" />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}Please review the following features that to be installed on your computer." />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}Please review the following features that will be installed on your computer." />

<Control Id="Tree" Type="SelectionTree" X="145" Y="80" Width="202" Height="115" Property="_BrowseProperty" Sunken="no" TabSkip="no" Text="Features" />
<Control Id="Box" Type="GroupBox" X="357" Y="76" Width="202" Height="118" />
Expand Down Expand Up @@ -353,7 +353,7 @@


<Control Id="introText" Type="Text" X="145" Y="20" Width="400" Height="25" Transparent="yes" Text="{\TahomaHeader}Kam1n0 Engine Configuration" />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}Please configure the directory for Kam1n0 to store the indexed the data." />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}Please configure the directory for Kam1n0 to store the indexed data." />
<Control Id="explanationText2" X="145" Y="80" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}Following data will be stored at this directory: " />
<Control Id="explanationText2l1" X="155" Y="90" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}* The indexed assembly data" />
<Control Id="explanationText2l2" X="155" Y="100" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}* The engine logs" />
Expand Down Expand Up @@ -461,7 +461,7 @@


<Control Id="introText" Type="Text" X="145" Y="20" Width="400" Height="25" Transparent="yes" Text="{\TahomaHeader}Kam1n0 Engine Configuration" />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}The installation of Kam1n0 and its plugin for IDA-Pro has completed; however, we stil need to install some of its dependencies." />
<Control Id="explanationText" X="145" Y="60" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="400" Height="100" Text="{\TahomaNormal}The installation of Kam1n0 and its plugin for IDA-Pro has completed; however, we still need to install some of its dependencies." />
<Control Id="explanationText2" X="145" Y="100" NoWrap="no" RightAligned="no" Transparent="yes" Type="Text" Width="350" Height="100" Text="{\TahomaNormal}After this dialog, you will be prompted to install other dependencies in sequence." />

<Control Id="Finish" Type="PushButton" Height="17" Width="200" X="360" Y="275" Default="yes" Cancel="yes" Text="Install Dependencies and Finish" >
Expand Down
1 change: 0 additions & 1 deletion Kam1n0WinSetupProject/Kam1n0WinSetupProject.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
<Content Include="images\folder_up.ico" />
<Content Include="images\icon.bmp" />
<Content Include="images\installbtn.bmp" />
<Content Include="images\installbtn.png" />
<Content Include="images\progressbar.bmp" />
<Content Include="images\side.bmp" />
<Content Include="_note.txt" />
Expand Down
1 change: 1 addition & 0 deletions Kam1n0WinSetupProject/Product.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<UIRef Id="InstallerUI" />
<Property Id="INSTALL_DIR">PLUGINSDIR</Property>
<Property Id="DATA_DIR">KAM_DATA_DIR</Property>
<Property Id="PATH_IDA"></Property>
<Property Id="INSTALLDESKTOPSHORTCUT" Value="1" />

<!--Actions-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, manager):
BUTTON CANCEL Cancel
Kam1n0
{FormChangeCb}
Select Function to be searched
Select function to be searched
<(Use ctrl/shift + click to select multiple functions):{fvChooser}>
<Select all functions:{chkSearchAll}><Skip library functions:{chkSkipLib}>{adSearchGroup}>
Search configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, manager):
BUTTON CANCEL Cancel
Kam1n0
{FormChangeCb}
Select Function to be indexed
Select function to be indexed
<(Use ctrl/shift + click to select multiple functions):{fvChooser}>
<Select all functions:{chkSearchAll}>
<Select all library functions:{chkOnlyLib}>
Expand Down
4 changes: 1 addition & 3 deletions Kam1n0WinSetupProject/bin_release/plugins/Kam1n0/IDAutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ def GetContentStr(func):


def GetBinaryName():
global BinaryName
if BinaryName is None:
BinaryName = idaapi.get_input_file_path()
BinaryName = idaapi.get_input_file_path()
return BinaryName


Expand Down
Binary file added Kam1n0WinSetupProject/images/cover.bmp
Binary file not shown.
Binary file added Kam1n0WinSetupProject/images/folder_error.bmp
Binary file not shown.
Binary file modified Kam1n0WinSetupProject/images/installbtn.bmp
Binary file not shown.
Binary file removed Kam1n0WinSetupProject/images/installbtn.png
Binary file not shown.
2 changes: 1 addition & 1 deletion Kam1n0WinSetupProject/obj/Debug/GroupDistribution.wixobj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Kam1n0WinSetupProject/obj/Debug/InstallerUI.wixobj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Kam1n0WinSetupProject/obj/Debug/Product.wixobj

Large diffs are not rendered by default.

0 comments on commit 197d2a4

Please sign in to comment.