Skip to content

Commit

Permalink
recommit v1.1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Aug 17, 2015
1 parent 6bcc3a2 commit 38b4d91
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 19 deletions.
2 changes: 1 addition & 1 deletion const.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef __CONST__H__
#define __CONST__H__

#define PLUGIN_VERSION "v1.0"
#define PLUGIN_VERSION "v1.1"
#define PLUGIN_TITLE " ¼ÓÇ¿°æ"

#define SI_BUF_SIZE 256
Expand Down
16 changes: 15 additions & 1 deletion sihook.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <windows.h>
#include "siframe.h"
#include "mdiclient.h"
#include "patch.h"

HWND hwnd_si_frame = NULL;
HWND hwnd_mdi_client = NULL;
Expand All @@ -16,7 +17,7 @@ void HookSI(void)
ExitProcess(-1);
}
HookSiFrame();

//hook MDIClient
hwnd_mdi_client = GetMdiClientHwnd(hwnd_si_frame);
if(hwnd_mdi_client == NULL)
Expand All @@ -25,6 +26,19 @@ void HookSI(void)
ExitProcess(-1);
}
HookMdiClient();

//Path SI
if(PatchSI() == 0)
{
OutputDebugString("PatchSI Success!");
}
else
{
OutputDebugString("PatchSI Failed!");
}

//hook apis
//HookWinApi();
}

void UnhookSI(void)
Expand Down
13 changes: 9 additions & 4 deletions sihook.cbp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<Option compiler="gcc" />
<Build>
<Target title="Debug">
<Option output="bin\Debug\sihook" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Debug\" />
<Option output="bin/Debug/sihook" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
Expand All @@ -25,8 +25,8 @@
</Linker>
</Target>
<Target title="Release">
<Option output="bin\Release\sihook" prefix_auto="1" extension_auto="1" />
<Option object_output="obj\Release\" />
<Option output="bin/Release/sihook" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Release/" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
Expand All @@ -49,6 +49,10 @@
<Option compilerVar="CC" />
</Unit>
<Unit filename="mdiclient.h" />
<Unit filename="patch.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="patch.h" />
<Unit filename="siframe.c">
<Option compilerVar="CC" />
</Unit>
Expand All @@ -71,6 +75,7 @@
<Extensions>
<code_completion />
<debugger />
<envvars />
</Extensions>
</Project>
</CodeBlocks_project_file>
27 changes: 14 additions & 13 deletions utils.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <string.h>
#include <stdio.h>
#include "utils.h"

//输出调试信息
Expand All @@ -8,7 +9,7 @@ void WINAPI OutputDebugStringEx(LPCTSTR lpcFormatText, ...)

va_list argptr;
va_start(argptr, lpcFormatText);
wvsprintf(szBuffer, lpcFormatText, argptr);
vsprintf(szBuffer, lpcFormatText, argptr);
va_end(argptr);

OutputDebugString(szBuffer);
Expand Down Expand Up @@ -36,12 +37,12 @@ char* GetSiSwTitle(const char* lpc,char* title)
i++;
continue;
}

if(skip_flag == 0)
{
title[index++] = lpc[i];
}

i++;
}
title[index] = '\0';
Expand Down Expand Up @@ -96,10 +97,10 @@ int GetColorIndex(const char* filename)
return 2;
p = strstri(filename,".hpp");
if(p != NULL)
return 2;
return 2;
p = strstri(filename,".hxx");
if(p != NULL)
return 2;
return 2;
p = strstri(filename,".inc");
if(p != NULL)
return 2;
Expand All @@ -109,20 +110,20 @@ int GetColorIndex(const char* filename)
return 3;
p = strstri(filename,".text");
if(p != NULL)
return 3;
return 3;
p = strstri(filename,".doc");
if(p != NULL)
return 3;
return 3;
//type 4
p = strstri(filename,".php");
if(p != NULL)
return 4;
p = strstri(filename,".php3");
if(p != NULL)
return 4;
return 4;
p = strstri(filename,".htm");
if(p != NULL)
return 4;
return 4;
p = strstri(filename,".js");
if(p != NULL)
return 4;
Expand All @@ -132,14 +133,14 @@ int GetColorIndex(const char* filename)
return 5;
p = strstri(filename,".pb");
if(p != NULL)
return 5;
return 5;
p = strstri(filename,".vbs");
if(p != NULL)
return 5;
return 5;
p = strstri(filename,".vb");
if(p != NULL)
return 5;
return 5;

return 0;
}

0 comments on commit 38b4d91

Please sign in to comment.