1
0
mirror of synced 2024-11-12 02:00:52 +01:00

Updated cheat sheet page

This commit is contained in:
WerWolv 2020-11-22 11:20:01 +01:00
parent fbd4e593d2
commit 73d66365e9

View File

@ -78,6 +78,15 @@ namespace hex {
"#include \"mypattern.hexpat\"" "#include \"mypattern.hexpat\""
); );
DrawTitle("Pragma directives");
ImGui::TextWrapped(
"Pragma directives are used to give ImHex additional information about the code being read. Currently "
"the following directives are supported.");
DrawCodeSegment("pragma", 30,
"// Allow this file to be loaded as pattern when a file identified as application/x-executable gets loaded"
"#pragma MIME application/x-executable\n"
);
DrawTitle("Built-in types"); DrawTitle("Built-in types");
ImGui::TextWrapped( ImGui::TextWrapped(
"The following built-in types are available for use"); "The following built-in types are available for use");
@ -92,10 +101,13 @@ namespace hex {
DrawTitle("Variables and Arrays"); DrawTitle("Variables and Arrays");
ImGui::TextWrapped( ImGui::TextWrapped(
"Normal variables as well as arrays are used to highlight and display values."); "Normal variables as well as arrays are used to highlight and display values. "
DrawCodeSegment("vars arrays", 30, "It is possible to create arrays within structs and unions that use the value of a previously "
"declared variable as size.");
DrawCodeSegment("vars arrays", 45,
"u32 variable;\n" "u32 variable;\n"
"s8 string[16];" "s8 string[16];\n"
"u8 customSizedArray[variable];"
); );
DrawTitle("Structs"); DrawTitle("Structs");
@ -108,7 +120,7 @@ namespace hex {
" u8 version;\n" " u8 version;\n"
" padding[4];\n" " padding[4];\n"
" Flags flags;\n" " Flags flags;\n"
"}" "};"
); );
DrawTitle("Unions"); DrawTitle("Unions");
@ -119,7 +131,16 @@ namespace hex {
"union Color {\n" "union Color {\n"
" u32 rgba;\n" " u32 rgba;\n"
" Components components;\n" " Components components;\n"
"}" "};"
);
DrawTitle("Pointers");
ImGui::TextWrapped(
"\"Another possible type of member in structs and unions are pointers. They are variables"
"whose value is used as an offset from the start of the file to locate the actual offset. "
"The leading type is treated as the data being pointed to and the trailing type as the size of the pointer.");
DrawCodeSegment("pointer", 55,
"Data *data : u16;"
); );
DrawTitle("Bitfields"); DrawTitle("Bitfields");
@ -131,7 +152,7 @@ namespace hex {
" r : 1;\n" " r : 1;\n"
" w : 1;\n" " w : 1;\n"
" x : 1;\n" " x : 1;\n"
"}" "};"
); );
DrawTitle("Enum"); DrawTitle("Enum");
@ -145,7 +166,7 @@ namespace hex {
" Windows = 0x10,\n" " Windows = 0x10,\n"
" MacOSX,\n" " MacOSX,\n"
" Linux\n" " Linux\n"
"}" "};"
); );
DrawTitle("Using declarations"); DrawTitle("Using declarations");