This commit is contained in:
Karmaz95
2024-01-06 22:06:00 +01:00
parent 6073ce1ae6
commit dec6d69edc
12 changed files with 5553 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
#include<stdio.h>
int main(){
printf("main address : %p\n",&main);
printf("printf address : %p\n",&printf);
return 0;
}
+9
View File
@@ -0,0 +1,9 @@
#include <stdio.h>
#include <string.h>
int main() {
char buffer[10];
strcpy(buffer, "Hello, World!"); // Vulnerable operation
printf("You entered: %s\n", buffer);
return 0;
}
+20
View File
@@ -0,0 +1,20 @@
#import <Foundation/Foundation.h>
@interface Person : NSObject
@property NSString *name;
@end
@implementation Person
@end
int main(int argc, const char * argv[]) {
@autoreleasepool {
// Create a Person object
Person *person = [[Person alloc] init];
person.name = @"John Doe";
// The person object will be automatically managed by ARC
NSLog(@"Person's name: %@", person.name);
}
return 0;
}
+23
View File
@@ -0,0 +1,23 @@
#include <stdio.h>
#include <stdlib.h>
int main() {
// Allocate memory on the heap
char *heapMemory = (char *)malloc(100 * sizeof(char));
if (heapMemory == NULL) {
fprintf(stderr, "Memory allocation failed.\n");
return 1;
}
printf("Memory allocated. Press Enter to exit.\n");
// Wait for Enter key press
while (getchar() != '\n');
// Free allocated memory
free(heapMemory);
return 0;
}
+6
View File
@@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}