Skip to content

Commit

Permalink
Update SRLTracer
Browse files Browse the repository at this point in the history
  • Loading branch information
marcussacana committed May 23, 2019
1 parent 906eaaf commit 4ce4433
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 13 deletions.
Binary file modified Help/Debug Utility.rar
Binary file not shown.
3 changes: 3 additions & 0 deletions SRL/Hook/FileHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ static partial class StringReloader
{
static void InstallCreateFileHooks()
{
if (Managed)
return;

dGetFileAttrA = new GetFileAttributesADelegate(GetFileAttributes);
dGetFileAttrW = new GetFileAttributesWDelegate(GetFileAttributes);
dGetFileAttrExA = new GetFileAttributesExADelegate(GetFileAttributesEx);
Expand Down
3 changes: 2 additions & 1 deletion SRL/Hook/IntroInjector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using System.Windows.Forms;

namespace SRL {

static partial class StringReloader {

#if !DEBUG
Expand All @@ -25,7 +26,7 @@ static partial class StringReloader {
static UnmanagedHook MoveWindowHook;

static void InstallIntroInjector() {
if (ShowWindowHook != null)
if (ShowWindowHook != null || Managed)
return;
#if !DEBUG
CreateWindowExADel = new CreateWindowExADelegate(hCreateWindowEx);
Expand Down
45 changes: 39 additions & 6 deletions SRL/Hook/TextHook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ static partial class StringReloader {
static UnmanagedHook hMultiByteToWideChar;

static void InstallGlyphHooks() {
if (Managed)
return;

dOutlineA = new GetGlyphOutlineDelegate(hGetGlyphOutlineA);
dOutlineW = new GetGlyphOutlineDelegate(hGetGlyphOutlineW);

Expand All @@ -61,7 +64,11 @@ static void InstallGlyphHooks() {
OutlineW.Install();
}

static void InstallTextOutHooks() {
static void InstallTextOutHooks()
{
if (Managed)
return;

dTextOutA = new TextOutADelegate(hTextOut);
dTextOutW = new TextOutWDelegate(hTextOut);

Expand All @@ -72,7 +79,11 @@ static void InstallTextOutHooks() {
hTextOutW.Install();
}

static void InstallExtTextOutHooks() {
static void InstallExtTextOutHooks()
{
if (Managed)
return;

dExtTextOutA = new ExtTextOutADelegate(hExtTextOut);
dExtTextOutW = new ExtTextOutWDelegate(hExtTextOut);

Expand All @@ -83,7 +94,11 @@ static void InstallExtTextOutHooks() {
hExtTextOutW.Install();
}

static void InstallCreateFontHooks() {
static void InstallCreateFontHooks()
{
if (Managed)
return;

dCreateFontA = new CreateFontADelegate(hCreateFont);
dCreateFontW = new CreateFontWDelegate(hCreateFont);

Expand All @@ -94,7 +109,11 @@ static void InstallCreateFontHooks() {
hCreatFontW.Install();
}

static void InstallCreateFontIndirectHooks() {
static void InstallCreateFontIndirectHooks()
{
if (Managed)
return;

dCreateFontIndirectA = new CreateFontIndirectADelegate(hCreateFontIndirectA);
dCreateFontIndirectW = new CreateFontIndirectWDelegate(hCreateFontIndirectW);

Expand All @@ -108,6 +127,8 @@ static void InstallCreateFontIndirectHooks() {

#if DEBUG
static void InstallSendMessageHooks() {
if (Managed)
return;
dSendMessageA = new SendMessageADelegate(SendMessageAHook);
dSendMessageW = new SendMessageWDelegate(SendMessageWHook);

Expand All @@ -119,6 +140,8 @@ static void InstallSendMessageHooks() {
}

static void InstallCreateWindowHooks() {
if (Managed)
return;
dCreateWindowA = new CreateWindowADelegate(CreateWindow);
dCreateWindowW = new CreateWindowWDelegate(CreateWindow);

Expand All @@ -130,6 +153,8 @@ static void InstallCreateWindowHooks() {
}

static void InstallCreateWindowExHooks() {
if (Managed)
return;
dCreateWindowExA = new CreateWindowExADelegate(CreateWindowEx);
dCreateWindowExW = new CreateWindowExWDelegate(CreateWindowEx);

Expand All @@ -141,7 +166,11 @@ static void InstallCreateWindowExHooks() {
}
#endif

static void InstallSetWindowTextHooks() {
static void InstallSetWindowTextHooks()
{
if (Managed)
return;

dSetWindowTextA = new SetWindowTextADelegate(SetWindowTextHook);
dSetWindowTextW = new SetWindowTextWDelegate(SetWindowTextHook);

Expand All @@ -152,7 +181,11 @@ static void InstallSetWindowTextHooks() {
hSetWindowTextW.Install();
}

static void InstallMultiByteToWideChar() {
static void InstallMultiByteToWideChar()
{
if (Managed)
return;

dMultiByteToWideChar = new MultiByteToWideCharDelegate(MultiByteToWideCharHook);

hMultiByteToWideChar = AutoHookCreator("kernel32.dll", "MultiByteToWideChar", dMultiByteToWideChar);
Expand Down
6 changes: 3 additions & 3 deletions SRL/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("VNX+")]
[assembly: AssemblyProduct("SRL - By Marcussacana")]
[assembly: AssemblyCopyright("Copyright © VNX+ 2017-2018")]
[assembly: AssemblyCopyright("Copyright © VNX+ 2017-2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// É possível especificar todos os valores ou usar como padrão os Números de Build e da Revisão
// usando o '*' como mostrado abaixo:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyVersion("4.1.0.0")]
[assembly: AssemblyFileVersion("4.1.0.0")]
1 change: 1 addition & 0 deletions SRL/Reloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ internal static void Init() {
else
{
NoDatabase = true;
StrRld = new Dictionary<string, string>();
Warning("Can't Compile Strings because the SRL don't found any LST.");
}
}
Expand Down
9 changes: 8 additions & 1 deletion SRL/Variables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,19 @@ static Dictionary<string, string> StrRld {
}
}

static bool? DbgFlg = null;
static bool _FrcDbg = false;
static bool Debugging {
get {
if (_FrcDbg)
return true;
return File.Exists(BaseDir + "DEBUG");

if (DbgFlg.HasValue)
return DbgFlg.Value;

DbgFlg = File.Exists(BaseDir + "DEBUG");

return DbgFlg.Value;
}
set {
_FrcDbg = value;
Expand Down
3 changes: 2 additions & 1 deletion SRLTracer/Form1.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using SacanaWrapper;
//#define DEBUG
using SacanaWrapper;
using System;
using System.Windows.Forms;

Expand Down
2 changes: 1 addition & 1 deletion SRLUnity/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static string GameDirectory {

public static string Process(string Text) {
Initialize();

IntPtr Ptr = Marshal.StringToHGlobalAuto(Text);
IntPtr New = Function(Ptr);
Text = Marshal.PtrToStringAuto(New);
Expand Down

0 comments on commit 4ce4433

Please sign in to comment.