memory address gets cut off after 8 digits
memory address gets cuts off after 8 digits help
DWORD* memoryAddress = (DWORD*)0x155221000;
turns from 0x155221000 into 0x55221000 after conversion.
c++
add a comment |
memory address gets cuts off after 8 digits help
DWORD* memoryAddress = (DWORD*)0x155221000;
turns from 0x155221000 into 0x55221000 after conversion.
c++
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
2
DWORD
is 4 bytes so it should be able to store... a maximum of0xFFFFFFFF
. Exactly what you're seeing.
– wizzwizz4
Nov 23 '18 at 20:12
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
Is this on Windows? If so, the datatype you are looking for isDWORD_PTR
, or maybeuintptr_t
.
– Paul Sanders
Nov 23 '18 at 20:47
add a comment |
memory address gets cuts off after 8 digits help
DWORD* memoryAddress = (DWORD*)0x155221000;
turns from 0x155221000 into 0x55221000 after conversion.
c++
memory address gets cuts off after 8 digits help
DWORD* memoryAddress = (DWORD*)0x155221000;
turns from 0x155221000 into 0x55221000 after conversion.
c++
c++
edited Nov 23 '18 at 20:26
4234234234324
asked Nov 23 '18 at 20:08
42342342343244234234234324
63
63
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
2
DWORD
is 4 bytes so it should be able to store... a maximum of0xFFFFFFFF
. Exactly what you're seeing.
– wizzwizz4
Nov 23 '18 at 20:12
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
Is this on Windows? If so, the datatype you are looking for isDWORD_PTR
, or maybeuintptr_t
.
– Paul Sanders
Nov 23 '18 at 20:47
add a comment |
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
2
DWORD
is 4 bytes so it should be able to store... a maximum of0xFFFFFFFF
. Exactly what you're seeing.
– wizzwizz4
Nov 23 '18 at 20:12
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
Is this on Windows? If so, the datatype you are looking for isDWORD_PTR
, or maybeuintptr_t
.
– Paul Sanders
Nov 23 '18 at 20:47
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
2
2
DWORD
is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF
. Exactly what you're seeing.– wizzwizz4
Nov 23 '18 at 20:12
DWORD
is 4 bytes so it should be able to store... a maximum of 0xFFFFFFFF
. Exactly what you're seeing.– wizzwizz4
Nov 23 '18 at 20:12
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
Is this on Windows? If so, the datatype you are looking for is
DWORD_PTR
, or maybe uintptr_t
.– Paul Sanders
Nov 23 '18 at 20:47
Is this on Windows? If so, the datatype you are looking for is
DWORD_PTR
, or maybe uintptr_t
.– Paul Sanders
Nov 23 '18 at 20:47
add a comment |
1 Answer
1
active
oldest
votes
On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000;
would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.
1428295680
is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).
As the comments from different people said, DWORD
is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452426%2fmemory-address-gets-cut-off-after-8-digits%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000;
would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.
1428295680
is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).
As the comments from different people said, DWORD
is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.
add a comment |
On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000;
would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.
1428295680
is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).
As the comments from different people said, DWORD
is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.
add a comment |
On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000;
would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.
1428295680
is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).
As the comments from different people said, DWORD
is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.
On a 32bits system, an address is 4 bytes long. So DWORD* memoryAddress = (DWORD*)0x155221000;
would be truncated by definition (also bad to use C-style casts). The compiler should give you a truncation warning by the way.
1428295680
is the base-10 representation of the same value (addresses are usually represented in hexadecimal, still the same value).
As the comments from different people said, DWORD
is 4 bytes (just a coincidence that addresses are also 4 bytes), it would also truncate your number for the same reason.
edited Nov 23 '18 at 23:09
answered Nov 23 '18 at 20:11
Matthieu BrucherMatthieu Brucher
15.6k32140
15.6k32140
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452426%2fmemory-address-gets-cut-off-after-8-digits%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
How do you know what's stored in your pointer value?
– Andrew Henle
Nov 23 '18 at 20:10
2
DWORD
is 4 bytes so it should be able to store... a maximum of0xFFFFFFFF
. Exactly what you're seeing.– wizzwizz4
Nov 23 '18 at 20:12
you are supposed to store memory addresses as pointers and i forgot it was in hex and so it was a 64 bit hex memadress i was trying to access using so small things like DWORD when i needed to use DWORD64* for the 64 bit programs memory addresses thanks all answers.
– 4234234234324
Nov 23 '18 at 20:23
Is this on Windows? If so, the datatype you are looking for is
DWORD_PTR
, or maybeuintptr_t
.– Paul Sanders
Nov 23 '18 at 20:47