i'm currently using the keystone engine under python to implement a reverse shell for windows and
i was curious if you can add comments into the assembler code itself.
Maybe this is a stupid question, but i didn't see any reference if this is possible or not.
What i know is possible (formatting sucks, but in the editor it was clean.):
CODE: str = (
"start: "
" int3; "
" mov ebp, esp; "
" add esp, 0xFFFFFDF0; "
" "
"find_kernel32: "
" xor ecx, ecx; "
" mov esi, fs:[ecx + {PEB_OFFSET}]; " # get the peb from the teb.
" mov esi, [esi + {PEB_LDR_DATA_OFFSET}]; " # get the ldr data structure from the peb.
" mov esi, [esi + {INIT_ORDER_MODULE_LIST_OFFSET}]; " # get the list of loaded modules in initialization order.
)
What i try to achieve (comments start with #):
CODE: str = f"""
start:
int3;
mov ebp, esp;
add esp, 0xFFFFFDF0;
find_kernel32:
xor ecx, ecx;
# get the peb from the teb.
mov esi, fs:[ecx + {PEB_OFFSET}];
# get the ldr data structure from the peb.
mov esi, [esi + {PEB_LDR_DATA_OFFSET}];
# get the list of loaded modules in initialization order.
mov esi, [esi + {INIT_ORDER_MODULE_LIST_OFFSET}];
"""
The first version is ugly as hell and you have to format everything manually which is kinda annoying.
Hey there,
i'm currently using the keystone engine under python to implement a reverse shell for windows and i was curious if you can add comments into the assembler code itself. Maybe this is a stupid question, but i didn't see any reference if this is possible or not.
What i know is possible (formatting sucks, but in the editor it was clean.):
What i try to achieve (comments start with #):
The first version is ugly as hell and you have to format everything manually which is kinda annoying.