I'm extremely new to asm, I've been following some guides and codes from other people to do some things my own, but it's just very hard for me.
So I found this code:
_asm
{
push Fn3Var2;
mov ecx, 0x7AAD828;
mov esi, 0x00402F50;
call esi;
push eax;
mov eax, dword ptr ds : [0x7C13C7C];
lea eax, dword ptr ds : [eax + eax * 0x4];
lea edx, dword ptr ds : [eax + eax * 0x4];
lea eax, dword ptr ds : [edx * 0x4 + 0x7BE1238];
push eax;
mov esi, 0x00851348;
call esi;
mov eax, dword ptr ds : [0x7C13C7C];
add esp, 0x8;
mov dword ptr ds : [eax * 0x4 + 0x7BE239C], 0x08; // ebx
mov dword ptr ds : [eax * 0x4 + 0x7C114A0], 0x1; // ebx
inc eax;
mov dword ptr ds : [0x7C13C7C], eax;
mov eax, 0x00594CFD;
jmp eax;
}
So the Fn3Var2 is a DWORD. This code is working fine for me on what it is supposed to do (add text to an item on a game). But I wanted to add another line of text, and this is what the person that shared the code said:
"Just register another variable (DWORD Fn3Var3), set it in each item case then mov it to stack in asm code."
So obviously creating a new DWORD Fn3Var3 I understand, but then I have no idea how to add it or mov it to stack. Could someone that actually understand this better than me explain it to me please? :)
Edit: That "set it in each item case" was meant for adding that Fn3Var3 on some if conditions, don't worry about that.
Edit2: Sorry I forgot to add this, maybe it's important. This code:
_asm
{
mov ax, word ptr ds : [edi];
mov Fn3Var1, eax;
}
Runs before the other one.
Edit3: So I searched for those 3 locations on IDA (0x00402F50, 0x00851348, 0x00594CFD) and this is what it looks like: https://i.stack.imgur.com/2LwEz.jpg Not sure if it helps or not, but any ways :)
Last Edit: I managed to do it by looking at someone else's similar code, you can close this question. :)