Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Windows Tipps & SecurityGrafikkarte vor Überhitzung schützen: So geht’s(25.09.2026 um 08:00 Uhr)
••••••••••
Intelligence View
⚡ tsecurity.de Intelligence

How a simple pointer exercise had me pulling my hair out.

I was tasked to write out (by hand) the outputs for a given pointer exercise. It seemed simple enough, but when I got to a certain stage, I found myself lost. And the harder I thought, the deeper I went down a rabbit hole of confusion.…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I was tasked to write out (by hand) the outputs for a given pointer exercise. It seemed simple enough, but when I got to a certain stage, I found myself lost. And the harder I thought, the deeper I went down a rabbit hole of confusion. Asking for AI did not help.

I will give the example that stumped me, some of the mistakes I made, why they were wrong and the principles that I learned from this experience.

Spoiler, in the end I went back to the introduction to pointers in my course material, and thinking in this simplistic way decluttered my brain and the answer became clear.



Here is the code;



`

int f(int** r, int** s) {

int temp = r;

int temp2 = **s;

int *z = *r;

*r = *s;

*s = z;

printf("
r = %d\n", r);

printf("
s = %d\n", **s);

*z += 3;

**s -= 8;

**r -= 19;

return temp + temp2;

}



int main(void) {

int a = 80;

int b = 12;

int *p = &a;

int *q = &b;

int x = f(&p, &q);

printf("x = %d\n", x);

printf("*p = %d\n", *p);

printf("*q = %d\n", *q);

printf("a = %d\n", a);

printf("b = %d\n", b);

return EXIT_SUCCESS;

}

`



This code will output the following.

**r = 12

**s = 80

x = 92

*p = -7

*q = 75

a = 75

b = -7



These are the mistakes I made;

I returned an int value of 64 (not 92) back to main from function f. In lines 5 and 6, the pointers are dereferenced to the int values of 80 and 12 respectively. But I mistakenly believed that the arithmetic on **r and **s affected the final value of temp and temp2 not realizing that those initializations in lines 5 and 6 are locked into the memory addresses of temp and temp2 and to manipulate those values I would need to explicitly perform arithmetic on temp and temp2. e.g. temp += 3.



Again, I changed the wrong addresses. Instead of changing what *r and *s points to within the function f stack, I changed what *p and *q point to in the main stack.



Finally, I forgot that *z was a pointer to an int. So, I was thinking that I had to perform arithmetic on the address at *p. So, I believed that *z += 3 meant *z = &p + 3. My thinking was that if I was supposed to perform arithmetic on int a, then the expression at line 7 would be *z = **r. This one got me so confused and going around in circles.



My take-aways;

Go back to basics.

Write out every step, even if it seems straight forward or insignificant.

Remember what the type is

Visualize the memory addresses

1. Sofort-Triage & Abwehrmaßnahmen

SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - How a simple pointer exercise had me pulling my hair out.
id: f6249d0d-22e2-4152-9704-61db4c4bb016
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-27
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-27"
        description = "YARA Signature for "
    strings:
        $str = "How a simple pointer exercise " ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("How a simple pointer exercise had me pul")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*How a simple pointer exercise had me pul*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "How a simple pointer exercise had me pul"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc

2. Cyber Threat Intelligence & Forensik

🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Analyse für identifizierte Bedrohung auf Basis von Live-CTI (ENISA EUVD): CVSS 0.0 · EPSS 0.0% · CISA KEV: nein. Handlungsableitung aus den verlinkten Hersteller-Quellen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How a simple pointer exercise had me pulling my hair out.

Thematisch verwandte Begriffe: simple, pointer, exercise, pulling · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-100620 | Capgo CLI (npm package @capgo/cli) through 7.98.2 is affected by an ove…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag