Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ca0s

Pages: [1] 2 3 ... 20
1
C - C++ / Re: pointers and 2d array
« on: February 08, 2016, 12:00:02 pm »
If you cannot know the size at compile time, you will have to pass it to the function and then use pointer arithmetic. Or use an array of pointers to 1-D arrays, which you will have to allocate.

Code: [Select]
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>

void func_static(uint64_t size_1, uint64_t size_2, uint64_t *array)
{
uint64_t x, y;
for(x = 0; x < size_1; x++) {
for(y = 0; y < size_2; y++) {
printf("%d\n", array[x * size_2 + y]);
}
}
}

void func_dynamic(uint64_t size_1, uint64_t size_2, uint64_t **array)
{
uint64_t x, y;
for(x = 0; x < size_1; x++) {
for(y = 0; y < size_2; y++) {
printf("%d\n", array[x][y]);
}
}
}

int main()
{
uint64_t array_static[2][4] = { { 1, 2, 3, 4 }, {5, 6, 7, 8} };

uint64_t **array_dynamic;
uint64_t size_1 = 2;
uint64_t size_2 = 4;

uint64_t x, y;

func_static(sizeof(array_static)/sizeof(array_static[0]), sizeof(array_static[0])/sizeof(array_static[0][0]), (uint64_t *)&array_static);

array_dynamic = malloc(size_1 * sizeof(uint64_t));
for(x = 0; x < size_1; x++) {
array_dynamic[x] = malloc(size_2 * sizeof(uint64_t));
}
for(x = 0; x < size_1; x++) {
for(y = 0; y < size_2; y++) {
array_dynamic[x][y] = array_static[x][y];
}
}
func_dynamic(size_1, size_2, array_dynamic);

return 0;
}

2
C - C++ / Re: pointers and 2d array
« on: February 07, 2016, 10:27:49 pm »
Code: [Select]
http://c-faq.com/aryptr/ptrary2.html

So:

Code: [Select]
int (*p)[5]

is declaring a pointer to an array, and, as a pointer in 32bit wold, its size is 4 bytes. The thing that probably confused you is:

Code: [Select]
int *p[5];

which is an array of pointers, whose size would be 40 bytes.

It is more clearly explained at:
Code: [Select]
http://c-faq.com/aryptr/ptrtoarray.html

3
Maybe late , but:

1) I was finishing my degree, last semester. Professor tells us that enterprise X is looking for interns to dfo some pentesting related stuff. Apply and get in. Work for 6 months. Then go for summer vacations, and get a job in another place. This time I was looking for it, having worked as an intern in previous one definetely helped.

2) Any university degree to begin with. Experience with computer security stuff. Technical interview. Nothing about certs.

3) Average+. Pretty nice being my first job.

4) Totally. I have the chance to pentest several types of applications. From the typical webapp to a totally custom and critical internal app. Damn interesting stuff.

5) "Junior IT Security Analyst" or something like that.  Penetration testing, risk analysis.

6) Company.

4
C - C++ / Re: [C] Simple Crypter + Stub
« on: May 23, 2015, 05:39:29 pm »
I doubt that OP will ever read it, but still: THANKS for sharing this! I learned quite a bit about the stub crypting concept
no

Well, I'm glad you actually found that piece of crap that was my "crypter" useful . It was just a damn simple and naive example implementation.

I hope you don't feel copy&pasted or anything :P and that it was okay to re-use your name
Cheers buddy

Nah, no problem.

For the next version, if you are going to continue developing it, you could try to avoid writing the original file into disk and just use the same process as the stub, for example.

5
News and Announcements / Re: HAPPY NEW YEAR!
« on: January 01, 2015, 02:11:09 pm »
Happy new year. And happy hangover.

6
Found it on the Webs / Re: Acne problems
« on: September 03, 2014, 11:30:59 am »
Treatment with Roacutan worked for me. I ate healthy, made lots of exercise, and I still had horrible acne, so its side effects were worth it.

7
C - C++ / Re: [C++] question about -> operator
« on: March 27, 2014, 06:36:50 pm »
Go
Code: [Select]
http://gcc.godbolt.org/
Paste
Code: [Select]
#include <stdio.h>

struct herp {
    int a;
    int b;
  } gderp;

int main()
{
  struct herp derp;
 
  struct herp *pderp = &derp;
 
  gderp.a = 1;
  gderp.b = 2;
 
  derp.a = 5;
  derp.b = 6;
 
  pderp->a = 6;
  pderp->b = 5;
 
  return 0;
}

