# Can I move a pointer in IDA pseudocode generator?

**URL:** <https://community.hex-rays.com/t/can-i-move-a-pointer-in-ida-pseudocode-generator/436>\
**Category:** Support\
**Created:** [August 11, 2025, 8:33am UTC](https://community.hex-rays.com/t/can-i-move-a-pointer-in-ida-pseudocode-generator/436 "2025-08-11T08:33:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xroft666](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@Xroft666](https://community.hex-rays.com/u/Xroft666)\
**Post date:** [August 11, 2025, 8:33am UTC](https://community.hex-rays.com/t/can-i-move-a-pointer-in-ida-pseudocode-generator/436/1 "2025-08-11T08:33:25Z")

</div>

I have the following code generated from 32bit c++ dll subroutine

Submesh = GetSubmesh(&geometry\_service, &vertices, &indices, mesh\_id, lod\_idx);  
if ( Submesh-\>VertexCount \> 0 )  
{  
v5 = (float \*)&transformed\_v\_buffer;  
VertexCount = Submesh-\>VertexCount;  
p\_z = &vertices-\>pos.z;  
do  
{  
pos\_x = \*(p\_z - 2); // pos.x  
pos\_y = \*(p\_z - 1); // pos.y  
pos\_z = \*p\_z; // pos.z  
…

The issue is that the asm loads a value from a pointer with an offset +8, so in my case the pointer points to pos.z, instead of the beginning of the structrue. I cant label v6 to Vertex\_Data\* in such case, since its going to have an offset. And I cant seem to be able to offset the pointer so that it would land to the beginning of the array.

In asm i have the following:

.text:004187B6 lea edi, [ecx+8]. //v6  
.text:004187B9 fld dword ptr [edi-8]. //pos\_x  
.text:004187BC fld dword ptr [edi-4]. //pos\_y  
.text:004187BF fld dword ptr [edi]. //pos\_z

I’ve tried to use the Manual… option in the context menu in asm view, and change the code to

.text:004187B6 lea edi, [ecx].  
.text:004187B9 fld dword ptr [edi].  
.text:004187BC fld dword ptr [edi+4].  
.text:004187BF fld dword ptr [edi+8].

But it doesnt seem to have any effect in the disassembly

---

<div class="post-metadata">

**Author:** ![igor](https://sea2.discourse-cdn.com/flex002/user_avatar/community.hex-rays.com/igor/32/35_2.png) [@igor](https://community.hex-rays.com/u/igor)\
**Post date:** [August 11, 2025, 8:37am UTC](https://community.hex-rays.com/t/can-i-move-a-pointer-in-ida-pseudocode-generator/436/2 "2025-08-11T08:37:26Z")

</div>

you can use shifted pointers. Right-click p\_z, select “Convert to struct\*”, then pick `Vertex_Data` and fill in offset of z (8?) in the dialog.

---

<div class="post-metadata">

**Author:** ![Xroft666](https://avatars.discourse-cdn.com/v4/letter/x/f04885/32.png) [@Xroft666](https://community.hex-rays.com/u/Xroft666)\
**Post date:** [August 11, 2025, 11:42am UTC](https://community.hex-rays.com/t/can-i-move-a-pointer-in-ida-pseudocode-generator/436/3 "2025-08-11T11:42:37Z")

</div>

that worked nicely, thanks @igor!
