Browse Source

Add 'BondiReaderPatch/BondiReaderPatch.exe.c'

master
Lord_Parmesan 2 months ago
parent
commit
ed980ecbc2
  1. 275
      BondiReaderPatch/BondiReaderPatch.exe.c

275
BondiReaderPatch/BondiReaderPatch.exe.c

@ -0,0 +1,275 @@
# #Ghidra-decompiled source code of the Bondi windows patch executable. Finally making a little progress here.
typedef unsigned char undefined;
typedef unsigned int ImageBaseOffset32;
typedef unsigned char byte;
typedef unsigned int dword;
typedef unsigned short word;
typedef unsigned short wchar16;
typedef union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion;
typedef struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct;
struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct {
dword OffsetToDirectory;
dword DataIsDirectory;
};
union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion {
dword OffsetToData;
struct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryStruct;
};
typedef struct IMAGE_DOS_HEADER IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER;
struct IMAGE_DOS_HEADER {
char e_magic[2]; // Magic number
word e_cblp; // Bytes of last page
word e_cp; // Pages in file
word e_crlc; // Relocations
word e_cparhdr; // Size of header in paragraphs
word e_minalloc; // Minimum extra paragraphs needed
word e_maxalloc; // Maximum extra paragraphs needed
word e_ss; // Initial (relative) SS value
word e_sp; // Initial SP value
word e_csum; // Checksum
word e_ip; // Initial IP value
word e_cs; // Initial (relative) CS value
word e_lfarlc; // File address of relocation table
word e_ovno; // Overlay number
word e_res[4][4]; // Reserved words
word e_oemid; // OEM identifier (for e_oeminfo)
word e_oeminfo; // OEM information; e_oemid specific
word e_res2[10][10]; // Reserved words
dword e_lfanew; // File address of new exe header
byte e_program[64]; // Actual DOS program
};
typedef struct IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32;
typedef struct IMAGE_DATA_DIRECTORY IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY;
struct IMAGE_DATA_DIRECTORY {
ImageBaseOffset32 VirtualAddress;
dword Size;
};
struct IMAGE_OPTIONAL_HEADER32 {
word Magic;
byte MajorLinkerVersion;
byte MinorLinkerVersion;
dword SizeOfCode;
dword SizeOfInitializedData;
dword SizeOfUninitializedData;
ImageBaseOffset32 AddressOfEntryPoint;
ImageBaseOffset32 BaseOfCode;
ImageBaseOffset32 BaseOfData;
pointer32 ImageBase;
dword SectionAlignment;
dword FileAlignment;
word MajorOperatingSystemVersion;
word MinorOperatingSystemVersion;
word MajorImageVersion;
word MinorImageVersion;
word MajorSubsystemVersion;
word MinorSubsystemVersion;
dword Win32VersionValue;
dword SizeOfImage;
dword SizeOfHeaders;
dword CheckSum;
word Subsystem;
word DllCharacteristics;
dword SizeOfStackReserve;
dword SizeOfStackCommit;
dword SizeOfHeapReserve;
dword SizeOfHeapCommit;
dword LoaderFlags;
dword NumberOfRvaAndSizes;
struct IMAGE_DATA_DIRECTORY DataDirectory[16];
};
typedef struct Var Var, *PVar;
struct Var {
word wLength;
word wValueLength;
word wType;
};
typedef struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct;
struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct {
dword NameOffset;
dword NameIsString;
};
typedef struct IMAGE_FILE_HEADER IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER;
struct IMAGE_FILE_HEADER {
word Machine; // 332
word NumberOfSections;
dword TimeDateStamp;
dword PointerToSymbolTable;
dword NumberOfSymbols;
word SizeOfOptionalHeader;
word Characteristics;
};
typedef struct IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32;
struct IMAGE_NT_HEADERS32 {
char Signature[4];
struct IMAGE_FILE_HEADER FileHeader;
struct IMAGE_OPTIONAL_HEADER32 OptionalHeader;
};
typedef struct StringFileInfo StringFileInfo, *PStringFileInfo;
struct StringFileInfo {
word wLength;
word wValueLength;
word wType;
};
typedef union IMAGE_RESOURCE_DIRECTORY_ENTRY IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;
typedef union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion, *PIMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion;
union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion {
struct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct IMAGE_RESOURCE_DIRECTORY_ENTRY_NameStruct;
dword Name;
word Id;
};
union IMAGE_RESOURCE_DIRECTORY_ENTRY {
union IMAGE_RESOURCE_DIRECTORY_ENTRY_NameUnion NameUnion;
union IMAGE_RESOURCE_DIRECTORY_ENTRY_DirectoryUnion DirectoryUnion;
};
typedef struct StringTable StringTable, *PStringTable;
struct StringTable {
word wLength;
word wValueLength;
word wType;
};
typedef struct IMAGE_SECTION_HEADER IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER;
typedef union Misc Misc, *PMisc;
typedef enum SectionFlags {
IMAGE_SCN_ALIGN_1024BYTES=11534336,
IMAGE_SCN_ALIGN_128BYTES=8388608,
IMAGE_SCN_ALIGN_16BYTES=5242880,
IMAGE_SCN_ALIGN_1BYTES=1048576,
IMAGE_SCN_ALIGN_2048BYTES=12582912,
IMAGE_SCN_ALIGN_256BYTES=9437184,
IMAGE_SCN_ALIGN_2BYTES=2097152,
IMAGE_SCN_ALIGN_32BYTES=6291456,
IMAGE_SCN_ALIGN_4096BYTES=13631488,
IMAGE_SCN_ALIGN_4BYTES=3145728,
IMAGE_SCN_ALIGN_512BYTES=10485760,
IMAGE_SCN_ALIGN_64BYTES=7340032,
IMAGE_SCN_ALIGN_8192BYTES=14680064,
IMAGE_SCN_ALIGN_8BYTES=4194304,
IMAGE_SCN_CNT_CODE=32,
IMAGE_SCN_CNT_INITIALIZED_DATA=64,
IMAGE_SCN_CNT_UNINITIALIZED_DATA=128,
IMAGE_SCN_GPREL=32768,
IMAGE_SCN_LNK_COMDAT=4096,
IMAGE_SCN_LNK_INFO=512,
IMAGE_SCN_LNK_NRELOC_OVFL=16777216,
IMAGE_SCN_LNK_OTHER=256,
IMAGE_SCN_LNK_REMOVE=2048,
IMAGE_SCN_MEM_16BIT=131072,
IMAGE_SCN_MEM_DISCARDABLE=33554432,
IMAGE_SCN_MEM_EXECUTE=536870912,
IMAGE_SCN_MEM_LOCKED=262144,
IMAGE_SCN_MEM_NOT_CACHED=67108864,
IMAGE_SCN_MEM_NOT_PAGED=134217728,
IMAGE_SCN_MEM_PRELOAD=524288,
IMAGE_SCN_MEM_PURGEABLE=131072,
IMAGE_SCN_MEM_READ=1073741824,
IMAGE_SCN_MEM_SHARED=268435456,
IMAGE_SCN_MEM_WRITE=2147483648,
IMAGE_SCN_RESERVED_0001=16,
IMAGE_SCN_RESERVED_0040=1024,
IMAGE_SCN_TYPE_NO_PAD=8
} SectionFlags;
union Misc {
dword PhysicalAddress;
dword VirtualSize;
};
struct IMAGE_SECTION_HEADER {
char Name[8];
union Misc Misc;
ImageBaseOffset32 VirtualAddress;
dword SizeOfRawData;
dword PointerToRawData;
dword PointerToRelocations;
dword PointerToLinenumbers;
word NumberOfRelocations;
word NumberOfLinenumbers;
enum SectionFlags Characteristics;
};
typedef struct VS_VERSION_INFO VS_VERSION_INFO, *PVS_VERSION_INFO;
struct VS_VERSION_INFO {
word StructLength;
word ValueLength;
word StructType;
wchar16 Info[16];
byte Padding[2];
dword Signature;
word StructVersion[2];
word FileVersion[4];
word ProductVersion[4];
dword FileFlagsMask[2];
dword FileFlags;
dword FileOS;
dword FileType;
dword FileSubtype;
dword FileTimestamp;
};
typedef struct IMAGE_RESOURCE_DATA_ENTRY IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY;
struct IMAGE_RESOURCE_DATA_ENTRY {
dword OffsetToData;
dword Size;
dword CodePage;
dword Reserved;
};
typedef struct VarFileInfo VarFileInfo, *PVarFileInfo;
struct VarFileInfo {
word wLength;
word wValueLength;
word wType;
};
typedef struct IMAGE_RESOURCE_DIRECTORY IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY;
struct IMAGE_RESOURCE_DIRECTORY {
dword Characteristics;
dword TimeDateStamp;
word MajorVersion;
word MinorVersion;
word NumberOfNamedEntries;
word NumberOfIdEntries;
};
typedef struct StringInfo StringInfo, *PStringInfo;
struct StringInfo {
word wLength;
word wValueLength;
word wType;
};
Loading…
Cancel
Save