Skip to content

Instantly share code, notes, and snippets.

@Flygsand
Created September 28, 2022 18:30
Show Gist options
  • Save Flygsand/6395698e5d750f171d20b18b98e157b2 to your computer and use it in GitHub Desktop.
Save Flygsand/6395698e5d750f171d20b18b98e157b2 to your computer and use it in GitHub Desktop.
INIB > JSON
import sys
import struct
import json
KEYS = {
-2129310917: '0x81154B3B',
-2117554806: 'godray_inival',
-2117455812: 'skyToneAmbientIntensity',
-2111807076: 'tmaaSharpness_1',
-2105411348: 'avmp10',
-2084801279: '0x83BC7501',
-2053351858: 'AA_Sharpness',
-2050997263: 'AntiAliasing',
-2042905359: 'ssrShinessFade',
-2042355185: '0x8644220F',
-2021472187: 'leafSpecColMinShiness',
-1991854059: '0x8946B815',
-1978596389: '0x8A1103DB',
-1978490164: 'tmaaSharpness_2',
-1967922138: '0x8AB3E426',
-1955533232: 'blm_saturation3',
-1926797598: '0x8D2766E2',
-1871093832: '0x90795FB8',
-1867541189: 'tssaoPostBlurSharpness',
-1860281733: 'blm_emissive_min',
-1857762455: '0x9144CB69',
-1813429491: 'tonemax',
-1810237070: 'toonIBLScaleVal',
-1806168181: 'avmp04',
-1802696126: '0x948D0A42',
-1799216179: 'toneBlmmax',
-1798686365: 'avmp01',
-1796202145: '0x94F0215F',
-1792840208: '0x95236DF0',
-1752693995: 'avmp13',
-1710086704: '0x9A1225D0',
-1692835515: '0x9B196145',
-1681560390: 'ao_rangeRatio',
-1675325592: 'blm_saturation1',
-1648843410: '0x9DB8A56E',
-1645854064: 'toonDirBackBright',
-1642268974: 'godray_scale',
-1641291979: '0x9E2BDF35',
-1608168892: 'blurBlurRange',
-1583448214: '0xA19E7F6A',
-1571111969: 'toneDownSpeed',
-1553720807: 'tmaaBlendMPF',
-1502480097: '0xA671F91F',
-1490161796: '0xA72DEF7C',
-1485421444: 'blur2Str',
-1483399342: '0xA7951F52',
-1469320101: 'tssaoWeakenRatio',
-1432157481: 'avmp12',
-1418632234: 'tmaaSharpness_0',
-1408446283: 'ao_blurScale',
-1404791494: 'wetMaxShiness',
-1402575466: 'tmaaSharpness_Hnd_4',
-1373631614: 'blm_weight1',
-1367692745: '0xAE7AAA37',
-1364093924: 'red_AtMinY',
-1359505486: 'tssaoLuminanceCorrection',
-1335991324: 'tmaaNewUpScale',
-1334214850: 'lens_weight',
-1333865682: 'rim_color',
-1328000811: '0xB0D850D5',
-1322359778: '0xB12E641E',
-1309371454: '0xB1F493C2',
-1292479324: 'shwCharParm',
-1291639545: 'tmaaSharpness_Hnd_2',
-1276424122: '0xB3EB5046',
-1271760510: 'blm_border_mul2',
-1269088412: 'blur2CameraScale',
-1238475666: 'red_Auto',
-1228838254: '0xB6C16A92',
-1226568480: 'ao_subRatio',
-1194797554: '0xB8C8D60E',
-1191711314: '0xB8F7EDAE',
-1185793717: 'blm_gauss1',
-1170665914: '0xBA390E46',
-1134512011: 'blm_border_sub2',
-1121153867: 'ColReduction',
-1109595395: '0xBDDCEAFD',
-1104616269: 'toneBlmmin',
-1103360520: 'avmp03',
-1089886845: 'shadowCloudScrollSpeed',
-1085981854: 'AA_ThresholdMin',
-1067285437: 'AA_Threshold',
-1047419133: '0xC191A703',
-1045124206: 'blur2HLV',
-1037652948: 'simShwStr',
-1033225309: 'tssaoRadius',
-1021891381: 'ao_av_CenterWeight',
-999938815: '0xC4662501',
-994506352: '0xC4B90990',
-986652312: 'red_AtMaxX',
-974528678: 'blur2BlurRange',
-965009844: 'tssaoOutputAO',
-961611450: '0xC6AEF946',
-960410998: 'red_hdsclX',
-956239354: 'shadowRaytraceDistance',
-945551453: '0xC7A407A3',
-942763751: '0xC7CE9119',
-934671011: 'avmp05',
-927942181: 'lens_rot',
-917750420: '0xC94C3D6C',
-891350105: 'lens_UVDecay',
-889409598: 'toonDirPntSptRatio',
-885723793: '0xCB34ED6F',
-884506303: 'iblBlendBetweenFrame',
-877893869: 'tmaaBlendPBR',
-873067060: '0xCBF60DCC',
-869769167: '0xCC286031',
-862488925: '0xCC9776A3',
-839031206: '0xCDFD665A',
-824028066: '0xCEE2545E',
-818454449: '0xCF37604F',
-805024054: '0xD0044ECA',
-780912392: 'tmaaSharpnessType',
-770573904: '0xD211F9B0',
-752987085: 'red_sclX',
-749214802: '0xD357E3AE',
-719212579: 'avmp02',
-703057307: 'iblSkyIntensity',
-700770857: '0xD63B15D7',
-691086609: '0xD6CEDAEF',
-680482788: '0xD770A81C',
-616240801: '0xDB44E95F',
-613854388: 'red_hdsclY',
-608304666: '0xDBBE01E6',
-598155930: 'skyToneDirLightIntensity',
-580423098: '0xDD677246',
-570582717: '0xDDFD9943',
-546491344: '0xDF6D3430',
-542043018: 'blm_weight4',
-534141024: 'ssao',
-532723778: 'blm_deviation2',
-490453174: 'blm_weight2',
-480253545: '0xE35FE997',
-478665184: 'lens_paMax',
-475685092: '0xE3A59F1C',
-416055795: 'blm_saturation5',
-407313575: '0xE7B8E359',
-397119024: 'ao_av_FadeOutDistance',
-389909711: 'blur',
-381703024: 'iblDirectLightIntensity',
-379680868: '0xE95E879C',
-360254404: 'godray',
-358153810: 'ssrIntensity',
-339000253: '0xEBCB4443',
-323281787: 'lightShaft',
-311191198: 'red_AtMinX',
-292689875: 'ao_blurRange',
-291834645: 'tssaoIntensityPow',
-286154597: '0xEEF1A09B',
-246188626: 'toonCharShadowAlpha',
-241925542: 'shadowRaytracePitch',
-238272965: 'godray_decay',
-229600999: '0xF2509119',
-218541664: '0xF2F951A0',
-214732532: '0xF333710C',
-200708645: 'vignetteColor',
-196636765: 'dof',
-195932998: '0xF4524CBA',
-186927639: '0xF4DBB5E9',
-182561713: '0xF51E544F',
-175195723: '0xF58EB9B5',
-169116891: '0xF5EB7B25',
-164631415: 'cloud_color',
-156108346: 'tonescale',
-151053024: '0xF6FF1D20',
-145642824: 'ifmg',
-134309018: '0xF7FE9B66',
-115707821: 'shadowHalf',
-83262773: '0xFB0982CB',
-76942575: 'blur2PixelRange',
-67104410: 'shadowCloudSize',
-60134472: '0xFC6A6BB8',
-56266724: '0xFCA5701C',
-54773468: 'blurSub',
-46449510: '0xFD3B3C9A',
-46200913: '0xFD3F07AF',
-45288349: 'shadowCloudScrollDir',
-33628202: 'shwHalfLamParm',
-30778036: '0xFE2A5D4C',
-13827381: 'lensFlare',
-7523577: 'ao_av_BlurFallOff',
-2888064: '0xFFD3EE80',
320840: '0x4E548',
14150462: 'blm_saturation2',
15029333: 'shadowStr',
29196622: 'ao_av_BlurScale',
42409831: '0x2871F67',
45569471: '0x2B755BF',
56341483: '0x35BB3EB',
58348187: 'lens_decay',
62662447: 'trans_red_sclX',
74440446: '0x46FDEFE',
79361426: 'avmp07',
91789898: '0x5789A4A',
99681460: '0x5F104B4',
107501464: 'ssrFadeSec',
122393214: 'ao_av_FadeOutStart',
124677425: '0x76E6D31',
136929407: '0x829607F',
154908401: 'wetShinessScale',
186936317: 'simShwMin',
191331672: 'tssaoIntensityMul',
202203843: 'ao_range',
207005428: 'blm_str3',
228702067: 'shadowCloudStr',
242530407: 'toonShadowAlpha',
260521473: '0xF873E01',
262888719: '0xFAB5D0F',
264063490: '0xFBD4A02',
289492654: 'tmaaSharpness_Hnd_5',
292085858: 'avmp09',
293978444: 'tmaaSharpness_5',
301911556: '0x11FECE04',
305078353: '0x122F2051',
366033925: '0x15D13C05',
369870225: 'avmp16',
398495929: 'red_sclY',
403776590: '0x1811244E',
412802793: '0x189ADEE9',
415933484: 'lens_sub',
416768475: 'blm_deviation4',
437687294: '0x1A1693FE',
439570656: 'wetToOutsideFrame',
440102851: 'blm_weight3',
469674501: 'rim_intensity',
477228508: '0x1C71EDDC',
498268589: 'sRGBMode',
505855710: 'blur2',
514494561: '0x1EAA9061',
523548278: 'toonDirInOutMin',
524203818: '0x1F3EB72A',
548439738: 'avmp06',
551846055: 'toonDirElevation',
578548070: 'tonemap',
579175701: '0x22858515',
583817890: 'toneHistogramLow',
589865045: '0x2328A055',
597332522: 'reduceDirLightRim',
607548140: 'gpucount',
608544295: 'monochromeToonId',
613862837: '0x2496CDB5',
629465658: 'blm_str2',
643052358: 'blm_border_max',
646454162: 'wetToInsideFrame',
650748440: '0x26C9A218',
661861009: '0x27733291',
668128137: '0x27D2D389',
686952778: 'ao_av_MaxDistance',
687109163: 'blm_border_sub',
696822327: '0x2988AA37',
699596090: '0x29B2FD3A',
765977606: 'tmaaSharpness_4',
769820381: 'blm_gauss3',
784121150: 'lightShaftTonemapLuminance',
791541439: 'tmaaBlendDefault',
796187716: 'wetDarkness',
802082608: '0x2FCECF30',
806499043: '0x301232E3',
819110610: 'furBlurStr',
820805521: '0x30EC7F91',
840599368: 'tmaaSharpnessAwareIntensity',
849750147: 'blm_saturation4',
853162913: '0x32DA3BA1',
862649694: '0x336AFD5E',
882103358: 'blm_deviation3',
902647072: '0x35CD4D20',
918781199: 'lens_mul',
932892393: 'avmp15',
938449043: 'blurAlpha',
939791712: '0x38041560',
945268300: '0x3857A64C',
961383133: '0x394D8ADD',
962986950: '0x396603C6',
977130622: 'gamma',
1003492435: 'ao_sub',
1012577404: '0x3C5AB47C',
1035553683: '0x3DB94B93',
1047302177: 'tmaaSharpness_Hnd_1',
1049308671: '0x3E8B2DFF',
1061302394: 'blur2ObjScale',
1061422909: 'toneHistogramHigh',
1093464363: 'cloud_h_min',
1110897127: '0x4236F1E7',
1115377954: '0x427B5122',
1148996641: 'tssao',
1154582565: '0x44D18825',
1185233204: 'furBlur',
1210837331: 'leafSpecColMaxShiness',
1214289243: '0x4860955B',
1219308610: 'bloom',
1227287231: 'shadowCloud',
1243545618: 'ao_av_MaxRadius',
1257083386: 'red_AtRate',
1260473587: 'lightShaftTonemapScale',
1263662291: 'avmp11',
1273907919: 'tssaoSelectiveFiltering',
1294823255: 'furBlurPixelRange',
1300451367: 'trans_red_sclY',
1318717876: '0x4E9A09B4',
1323845085: 'toonDirType',
1328083150: 'TransReduction',
1348895943: '0x506684C7',
1363661615: 'lens_max',
1364566735: 'avmp08',
1433316765: 'toneBlmmul',
1434066124: 'tmaaSharpness_Hnd_3',
1442549002: '0x55FB8D0A',
1473159436: '0x57CEA10C',
1495630265: 'simShwIn',
1500254228: 'toneUpSpeed',
1506656834: 'blur2Sub',
1526416133: '0x5AFB4305',
1533231001: 'blm_deviation5',
1555629316: '0x5CB90504',
1566825078: '0x5D63DA76',
1573447559: 'ao_Lengs',
1575705546: 'leafSpecColRatio',
1579925060: 'blm_border_mul',
1595193752: '0x5F14B998',
1606984512: 'lut',
1614010375: 'red_AtMaxY',
1614358360: '0x60392758',
1620644430: '0x6099124E',
1632545847: 'cam_near',
1634955315: 'ao_LengsRatio',
1641178208: '0x61D26460',
1646351811: 'ao_Mul',
1651696136: '0x6272E208',
1664247163: 'tmaaSharpness_Hnd_0',
1666914939: 'lightRimColor',
1672631034: 'blm_weight5',
1673904136: 'blurStr',
1678251218: 'tonemin',
1687858077: '0x649AAB9D',
1697885257: '0x6533AC49',
1705389742: 'ssrGroundness',
1722084191: '0x66A4EB5F',
1727053108: 'bloom2',
1751059188: 'blm_gauss2',
1755608542: 'blm_emissive_max',
1761155608: '0x68F91A18',
1764640311: '0x692E4637',
1772128672: 'blm_emissive_str',
1779125556: 'monochromeFogScale',
1787883154: 'toonDirLightScaleVal',
1792760468: 'lens_str',
1805313870: '0x6B9AE74E',
1861340580: '0x6EF1CDA4',
1865344955: 'toonCharShadowMin',
1872876437: '0x6FA1D395',
1888426102: 'tmaa',
1891578419: 'aoskip',
1894180487: 'blm_tone_scale',
1898768373: '0x712CE7F5',
1903833439: 'blm_deviation1',
1920721272: 'tmaaSharpness_3',
1923733505: '0x72A9D801',
1936642831: '0x736ED30F',
1975967990: 'blm_str1',
2004580448: 'shadowColor',
2016407126: 'cam_far',
2018349680: '0x784D9270',
2032563724: 'avmp14',
2059780162: '0x7AC5C042',
2060290157: 'AA_Range',
2066317234: '0x7B297FB2',
2079480573: '0x7BF25AFD',
2097017665: 'cloud_h_max',
2110582393: 'tmaaBlendToon',
2112683307: '0x7DECFD2B',
2124390461: 'ssr',
2137601368: '0x7F693558'
}
TYPE_BOOL = 0
TYPE_FLOAT = 1
TYPE_VECTOR_3D = 2
TYPE_VECTOR_4D = 3
def round_float(val):
return round(val, 3)
def read_typed(f, type):
if type == TYPE_BOOL:
return int.from_bytes(f.read(4), 'little') == int(True)
elif type == TYPE_FLOAT:
return round_float(struct.unpack('<f', f.read(4))[0])
elif type == TYPE_VECTOR_3D:
return [round_float(f) for f in struct.unpack('<3f', f.read(12))]
elif type == TYPE_VECTOR_4D:
return [round_float(f) for f in struct.unpack('<4f', f.read(16))]
else:
raise ValueError('bad type %d' % type)
def main(binfile):
with open(binfile, 'rb') as f:
magic, entry_table_offset, entry_count = struct.unpack('< 4s 4x I I', f.read(16))
if magic != b'INIB':
print('error: not an INIB file', file=sys.stderr)
f.seek(entry_table_offset)
entry_table = []
for _ in range(0, entry_count):
hash, type, offset = struct.unpack('< i i I', f.read(12))
entry_table.append((KEYS[hash], type, offset))
out = {}
for key, type, offset in entry_table:
f.seek(offset)
val = read_typed(f, type)
out[key] = val
json.dump(out, sys.stdout, indent=2)
if __name__ == '__main__':
main(*sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment