![]() |
Kleines Übersetzungsproblem C-->Pascal
Hi,
Code:
Ich bekomm das auf Teufel komm raus nicht übersetzt :oops:
char buff1[5];
char buff2[9]; int *res; res=buff1+12; *res=*res+10; also normal müsste das doch so Aussehn (das oben is ne procedure):
Delphi-Quellcode:
aber das haut natürlich nicht hin....
procedure Egal;
var Buff1: Array[0..4] of Char; Buff2: Array[0..8] of Char; res: PInteger; begin res := Buff1[0] + 12; @res := @res+10; end; Gruß Neutral General |
Re: Kleines Übersetzungsproblem C-->Pascal
Delphi-Quellcode:
res^ := res^ + 10;
|
Re: Kleines Übersetzungsproblem C-->Pascal
Zitat:
int* i; //Pointer auf ein Integer "*i" = Objekt auf das der Pointer zeigt. Jetzt kann man mit i arbeiten, als ob es eine normale Integer-Variable wäre. |
Re: Kleines Übersetzungsproblem C-->Pascal
Habe ich etwas falsch übersetzt?
|
Re: Kleines Übersetzungsproblem C-->Pascal
Delphi-Quellcode:
So sähe die komplette Pascal-Übersetzung aus.
procedure Egal;
var Buff1: Array[0..4] of Char; Buff2: Array[0..8] of Char; res: PInteger; begin res := PInteger(@Buff1[12]); res^ := res^ + 10; end; Allerdings muss das Ganze nicht klappen (sofern es überhaupt einen Sinn hat): denn wo @Buff1[12] landet wenn das Array selbst nur 5 Zeichen lang ist, ist reiner Zufall. @sniper_w: nein |
Re: Kleines Übersetzungsproblem C-->Pascal
Zitat:
Danke für die Übersetzung :) EDIT: Zitat:
Neutral General |
Re: Kleines Übersetzungsproblem C-->Pascal
Delphi-Quellcode:
PInteger(Integer(@buf1)+12)
|
Re: Kleines Übersetzungsproblem C-->Pascal
Zufall ist es nicht wo man landet, aber man landet im Gelaende, sprich im Stack. Es duerfte nicht Buff2 sein, denn der steht auf dem Stack unterhalb von Buff1.
|
Re: Kleines Übersetzungsproblem C-->Pascal
Zitat:
Versuche grad ![]() INFO: Das ist keine(!) Hackerseite und weder der Besitzer dieser Seite noch ich haben irgendwas "böses" vor... Zitat:
Neutral General |
Re: Kleines Übersetzungsproblem C-->Pascal
Das ist die aktuelle "Sicherheitslogik". Schon das Erklaeren worum es geht ist verdaechtig.
Sei vorsichtig. Kurnaz hat diese Logik nach Guantanamo gebracht. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:11 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz