i have snippet code that i want to convert to python to understand the types that ghidra use such *(byte *)
and *(code *)
and *(uchar *)
etc..
the first code:
void one(int param_1,int param_2) {
int local_8;
local_8 = 0;
while (local_8 < param_2) {
*(byte *)(param_1 + local_8) = *(byte *)(param_1 + local_8) ^ 0x50;
local_8 = local_8 + 1;
}
return;
}
local_14 = 0;
byte local_12c [256];
local_24 = strlen(param_4);
local_10 = 0;
while (local_14 < 0x100) {
local_12c[local_14] = (byte)local_14;
local_14 = local_14 + 1;
}
local_18 = 0;
while (local_18 < 0x100) {
iVar1 = (int)param_4[local_18 % (int)local_24] + (uint)local_12c[local_18] + local_10;
uVar2 = (uint)(iVar1 >> 0x1f) >> 0x18;
local_10 = (iVar1 + uVar2 & 0xff) - uVar2;
swap(local_12c + local_18,local_12c + local_10);
local_18 = local_18 + 1;
}
writing a python code for this code it will help me a lot to understand the logic that ghidra use with these kind of instructions such as swap(local_12c + local_18,local_12c + local_10);
is it a number value ? how to swap a numbers without variables