summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-06-14 20:21:15 +0200
committerkdx <kikoodx@paranoici.org>2023-06-14 20:21:15 +0200
commit69aa1b02d3064813da5d19b13ffef231501d58ca (patch)
tree97688ff52373b8eade5323718c28513833bcaea6 /samples
parent626accfd7fefdf0b8f79a2c95a881620a9b6bd0f (diff)
downloadgolem-69aa1b02d3064813da5d19b13ffef231501d58ca.tar.gz
cracked defines
Diffstat (limited to 'samples')
-rw-r--r--samples/define.golem8
-rw-r--r--samples/malloc.golem6
2 files changed, 12 insertions, 2 deletions
diff --git a/samples/define.golem b/samples/define.golem
new file mode 100644
index 0000000..778a9c7
--- /dev/null
+++ b/samples/define.golem
@@ -0,0 +1,8 @@
+define A = 5;
+define A_SQUARED = A * A;
+define B = A - A_SQUARED + (A_SQUARED / A * 2);
+global array[B];
+
+main() {
+ dbg B;
+}
diff --git a/samples/malloc.golem b/samples/malloc.golem
index 762f78f..27502d4 100644
--- a/samples/malloc.golem
+++ b/samples/malloc.golem
@@ -1,6 +1,7 @@
main() {
local s;
s = strdup("coucou le monde");
+ dbg s;
puts(s);
stoupper(s);
puts(s);
@@ -37,9 +38,9 @@ strcpy(dst, src) {
i = 0;
loop {
[dst + i] = [src + i];
- i = i + 1;
if ([src + i] == 0)
return dst;
+ i = i + 1;
}
}
@@ -51,7 +52,8 @@ stoupper(s) {
}
}
-global heap[4096] = 0x69;
+define HEAP_SIZE = 4096;
+global heap[HEAP_SIZE] = 0x69;
global heap_size = 0;
malloc(n) {
local p;