 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Aug 11, 2008 1:59 pm Post subject: [C++] char array initialization problem |
|
|
Hey,
I'm trying to in this array:
| Code: | | char loginpacket_end[23] = { 0x00, 0x2B, 0x21, 0x5A, 0x22, 0x58, 0xF2, 0xE0, 0x0E, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x3C, 0xD4 , 0x00 , 0x00 , 0x00 , 0x00 , 0x02 , 0x00 , 0x00 }; |
Compiler says:
| Code: | c:\dokumente und einstellungen\reakw0n\eigene dateien\visual studio 2008\projects\rnd\rnd\main.cpp(102) : warning C4309: 'initialization': Shorted a constant value
c:\dokumente und einstellungen\reakw0n\eigene dateien\visual studio 2008\projects\rnd\rnd\main.cpp(102) : warning C4309: 'initialization': Shorted a constant value
c:\dokumente und einstellungen\reakw0n\eigene dateien\visual studio 2008\projects\rnd\rnd\main.cpp(102) : warning C4309: 'initialization': Shorted a constant value
c:\dokumente und einstellungen\reakw0n\eigene dateien\visual studio 2008\projects\rnd\rnd\main.cpp(102) : warning C4309: 'initialization': Shorted a constant value |
(translated)
And line 102 is for sure the array line, and also when I send the packet it's sending like nothing.
I asked Lurc about that and he threw this line in a project and it compiled fine. What's the problem there?
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Mon Aug 11, 2008 2:27 pm Post subject: |
|
|
| Code: | | char loginpacket_end[24] = "\x00\x2B\x21\x5A\x22\x58\xF2\xE0\x0E\xB4\x00\x00\x00\x00\x3C\xD4\x00\x00\x00\x00\x02\x00\x00"; |
_________________
|
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Aug 11, 2008 3:12 pm Post subject: |
|
|
Thanks!
But can you explain why my array doesn't work?
Edit: When I do printf with that it doesn't print anything...
|
|
| Back to top |
|
 |
Cx Master Cheater
Reputation: 0
Joined: 27 Jul 2007 Posts: 367
|
Posted: Mon Aug 11, 2008 3:32 pm Post subject: |
|
|
The first char null terminates it...
_________________
armed with this small butterfly net
i will face the world alone
& never be lonely. |
|
| Back to top |
|
 |
Reak I post too much
Reputation: 0
Joined: 15 May 2007 Posts: 3496
|
Posted: Mon Aug 11, 2008 4:16 pm Post subject: |
|
|
Ohwell yea Cx.
The problem was I used a STRING and merged all arrays witht he += operator, but it didn't terminate on 0x00, it just ignored it.
Now I'm using sprintf_s().
But when I send the packet, I need to get the length of the char-array. But since strlen() ignores 0x00, what should I use instead of it?
Edit: Okay got it :>
Thanks everyone.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|