CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/external/source/byakugan/test/memtest.c
Views: 11780
1
#include <stdio.h>
2
#include <windows.h>
3
4
5
#define TESTSIZE 35
6
7
void main() {
8
void *foo[TESTSIZE];
9
int i;
10
11
Sleep(10000);
12
13
for(i=0;i<TESTSIZE;i++) {
14
foo[i] = malloc(0x100);
15
printf("Alloc'd %d: 0x%08x\n", i+1, foo[i]);
16
}
17
18
for(i=10; i<20; i++) {
19
free(foo[i]);
20
printf("Free'd %d: 0x%08x\n", i+1, foo[i]);
21
}
22
23
for(i=10;i<13;i++) {
24
foo[i] = malloc(0x200);
25
printf("Alloc'd %d: 0x%08x\n", i+1, foo[i]);
26
}
27
Sleep(10000);
28
__asm {
29
int 3
30
}
31
32
33
return;
34
}
35
36