Skip to content
This repository has been archived by the owner on Jul 13, 2020. It is now read-only.

Commit

Permalink
v1.0.0.15 - add additional lua libs opened (io, os and package) by li…
Browse files Browse the repository at this point in the history
…nking static lua library
  • Loading branch information
mrfearless committed Sep 4, 2019
1 parent 1985097 commit 395958c
Show file tree
Hide file tree
Showing 16 changed files with 1,196 additions and 553 deletions.
11 changes: 8 additions & 3 deletions EEex/EEex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ WinMain PROC USES EBX hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdSh
LOCAL lenEEGame:DWORD
LOCAL lenOverride:DWORD
LOCAL bMissingOverrides:DWORD
LOCAL childconsolesize:COORD
mov bMissingOverrides, FALSE
mov bEEGameFound, FALSE
Expand Down Expand Up @@ -532,17 +533,17 @@ WinMain PROC USES EBX hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdSh
mov SecuAttr.lpSecurityDescriptor, NULL
mov SecuAttr.bInheritHandle, TRUE
Invoke CreatePipe, Addr hChildStd_OUT_Rd, Addr hChildStd_OUT_Wr, Addr SecuAttr, NULL
Invoke CreatePipe, Addr hChildStd_OUT_Rd, Addr hChildStd_OUT_Wr, Addr SecuAttr, 0
Invoke SetHandleInformation, hChildStd_OUT_Rd, HANDLE_FLAG_INHERIT, 0
Invoke CreatePipe, Addr hChildStd_IN_Rd, Addr hChildStd_IN_Wr, Addr SecuAttr, NULL
Invoke CreatePipe, Addr hChildStd_IN_Rd, Addr hChildStd_IN_Wr, Addr SecuAttr, 0
Invoke SetHandleInformation, hChildStd_IN_Wr, HANDLE_FLAG_INHERIT, 0
mov eax, hChildStd_OUT_Wr
mov startinfo.hStdError, eax
mov startinfo.hStdOutput, eax
mov eax, hChildStd_IN_Rd
mov startinfo.hStdInput, eax
mov startinfo.hStdInput, NULL ;eax
mov startinfo.dwFlags, STARTF_USESTDHANDLES
.ELSE
IFDEF DEBUG32
Expand Down Expand Up @@ -593,6 +594,10 @@ WinMain PROC USES EBX hInst:HINSTANCE, hPrevInst:HINSTANCE, CmdLine:LPSTR, CmdSh
;------------------------------------------------------------------
; Redirect EE game output to our allocated console
;------------------------------------------------------------------
;mov childconsolesize.x, 80
;mov childconsolesize.y, 1
;Invoke SetConsoleScreenBufferSize, hChildStd_OUT_Rd, Addr childconsolesize
Invoke ConsoleText, Addr szStatusEntry
Invoke ConsoleText, Addr szStatusRedirectCon
Invoke ConsoleText, Addr szCRLF
Expand Down
Binary file modified EEex/EEex.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion EEex/EEex.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ EEEX_ALIGN TEXTEQU <ALIGN 16>
;------------------------------------------------------------------------------
AppName DB "EEex loader",0
szAppName DB "[EEex loader]",0
szAppVersion DB " v1.0.0.13",0
szAppVersion DB " v1.0.0.15",0
szEEexLoaderByfearless DB "EEex loader by fearless: github.com/mrfearless/EEexLoader",0
szEEexByBubb DB "EEex by Bubb: github.com/Bubb13/EEex",0
szCRLF DB 13,10,0
Expand Down
20 changes: 10 additions & 10 deletions EEex/EEex.rap
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,20 @@ Menu=1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0
[VerInf]
Nme=VERINF1
ID=1
FV=1.0.0.13
PV=1.0.0.13
FV=1.0.0.15
PV=1.0.0.15
VerOS=0x00000004
VerFT=0x00000001
VerLNG=0x00000409
VerCHS=0x000004B0
ProductVersion=1.0.0.13
ProductVersion=1.0.0.15
ProductName=EEex.exe
OriginalFilename=EEex.exe
LegalTrademarks=fearless
LegalCopyright=fearless
InternalName=EEex.exe
FileDescription=EEex loader
FileVersion=1.0.0.13
FileVersion=1.0.0.15
CompanyName=fearless
[Group]
Group=Assembly,Resources,Misc
Expand Down Expand Up @@ -99,16 +99,16 @@ AutoLoad=2,1,4,3,5
10="dwFileVerInfoSize"
[Size]
4=0,0,0,0,0
5=0,0,0,0,3925
5=0,0,0,0,7961
3=0,0,0,0,19
1=0,0,0,0,4139
2=0,0,0,0,1547
1=0,0,0,0,19471
2=0,0,0,0,1503
[Collapse]
3=
1=1115685378,,4194304
2=
4=
5=808288
5=808256
[VersionControl]
Settings=1279
Milestones=129
Expand All @@ -119,7 +119,7 @@ MilestoneOnTime=2
MilestoneOnDate=0
MilestoneOnDateWhen=1
MilestoneOnDateStatus=0
MilestoneOnDateDate=23
MilestoneOnDateDate=4
MilestoneOnDateTimeYear=2019
MilestoneOnDateTimeMonth=1
MilestoneOnDateTimeDate=26
Expand All @@ -143,7 +143,7 @@ ProductVer2Range=0
ProductVer3Range=0
ProductVer4Range=0
[PTimer]
PTimer=51289025
PTimer=66373868
[GroupExpand]
GroupExpand=1,0,1,0
[BookMark]
Expand Down
17 changes: 15 additions & 2 deletions EEex/EEexConsole.asm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ szLogFile DB MAX_PATH DUP (0)
szParameter1Buffer DB MAX_PATH DUP (0)
CmdLineParameters DB 512 DUP (0)

