Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/external/source/shellcode/windows/templates/inc/pe.asm
Views: 11789
; PE FILE STRUCTURE1; =================23%include "pe.inc"45BIN_Begin6MZHeader7MZExtendedHeader8MZSection.text_Begin9push cs10pop ds11mov dx,MZSection.text_VA(text_string)12mov ah,0913int 21h14mov ax,4C01h15int 21h16text_string: db 'This program cannot be run in DOS mode.',0Dh,0Ah,'$'17MZSection.text_End1819PEHeader20%define PEOptionalheader_EipRVA PESection.text_RVA(mondebut)21PEOptionalHeader_Begin22PEOptionalHeader_Directory Export,0,023PEOptionalHeader_Directory Import,Import_Directorys_RVA,Import_Directorys_VS24; PEOptionalHeader_Directory Resource,0,025; PEOptionalHeader_Directory Exception,0,026; PEOptionalHeader_Directory Security,0,027; PEOptionalHeader_Directory Relocations,0,028; PEOptionalHeader_Directory Debug,0,029; PEOptionalHeader_Directory ImageDescription,0,030; PEOptionalHeader_Directory MachineSpecific,0,031; PEOptionalHeader_Directory ThreadLocalStorage,0,032PEOptionalHeader_End3334PESectionHeader .text,'.text',PESectionHeader_Flags_EXECUTABLECODE | PESectionHeader_Flags_DATAFROMFILE | PESectionHeader_Flags_EXECUTEACCESS | PESectionHeader_Flags_READACCESS35PESectionHeader .rdata,'.rdata',PESectionHeader_Flags_DATAFROMFILE | PESectionHeader_Flags_READACCESS36PESectionHeader .data,'.data',PESectionHeader_Flags_DATAFROMFILE | PESectionHeader_Flags_READACCESS | PESectionHeader_Flags_WRITEACCESS37PESectionHeader .bss,'.bss', PESectionHeader_Flags_DATA0 | PESectionHeader_Flags_READACCESS | PESectionHeader_Flags_WRITEACCESS38PESectionHeader .idata,'.idata',PESectionHeader_Flags_DATAFROMFILE | PESectionHeader_Flags_READACCESS39PESections_Begin40PESection.text_Begin41int 03h42mondebut:43MB_OK equ 044mov eax,MB_OK45push eax46mov eax,PESection.rdata_VA(message)47call [GetCommandLineA]48push eax49push eax50mov eax,051push eax52call [MessageBoxA]53call [PESection.idata_VA(Import.KERNEL32.ExitProcess)]54mov [PESection.text_VA(text1)],eax55mov [PESection.rdata_VA(rdata1)],ebx56mov [PESection.data_VA(data1)],ecx57mov [PESection.bss_VA(bss1)],edx58text1:59jmp short mondebut60PESection.text_End6162PESection.rdata_Begin63message: db "coucou",064rdata1: times 1001h db 22h ;db 'data1'65PESection.rdata_End6667PESection.data_Begin68data1: times 1205h db 0FEh69PESection.data_End7071PESection.bss_Begin72bss1: resb 1001h73PESection.bss_End7475PESection.idata_Begin76Import_Directorys_Begin .idata77Import_Directory KERNEL3278Import_Directory USER3279Import_Directorys_End8081Import_RVAs_Begin KERNEL3282Import_RVA KERNEL32,GetCommandLineA83Import_RVA KERNEL32,ExitProcess84Import_RVAs_End85Import_RVAs_Begin USER3286Import_RVA USER32,MessageBoxA87Import_RVAs_End8889Import_VAs_Begin KERNEL3290Import_VA KERNEL32,GetCommandLineA,0BFF8C5ACh91Import_VA KERNEL32,ExitProcess,0BFF8D4CAh92Import_VAs_End93Import_VAs_Begin USER3294Import_VA USER32,MessageBoxA95Import_VAs_End9697Import_Strings_Begin KERNEL3298Import_String_Function KERNEL32,GetCommandLineA,"GetCommandLineA",0D0h99Import_String_Function KERNEL32,ExitProcess,"ExitProcess",07Fh100Import_String_Dll KERNEL32,"KERNEL32.DLL"101Import_Strings_End102Import_Strings_Begin USER32103Import_String_Function USER32,MessageBoxA,"MessageBoxA"104Import_String_Dll USER32,"USER32.DLL"105Import_Strings_End106PESection.idata_End107108109110PESections_End111BIN_End112113114