Похожие чаты

Hi guys i saw this code in github ```//removed for brevity void executionloop(void){

int ip;
for(;(ip = ((int*)mem)[0]); ((int*)mem)[0]+=4){
int op = ((int*)mem)[ip];
int a = ((int*)mem)[ip+1];
int b = ((int*)mem)[ip+2];
int c = ((int*)mem)[ip+3];
getp(op, a, b, c);
doop(op);
}
}
//removed for brevity```I have 2 question:
1-this loop in which condition will stop?
2-ptr[0]+=4 means ptr[0]=ptr[0]+4 ?
(i mean it adds 4 byte where ptr points to)
sorry for my bad english

5 ответов

11 просмотров

Strange it doesn't format to monospace, use hastebin.com or del.dog instead. It's too unappealing to look at it without proper formatting

Naweed- Автор вопроса

https://hastebin.com/oxobocekum.cpp

ip = (((int*)mem)[0]) << this is the condition which will stop the loop. It's a hacky way to do it but (((int*)mem)[0]) value being 0 should stop it

No it doesn't mean it adds 4 bytes. It increments the value at ptr[0] by 4

Not sure why'd they add 4 to the first element, it looks like a bug, ah they're using it as a pointer to the mem array, whoa. That code can be simplified to a simple for loop with an iterator. Mo need to have the mem array store pointers to iterate over it o.O

Похожие вопросы

Обсуждают сегодня

Xem delist ho rha hai agr naa bhechu toh kya hoga after 1 july?
ABHI
25
Quick reminder regarding the first phase of the token merger⚠️ As we approach Phase 1 of the token merger, OCEAN and AGIX will migrate to FET starting July 1st! Here's a li...
Stip11
1
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
Hey, Oceaners 🌊 As we approach Phase 1 of the token merger, OCEAN and AGIX will migrate to FET starting July 1st! Here's a list of exchanges that have communicated their su...
KreigDK | Never DM first🌊
3
VIP 332 Quarterly XVS Buyback, Funds Allocation and New Tokenomics Summary This VIP outlines the protocol’s Quarterly Buyback and Funds Allocation strategy as per our Tokeno...
Venus Announcements
2
База данных не поможет. Шифрование не поможет. Какие там ещё варианты? Накидывайте.
КТ315
20
А табстоп это сообщение от окна или от элемента управления?
The Bird of Hermes
18
Did you guys see the latest tweet from TonGifts? 🚀
Mike
44
I love the passion, really do. I do think this is being blown way out of proportion. We are not deleting our Telegram or not allowing you to talk about anything you want, a...
Mike Herron
3
А как лучше конвертировать физический адрес в виртуальный при маппинге? В случае ядра у меня, например, direct mapping, первые 768МБ я как есть мапплю в higher half, а остальн...
Evg Resh
26
Карта сайта