PIPEBUFFER DB 4096 DUP (0)
PIPEBUFFER DB 4096 DUP (0) ;4096 DUP (0) - modified to 1 char as console output was cutting off/lagging until it 'filled' buffer size


.DATA?
Expand Down Expand Up @@ -239,11 +239,14 @@ ReadFromPipe PROC
LOCAL dwRead:DWORD
LOCAL dwWritten:DWORD
LOCAL hParentStdOut:DWORD
LOCAL hParentStdErr:DWORD
LOCAL bSuccess:DWORD

mov bSuccess, FALSE
Invoke GetStdHandle, STD_OUTPUT_HANDLE
mov hParentStdOut, eax
Invoke GetStdHandle, STD_ERROR_HANDLE
mov hParentStdErr, eax

.WHILE TRUE
Invoke GetExitCodeProcess, pi.hProcess, Addr ExitCode
Expand All @@ -267,7 +270,17 @@ ReadFromPipe PROC
ret
.ENDIF
;Invoke Sleep, 100
; .IF dwWritten != 0
; Invoke FlushFileBuffers, hChildStd_OUT_Rd
; Invoke FlushFileBuffers, hParentStdOut
; .ENDIF
; Invoke FlushFileBuffers, hLogFile

; Invoke FlushFileBuffers, hChildStd_OUT_Wr
; Invoke FlushFileBuffers, hParentStdOut
; Invoke FlushFileBuffers, hParentStdErr
Invoke Sleep, 100
.ENDW
Expand Down
8 changes: 4 additions & 4 deletions EEex/Res/EEexVer.rc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define VERINF1 1
VERINF1 VERSIONINFO
FILEVERSION 1,0,0,13
PRODUCTVERSION 1,0,0,13
FILEVERSION 1,0,0,15
PRODUCTVERSION 1,0,0,15
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
Expand All @@ -10,14 +10,14 @@ BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "fearless\0"
VALUE "FileVersion", "1.0.0.13\0"
VALUE "FileVersion", "1.0.0.15\0"
VALUE "FileDescription", "EEex loader\0"
VALUE "InternalName", "EEex.exe\0"
VALUE "LegalCopyright", "fearless\0"
VALUE "LegalTrademarks", "fearless\0"
VALUE "OriginalFilename", "EEex.exe\0"
VALUE "ProductName", "EEex.exe\0"
VALUE "ProductVersion", "1.0.0.13\0"
VALUE "ProductVersion", "1.0.0.15\0"
END
END
BLOCK "VarFileInfo"
Expand Down
40 changes: 37 additions & 3 deletions EEexDLL/EEex.asm
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ EEexInitDll PROC USES EBX
Invoke LogClose
.ENDIF
ENDIF
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
.ELSE ; IMAGE_DOS_SIGNATURE Failed
Expand All @@ -159,6 +160,7 @@ EEexInitDll PROC USES EBX
Invoke LogClose
.ENDIF
ENDIF
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
.ELSE ; GetModuleInformation Failed
Expand All @@ -169,6 +171,7 @@ EEexInitDll PROC USES EBX
Invoke LogClose
.ENDIF
ENDIF
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
;--------------------------------------------------------------------------
Expand Down Expand Up @@ -233,8 +236,9 @@ EEexInitDll PROC USES EBX
Invoke MessageBox, 0, Addr szErrorSearchFunctions, Addr AppName, MB_OK
.ENDIF
;--------------------------------------------------------------
; EEex.DLL EXITS HERE - Execution continues with EE game
; EEex.DLL EXITS HERE
;--------------------------------------------------------------
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
.ELSE ; Functions verified, no need for search
Expand Down Expand Up @@ -289,8 +293,9 @@ EEexInitDll PROC USES EBX
Invoke MessageBox, 0, Addr szErrorPatchFailure, Addr AppName, MB_OK
.ENDIF
;------------------------------------------------------------------
; EEex.DLL EXITS HERE - Execution continues with EE game
; EEex.DLL EXITS HERE
;------------------------------------------------------------------
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
.ELSE
Expand All @@ -304,8 +309,9 @@ EEexInitDll PROC USES EBX
Invoke MessageBox, 0, Addr szErrorPatchLocation, Addr AppName, MB_OK
.ENDIF
;----------------------------------------------------------------------
; EEex.DLL EXITS HERE - Execution continues with EE game
; EEex.DLL EXITS HERE
;----------------------------------------------------------------------
Invoke TerminateProcess, hEEGameProcess, NULL
ret ; Exit EEexInitDll
.ENDIF
;--------------------------------------------------------------------------
Expand Down Expand Up @@ -1259,6 +1265,7 @@ EEEX_ALIGN
;------------------------------------------------------------------------------
EEexPatchLocation PROC USES EBX
LOCAL pPatternEntry:DWORD
LOCAL nPattern:DWORD
IFDEF DEBUG32
PrintText 'EEexPatchLocation'
Expand All @@ -1281,6 +1288,33 @@ EEexPatchLocation PROC USES EBX
.ELSE
mov eax, 0
.ENDIF
.IF eax == 0 ; do a full search of pattern database, in case PatchLocation is not at position 0
mov ebx, PatternsDatabase
mov pPatternEntry, ebx
mov nPattern, 0
mov eax, 0
.WHILE eax < TotalPatterns
mov ebx, pPatternEntry
mov eax, [ebx].PATTERN.PatName
.IF eax != 0
mov ebx, eax
mov eax, [ebx]
mov ebx, [ebx+4]
.IF eax == 'ctaP' && ebx == 'coLh' ; Patc hLoc
mov ebx, pPatternEntry
mov eax, [ebx].PATTERN.PatAddress
ret ; return with patch address location
.ENDIF
.ENDIF
add pPatternEntry, SIZEOF PATTERN
inc nPattern
mov eax, nPattern
.ENDW
mov eax, 0 ; didnt find patch location at all in whole pattern database
.ENDIF
ret
EEexPatchLocation ENDP

Expand Down
Binary file modified EEexDLL/EEex.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions EEexDLL/EEex.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ includelib kernel32.lib
includelib psapi.lib
includelib version.lib

IFDEF EEEX_LUALIB
;IFDEF EEEX_LUALIB
include lua52.inc
includelib lua523.lib ; nil value for lua_setglobal
includelib msvcrt12.lib
ENDIF
;ENDIF

;------------------------------------------------------------------------------
; EEex.dll Prototypes
Expand Down

0 comments on commit 395958c

Please sign in to comment.