BOOL WINAPI ReadProcessMemory(
_In_ HANDLE hProcess,
_In_ LPCVOID lpBaseAddress,
_Out_ LPVOID lpBuffer,
_In_ SIZE_T nSize,
_Out_ SIZE_T *lpNumberOfBytesRead
);
SIZE_T bytesRead;
ReadProcessMemory(hProcess, 0, Buf, (unsigned long)20, &bytesRead);
bool checkString(char **text, char *separator, int num_str) {
char *str, *cur, *word;
int len;
for (int i = 0; i < num_str; i++, text++) {
str = cur = *text;
while (*cur) {
if (strchr(separator, *cur)) {
len = cur-str;
word = malloc(len+1);
strncpy(word, str, len);
puts(word);
free(word);
str = cur;
}
cur++;
}
puts(str);
}
return true;
}
myQuery->SQL->Text = (AnsiString)"SELECT f_department.CODE, f_department.NAME FROM f_department LEFT JOIN l_modules_22_department ON l_modules_22_department.CODE_2 = f_department.CODE WHERE l_modules_22_department.CODE_1 = '"
+ depBlock[i].moduleCode + (AnsiString)"'";
char *escapeString(char *str) {
char *result, *temp;
int i;
temp = malloc(strlen(str)*2+1);
i = 0;
while (*str) {
switch(*str) {
case '\n':
temp[i++] = '\\';
temp[i++] = 'n';
break;
case '\r':
temp[i++] = '\\';
temp[i++] = 'r';
break;
case ':':
case '$':
case '\\':
temp[i++] = '\\';
default:
temp[i++] = *str;
}
str++;
}
temp[i] = 0;
result = malloc(i+1);
strcpy(result, temp);
free(temp);
return result;
}