Skip to content

Commit 9d2e368

Browse files
committed
Modified patch to not use infinity but a high value instead, as using Infinity would cause a Floating point exception i.e. in standalone embedded ActiveX executables #3
1 parent cbd8d1c commit 9d2e368

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

flashpatch.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ static BOOL PatchFile(char *pszFile)
141141
BOOL bRet=FALSE;
142142
BYTE Timestamp[] = {0x00, 0x00, 0x40, 0x46, 0x3E, 0x6F, 0x77, 0x42};
143143
BYTE Infinity[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x7F};
144+
BYTE TSFarAway[] = {0xC0, 0xFF, 0x8F, 0x1E, 0xC4, 0xBC, 0xD6, 0x42};
144145
PBYTE lpSig, lpMem;
145146

146147
printf ("Checking %s....", pszFile);
@@ -166,13 +167,24 @@ static BOOL PatchFile(char *pszFile)
166167
}
167168
else
168169
{
169-
if (Match(lpMem, dwSize, Infinity, sizeof(Infinity), 1))
170+
if (lpSig = Match(lpMem, dwSize, Infinity, sizeof(Infinity), 1))
170171
{
171-
printf("May already be patched\n");
172+
char szMsg[32];
173+
174+
sprintf(szMsg, "Found old inifinty @%X\n", lpSig-lpMem);
175+
print_ok(szMsg);
176+
bRet = TRUE;
172177
}
173178
else
174179
{
175-
printf("Signature not found\n");
180+
if (Match(lpMem, dwSize, TSFarAway, sizeof(TSFarAway), 1))
181+
{
182+
printf("May already be patched\n");
183+
}
184+
else
185+
{
186+
printf("Signature not found\n");
187+
}
176188
}
177189
}
178190
UnmapViewOfFile (lpMem);
@@ -210,7 +222,7 @@ static BOOL PatchFile(char *pszFile)
210222
{
211223
DWORD dwWritten;
212224

213-
if ((bRet = WriteFile(hFile, Infinity, sizeof(Infinity), &dwWritten, NULL)))
225+
if ((bRet = WriteFile(hFile, TSFarAway, sizeof(TSFarAway), &dwWritten, NULL)))
214226
{
215227
print_ok("OK\n");
216228
}
@@ -275,7 +287,7 @@ int main(int argc, char **argv)
275287
{
276288
int ret;
277289

278-
printf ("Adobe Flash Timebomb patcher V1.01, [email protected] 02/2021\n\n");
290+
printf ("Adobe Flash Timebomb patcher V1.02, [email protected] 02/2021\n\n");
279291

280292
EnablePrivilege (GetCurrentProcess(), SE_BACKUP_NAME);
281293
EnablePrivilege (GetCurrentProcess(), SE_RESTORE_NAME);

0 commit comments

Comments
 (0)