Unnamed: 0
int64
0
305k
body
stringlengths
7
52.9k
name
stringlengths
1
185
68,900
String ( int value ) { return String.format("0x%04x", (short)value); }
shortToHexString
68,901
String ( int value ) { return String.format("0x%02x", (byte)value); }
byteToHexString
68,902
long () { return myOffset; }
getOffset
68,903
String () { throw new UnsupportedOperationException(); }
readLine
68,904
String () { throw new UnsupportedOperationException(); }
readUTF
68,905
Section (ImageSectionHeader header, ImageOptionalHeader imageOptionalHeader) { if (RESOURCES_SECTION_NAME.equals(header.getSectionName())) { return new ResourceSectionReader(header, imageOptionalHeader); } else { return new Simple(header); } }
newSection
68,906
String () { return myName; }
getSectionName
68,907
long () { return myPeHeader.sizeInBytes() + myMsDosStub.sizeInBytes() + myMsDosHeader.sizeInBytes(); }
getValue
68,908
long () { long result = myPeHeader.sizeInBytes() + myMsDosStub.sizeInBytes() + myMsDosHeader.sizeInBytes() + myPadding.sizeInBytes(); for (Section section : mySections) { result += section.sizeInBytes(); } return result; }
sizeInBytes
68,909
long () { // AKA VirtualAddress + VirtualSize of the latest section, must be dividable by SectionAlignment long sectionAlignment = myImageOptionalHeader.getSectionAlignment().getValue(); long result = 0; long lastVA = 0; for (ImageSectionHeader header : mySectionHeaders) { long va = ((Value)header.getVirtualAddress())....
virtualSizeInBytes
68,910
ArrayOfBins<ImageSectionHeader> () { return mySectionHeaders; }
getSectionHeaders
68,911
PeHeaderReader () { return myPeHeader; }
getPeHeader
68,912
Section (String sectionName) { for (Section section : mySections) { if (sectionName.equals(section.getSectionName())) { return section; } } return null; }
getSectionReader
68,913
void (long newOffset) { super.resetOffsets(newOffset); long mainOffset = myPeHeader.getOffset() + myPeHeader.sizeInBytes() + myPadding.sizeInBytes(); long mainOffset2 = myPeHeader.sizeInBytes() + myMsDosStub.sizeInBytes() + myMsDosHeader.sizeInBytes() + myPadding.sizeInBytes(); assert mainOffset == myPeHeader.getImageO...
resetOffsets
68,914
void () { long virtualAddress = mySectionHeaders.get(0).getVirtualAddress().getValue(); long sectionAlignment = myImageOptionalHeader.getSectionAlignment().getValue(); for (ImageSectionHeader header : mySectionHeaders) { // Section always starts from an address aligned to IMAGE_OPTIONAL_HEADER::SectionAlignment, which ...
sectionVirtualAddressFixup
68,915
void (String name, int index) { ImageSectionHeader header = getSection(name); ImageDataDirectory directory = myImageOptionalHeader.getImageDataDirectories().get(index); directory.getVirtualAddress().setValue(header.getVirtualAddress().getValue()); directory.getSize().setValue(header.getVirtualSize().getValue()); }
updateDataDirectoryFromSectionHeader
68,916
ImageSectionHeader (String name) { for (ImageSectionHeader header : mySectionHeaders) { if (name.equals(header.getSectionName())) { return header; } } throw new IllegalStateException("Cannot find section with name " + name); }
getSection
68,917
String () { return myNameTxt.getValue(); }
getSectionName
68,918
DWord () { return myVirtualSize; }
getVirtualSize
68,919
DWord () { return myVirtualAddress; }
getVirtualAddress
68,920
DWord () { return mySizeOfRawData; }
getSizeOfRawData
68,921
DWord () { return myPointerToRawData; }
getPointerToRawData
68,922
ImageFileHeader () { return myImageFileHeader; }
getImageFileHeader
68,923
ImageOptionalHeader () { return myImageOptionalHeader; }
getImageOptionalHeader
68,924
ArrayOfBins<ImageSectionHeader> () { return myImageSectionHeaders; }
getImageSectionHeaders
68,925
ArrayOfBins<ImageDataDirectory> () { return myImageDataDirectories; }
getImageDataDirectories
68,926
DWord () { return mySectionAlignment; }
getSectionAlignment
68,927
DWord () { return myFileAlignment; }
getFileAlignment
68,928
DWord () { return mySizeOfImage; }
getSizeOfImage
68,929
DWord () { return mySizeOfHeaders; }
getSizeOfHeaders
68,930
Type () { short value = (short)getValue(); switch (value) { case 0x10B -> { return Type.PE32; } case 0x20B -> { return Type.PE32Plus; } default -> throw new IllegalStateException("Unsupported magic: " + Integer.toHexString(value)); } }
getType
68,931
Value () { return switch (myMagic.getType()) { case PE32 -> myPe32; case PE32Plus -> myPe32Plus; }; }
getCurrent
68,932
long () { return getCurrent().sizeInBytes(); }
sizeInBytes
68,933
long () { return getCurrent().getValue(); }
getValue
68,934
Value (long value) { getCurrent().setValue(value); return this; }
setValue
68,935
DWord () { return myVirtualAddress; }
getVirtualAddress
68,936
DWord () { return mySize; }
getSize
68,937
String () { return myName; }
getName
68,938
void (String name) { myName = name; }
setName
68,939
String () { if (myDescription != null) { return myDescription; } return myName; }
getDescription
68,940
long () { return myOffset; }
getOffset
68,941
void (long offset) { myOffset = offset; updateSizeOffsetHolders(); }
resetOffsets
68,942
void () { for (Value holder : myOffsetHolders) { holder.setValue(myOffset); } for (Value holder : mySizeHolders) { holder.setValue(sizeInBytes()); } }
updateSizeOffsetHolders
68,943
void (Bin value) { }
copyFrom
68,944
void (Value offsetHolder) { myOffsetHolders.add( offsetHolder ); }
addOffsetHolder
68,945
void (Value sizeHolder) { mySizeHolders.add( sizeHolder ); }
addSizeHolder
68,946
void (String description) { myDescription = description; }
setDescription
68,947
void (long newOffset) { super.resetOffsets(newOffset); long offset = getOffset(); for (Bin bin : myMembers) { bin.resetOffsets(offset); offset += bin.sizeInBytes(); } updateSizeOffsetHolders(); }
resetOffsets
68,948
void (Bin binStructure) { Bin.Structure structure = (Bin.Structure)binStructure; ArrayList<Bin> members = structure.getMembers(); for (Bin bin : members) { Bin valueMember = myMembersMap.get(bin.getName()); if (valueMember != null) { valueMember.copyFrom(bin); } } }
copyFrom
68,949
long () { long size = 0; for (Bin bin : myMembers) { size += bin.sizeInBytes(); } return size; }
sizeInBytes
68,950
ArrayList<Bin> () { return myMembers; }
getMembers
68,951
void (Bin bin) { myMembersMap.put(bin.getName(), bin); }
addMemberToMapOnly
68,952
void (Bin value) { setValue(((Value)value).getValue()); }
copyFrom
68,953
long () { return myValue; }
getRawValue
68,954
void (long value) { myValue = value; }
setRawValue
68,955
long () { throw new IllegalStateException(); }
sizeInBytes
68,956
void (DataInput stream) { throw new IllegalStateException(); }
read
68,957
void (DataOutput stream) { throw new IllegalStateException(); }
write
68,958
void (OutputStreamWriter writer) { throw new IllegalStateException(); }
report
68,959
Value (long value) { throw new IllegalStateException(); }
setValue
68,960
long () { return 1; }
sizeInBytes
68,961
long () { return getRawValue(); }
getValue
68,962
Byte (long value) { setRawValue(value); return this; }
setValue
68,963
String () { return BitsUtil.byteToHexString((int)getValue()); }
toString
68,964
long () { return 2; }
sizeInBytes
68,965
long () { return Short.toUnsignedLong(Short.reverseBytes((short) super.getRawValue())); }
getValue
68,966
Word (long value) { setRawValue(Short.toUnsignedLong(Short.reverseBytes((short)value))); return this; }
setValue
68,967
String () { return BitsUtil.shortToHexString( (int)getValue() ); }
toString
68,968
long () { return 4; }
sizeInBytes
68,969
DWord (long value) { setRawValue(Integer.toUnsignedLong(Integer.reverseBytes((int)value))); return this; }
setValue
68,970
long () { return Integer.toUnsignedLong(Integer.reverseBytes((int) super.getRawValue())); }
getValue
68,971
String () { return BitsUtil.intToHexString( (int)getValue() ); }
toString
68,972
long () { return Long.reverseBytes(getRawValue()); }
getValue
68,973
LongLong (long value) { setRawValue(Long.reverseBytes(value)); return this; }
setValue
68,974
long () { return 8; }
sizeInBytes
68,975
long () { return bytesToSkip(getOffset()); }
sizeInBytes
68,976
int (long offset) { int offsetMask = myBytes-1; long offsetBits = offset & offsetMask; return offsetBits == 0 ? 0 : (int) (myBytes - offsetBits); }
bytesToSkip
68,977
void (OutputStreamWriter writer) { }
report
68,978
String () { return "Padding{" + getName() + "," + myBytes + '}'; }
toString
68,979
long () { return mySize.getValue(); }
sizeInBytes
68,980
String () { return myBuffer.toString(); }
getValue
68,981
String () { return "CharStringFS{size=" + mySize.getValue() + ", value=" + getValue() + "}"; }
toString
68,982
String () { return myValue; }
getValue
68,983
void (String value) { myValue = value; mySize.setValue(value.length()); }
setValue
68,984
long () { return mySize.sizeInBytes() + mySize.getValue() * 2; }
sizeInBytes
68,985
String () { return "WCharStringSP{" + "size=" + mySize + ", value=" + myValue + '}'; }
toString
68,986
long () { return myValue.length() * 2L + 2; }
sizeInBytes
68,987
String () { return myValue; }
getValue
68,988
void (String value) { myValue = value; }
setValue
68,989
String () { return "WCharStringNT{value=" + myValue + '}'; }
toString
68,990
byte[] () { return myBytes; }
getBytes
68,991
void (byte[] bytes) { setBytes(bytes, bytes.length); }
setBytes
68,992
void (byte[] bytes, int size) { if (bytes.length < size) { throw new RuntimeException("bytes.length < size"); } myBytes = bytes; mySize.setValue(size); }
setBytes
68,993
long () { return mySize.getValue(); }
sizeInBytes
68,994
String () { return "Bytes{" + "StartOffset=" + myStartOffset + ", Size=" + mySize + '}'; }
toString
68,995
void (T bin) { myValues.add(bin); if (myCountHolder != null) { myCountHolder.setValue(myValues.size()); } }
addBin
68,996
void (Bin bin) { //noinspection unchecked ArrayOfBins<T> value = (ArrayOfBins<T>)bin; for (int i = 0; i < myValues.size(); i++) { myValues.get(i).copyFrom(value.myValues.get(i)); } }
copyFrom
68,997
void (Value countHolder) { myCountHolder = countHolder; }
setCountHolder
68,998
void () { int size = (int)mySize.getValue(); myValues = new ArrayList<>(size); for (int i = 0; i < size; i++) { try { T bin = myClass.getDeclaredConstructor().newInstance(); bin.setName("[" + i + "]"); myValues.add(bin); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethod...
init
68,999
void (long newOffset) { super.resetOffsets(newOffset); long offset = getOffset(); if (myCountHolder != null) { myCountHolder.setValue(myValues.size()); } for (Bin bin : myValues) { bin.resetOffsets(offset); offset += bin.sizeInBytes(); } }
resetOffsets