Clear out the "Compiler options" field.
And check the output, each line of C code will be colored with the same color than its ASM output.

8
News and Announcements / Re: Early beta release: Project Alpha Webpage
« on: December 26, 2013, 12:36:53 am »
It wouldn't be secure because you would have to send the secret to the client, thus making it possible to sniff. However I guess you COULD implement some sort of asymmetric encryption request to get the secret, by generating a new key on the client side every time and sending the public key. (Actually not a bad idea).

Secret was chosen by the user when registering, and never sent to the server (password was hashed then).But this is off-topic here.

9
News and Announcements / Re: Early beta release: Project Alpha Webpage
« on: December 25, 2013, 05:55:10 pm »
I once made an implementation in which every user had to login with username + password + secret. Then, the hash was calculated with a SHA256-HMAC(password, secret), and username + hash were sent to the server. I was never sure about if that was secure or not, so I finally removed it.

Btw, looks amazing :)

10
General discussion / Re: Post your deskTOP
« on: December 09, 2013, 04:49:15 pm »
Holy shit. That's some serious windows tunning.

11
Hardware / Re: Which laptop would you choose?
« on: December 09, 2013, 12:48:14 am »
I've had several computers with nvidia cards and never had a problem with them drivers. Both official and open source. And I don't think I will have any trouble with that wireless chipset. I hope I won't, some years ago I had a hard time finding drivers for some rare card I had.

Quote
Especially with that budget there are some more options.
Such as? If it is some kind of international seller or I can find it here, I'm open to all suggestions.

And thanks for your opinions, guys.

Quote
Personally I would rather have some proper intel graphics (top of the line) than some hybrid crap.
They still dont perform well on linux, it becomes acceptable but still its not great and a waste of money from that perspective.
Well, they have improved over the years. I tried playing Team Fortress 2 from Steam in Arch some months ago and it worked fine (until the whole laptop shut down, my video card is kinda burnt)

12
Hardware / Re: Which laptop would you choose?
« on: December 08, 2013, 12:08:35 pm »
95% Arch Linux, 5% Windows. Dual boot.

Quote
Maybe I'm unlucky but I've had two of the same Asus laptop. The first developed huge dead pixel patches within weeks. Got it replaced with the same one and that developed dead pixel patches after a year. Plus random keyboard issues.
Wow, that's bad luck. I've had 3 Asus computers and they have worked pretty fine.

Quote
My next laptop's gonna be a lenovo. But I really just want the money to build my own rig.
I considered them, but they are not sold in many shops in my country.

Edit: this is what I'm thinking about right now:
Code: [Select]
http://www.pccomponentes.com/asus_n750jv_i7_4700_8gb_750gb_gt750m_17_3_.html
i7 4700MQ
8GB RAM
750GB HD
Atheros chipset
Backlight keyboard
3.3Kg
4-5h battery
1100€
+ 250 GB SSD: 150€
+ 8GB RAM: 130€
Total: 1380€

13
Hardware / Re: Which laptop would you choose?
« on: December 08, 2013, 01:08:02 am »
I don't have a desktop computer, I do all my stuff in my lap. That's why I'm buying a 17' one.
Quote
Because I would never buy another Asus for example.
Why? I've had Asus before and I never had any issue with them. They've worked better than any other brand I've tried.

I have read that MSIs are good, but some of them (like the stealth) are not very tunneable. That's why I started looking at those Mountains: you can change almost every piece just removing the back of the laptop.

14
Hardware / Re: Which laptop would you choose?
« on: December 07, 2013, 10:17:06 pm »
Those batteries should stand for ~3-4h, according to what their manufacturers say. I usually have it connected to AC, though.

MSIs come with a Killer (which I had never listened about before). I don't know about the others. I have an external card for inyection, if that was what you were thinking about.

15
Hardware / Re: Which laptop would you choose?
« on: December 07, 2013, 09:31:31 pm »
Coding, reversing, the kind of stuff is done by the folks in this forum, you know.

I have to virtualize various machines for university tasks (network emulation, distributed systems), and my current laptop (~4 years old) suffers a bit.

Sometimes playing, but not very often (my graphics card has been dead for a year, so I have not played any game in the last year).

I liked the idea of having a small SSD for windows & linux, and I will probably end up buying a SSD one. But I wanted to know if the OS realy runs that faster.

And if I buy a Mountain, I will sure pay the extra 8GB of RAM.

Pages: [1] 2 3 ... 20