Started work on updated crypto
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@529 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
8afd839f90
commit
488f1f8fb1
|
@ -506,8 +506,6 @@ BOOL VBA::InitInstance()
|
||||||
|
|
||||||
if (check != 0)
|
if (check != 0)
|
||||||
{
|
{
|
||||||
MessageBox(NULL, "Go to hell, dont pass GO. Don't collect $200.",
|
|
||||||
szEXEFileName, MB_ICONSTOP|MB_OK);
|
|
||||||
ExitProcess(0);
|
ExitProcess(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,20 @@ int ExecutableValid(const char *executable_filename)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
void unprotect_buf(char *buffer, size_t buffer_len)
|
||||||
|
{
|
||||||
|
char *end_p = buffer+buffer_len, previous = 0x11;
|
||||||
|
while (buffer < end_p)
|
||||||
|
{
|
||||||
|
char current = *buffer;
|
||||||
|
*buffer ^= previous;
|
||||||
|
previous = current;
|
||||||
|
*buffer -= 25;
|
||||||
|
*buffer ^= 0x87;
|
||||||
|
++buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static uint8_t *memmem(const uint8_t *haystack, size_t haystacklen, const uint8_t *needle, size_t needlelen)
|
static uint8_t *memmem(const uint8_t *haystack, size_t haystacklen, const uint8_t *needle, size_t needlelen)
|
||||||
{
|
{
|
||||||
if (needlelen)
|
if (needlelen)
|
||||||
|
|
|
@ -8,6 +8,7 @@ extern "C" {
|
||||||
//Returns 0 on success, 1 on failure, and <0 when an error occured
|
//Returns 0 on success, 1 on failure, and <0 when an error occured
|
||||||
//Note, can only be called once per execution
|
//Note, can only be called once per execution
|
||||||
int ExecutableValid(const char *executable_filename);
|
int ExecutableValid(const char *executable_filename);
|
||||||
|
void unprotect_buf(char *buffer, size_t buffer_len)
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue