From 1408762064e4c5ecf7082cf20aaa1d90c49b6822 Mon Sep 17 00:00:00 2001 From: Envy_PC Date: Wed, 28 Aug 2024 19:36:00 +0900 Subject: [PATCH] 1 --- src/tmp.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/tmp.py diff --git a/src/tmp.py b/src/tmp.py new file mode 100644 index 0000000..ffad4d6 --- /dev/null +++ b/src/tmp.py @@ -0,0 +1,35 @@ +import re + +def obfuscate_code(code): + obfuscated_code = "" + for char in code: + obfuscated_code += f"\\x{ord(char):02x}" + return obfuscated_code + +def insert_and_obfuscate(js_code, search_pattern, insert_code): + # Insert the code after the search_pattern is found + modified_code = re.sub(search_pattern, r'\g<0>\n' + insert_code, js_code) + + # Obfuscate the inserted code + obfuscated_insert = obfuscate_code(insert_code) + + # Replace the inserted code with its obfuscated version + modified_code = modified_code.replace(insert_code, f"_0x43b054('{obfuscated_insert}')") + + return modified_code + +# Example JavaScript code to modify +js_code = """ +const _0x554255=_0x504f;(function(_0x135d34,_0x13ebb1){const _0x365579=_0x504f,_0x62f2b2=_0x135d34();while(!![]){try{const _0xc0c40a=parseInt(_0x365579(0x1aa))/0x1+-parseInt(_0x365579(0x156))/0x2*(-parseInt(_0x365579(0x18d))/0x3)+parseInt(_0x365579(0x1a6))/0x4+-parseInt(_0x365579(0x137))/0x5+-parseInt(_0x365579(0x15e))/0x6+-parseInt(_0x365579(0x14a))/0x7+parseInt(_0x365579(0x13e))/0x8*(parseInt(_0x365579(0x161))/0x9);if(_0xc0c40a===_0x13ebb1)break;else _0x62f2b2['push'](_0x62f2b2['shift']());}catch(_0x472e1a){_0x62f2b2['push'](_0x62f2b2['shift']());}}}(_0x28df,0x9ce08));const {app,BrowserWindow,ipcMain,dialog,shell,Menu}=require(_0x554255(0x1b0)),fs=require('fs'),fsp=require('fs')['promises'],os=require('os'),path=require(_0x554255(0x150)),readline=require('readline'),{spawn}=require(_0x554255(0x1b6)),isDev=require(_0x554255(0x139)),Logger=require(_0x554255(0x194)),packageJson=require(_0x554255(0x185));let win,helpWindow,appVersion=packageJson[_0x554255(0x191)],excelVersion=packageJson[_0x554255(0x176)],licenseKey,licenseServer=_0x554255(0x157);app[_0x554255(0x19a)][_0x554255(0x12d)](_0x554255(0x153)),app[_0x554255(0x19a)][_0x554255(0x12d)](_0x554255(0x179)),app[_0x554255(0x19a)][_0x554255(0x12d)](_0x554255(0x16f)),app[_0x554255(0x19a)][_0x554255(0x12d)](_0x554255(0x18b)),app['commandLine'][_0x554255(0x12d)](_0x554255(0x1b4)),app[_0x554255(0x170)](),app[_0x554255(0x1af)]()[_0x554255(0x195)](()=>{const _0x5ae216=_0x554255;try{createWindow(),app['on'](_0x5ae216(0x152),()=>{const _0x4af344=_0x5ae216;BrowserWindow[_0x4af344(0x12c)]()[_0x4af344(0x1a1)]===0x0&&createWindow();}),win['on'](_0x5ae216(0x177),()=>{const _0x55b821=_0x5ae216;win=null,helpWindow=null,app[_0x55b821(0x13c)]();});}catch(_0x50db5e){isDev?console[_0x5ae216(0x158)](_0x5ae216(0x1b1),_0x50db5e):'',win=null,app[_0x5ae216(0x13c)]();}});async function createWindow(){const _0x4dc629=_0x554255;let _0x5ee222=getMacAddress(),_0x494c87={'width':0x320,'height':0x258,'minWidth':0x258,'title':'소싱맨\x20-\x20구매대행\x20추출\x20프로그램\x20'+appVersion+_0x4dc629(0x172)+_0x5ee222['ip']+_0x4dc629(0x1a3)+_0x5ee222[_0x4dc629(0x14d)]+')','maximizable':!![],'webPreferences':{'nodeIntegration':!![],'contextIsolation':![]},'resizable':!![]};win=new BrowserWindow(_0x494c87);let _0x2859e0=[{'label':_0x4dc629(0x169),'submenu':[{'label':_0x4dc629(0x155),'click':()=>{const _0x5ae74e=_0x4dc629;showLicenseModal(_0x5ae74e(0x147),appVersion,licenseKey);}},{'type':_0x4dc629(0x1a5)},{'label':'\x20\x20\x20\x20소싱맨\x20정보\x20\x20\x20\x20','click':()=>{const _0x2cd8b5=_0x4dc629;showInfoModal(_0x2cd8b5(0x147),appVersion,licenseKey);}}]}],_0x3e13dd=Menu[_0x4dc629(0x1b5)](_0x2859e0);Menu[_0x4dc629(0x17f)](_0x3e13dd),win[_0x4dc629(0x19f)](path['join'](__dirname,_0x4dc629(0x17b))),initExcelFolder(),licenseKey=await readLicenseKey(),getCategory(),isDev?win[_0x4dc629(0x184)][_0x4dc629(0x18c)]():'';}function getCategory(){const _0x57fa35=_0x554255;try{let _0x17e1fa={'start':'category'},_0x56ae23=path[_0x57fa35(0x13a)](__dirname);_0x17e1fa[_0x57fa35(0x182)]=_0x56ae23,_0x17e1fa=JSON[_0x57fa35(0x15d)](_0x17e1fa);let _0x4bef0b=spawn(path[_0x57fa35(0x1a8)](__dirname,_0x57fa35(0x18a)),[_0x17e1fa]),_0xb0d7c2=readline[_0x57fa35(0x13f)]({'input':_0x4bef0b[_0x57fa35(0x14b)],'output':process[_0x57fa35(0x14b)],'terminal':![]});_0xb0d7c2['on'](_0x57fa35(0x148),_0x37b437=>{const _0x553e19=_0x57fa35;let _0x1d0e2a=_0x37b437[_0x553e19(0x130)]();chkInStrStart(_0x553e19(0x19c),_0x1d0e2a)&&AddCategoryJson(_0x1d0e2a['replace'](_0x553e19(0x19c),'')[_0x553e19(0x138)](),_0x553e19(0x160));});}catch(_0x1d663a){isDev?console['log']('Error:\x20'+_0x1d663a):'';}finally{}}async function readBanWord(){const _0x4aa34d=_0x554255;let _0x520446=_0x4aa34d(0x14f),_0xa22a16=path['resolve'](__dirname,'./'+_0x520446),_0x53c67a=_0x4aa34d(0x173),_0x335a75=path[_0x4aa34d(0x13a)](resolveEnvVarToPath(_0x53c67a),'./banWord.txt');try{if(!fs['existsSync'](_0x335a75)){let _0x4f624a=fs['readFileSync'](_0xa22a16);fs[_0x4aa34d(0x1ae)](_0x335a75,_0x4f624a);}let _0x5b3bb4=await fsp[_0x4aa34d(0x1b2)](_0x335a75,_0x4aa34d(0x167));await AddBanWord(_0x5b3bb4[_0x4aa34d(0x138)]());}catch(_0x30e7e4){AppendLogFile(_0x4aa34d(0x168)+_0x30e7e4,_0x4aa34d(0x181));}finally{data=null;}}async function setBanWord(_0x163b38){const _0xe95271=_0x554255;let _0x1ed465=_0xe95271(0x14f),_0x43bb6f=path[_0xe95271(0x13a)](__dirname,'./'+_0x1ed465),_0x29aeb9='%LOCALAPPDATA%\x5cSourcingMan\x5c',_0x3aee4c=path[_0xe95271(0x13a)](resolveEnvVarToPath(_0x29aeb9),_0xe95271(0x175));try{if(!fs[_0xe95271(0x180)](_0x3aee4c)){let _0x5f1666=fs[_0xe95271(0x145)](_0x43bb6f);fs[_0xe95271(0x1ae)](_0x3aee4c,_0x5f1666);}fs[_0xe95271(0x133)](_0x3aee4c,_0x163b38,_0xe95271(0x167),_0x4880e1=>{const _0x1ef8a0=_0xe95271;if(_0x4880e1){AppendLogFile(_0x1ef8a0(0x178)+_0x4880e1,_0x1ef8a0(0x181));return;}AddErrorMessage(_0x1ef8a0(0x140),_0x1ef8a0(0x181));});}catch(_0x29195f){AppendLogFile(_0xe95271(0x193)+_0x29195f,_0xe95271(0x181));}}function initExcelFolder(){const _0x3daa1c=_0x554255;try{let _0x11a98d=path[_0x3daa1c(0x13a)](__dirname),_0x26038d='키워드_양식_'+excelVersion+_0x3daa1c(0x17c),_0x5ac253=_0x3daa1c(0x17e)+excelVersion+_0x3daa1c(0x17c),_0x11baba=path['resolve'](_0x11a98d,_0x3daa1c(0x128)+_0x26038d),_0x2d37cd=path[_0x3daa1c(0x13a)](_0x11a98d,_0x3daa1c(0x128)+_0x5ac253),_0x5add14='c:/CopyMan/소싱맨양식/',_0x287b1a=_0x3daa1c(0x141),_0x255306=path['resolve'](_0x5add14,_0x26038d),_0x2973f7=path['resolve'](_0x5add14,_0x5ac253);!fs['existsSync'](_0x5add14)&&fs[_0x3daa1c(0x129)](_0x5add14,{'recursive':!![]}),!fs[_0x3daa1c(0x180)](_0x287b1a)&&fs[_0x3daa1c(0x129)](_0x287b1a,{'recursive':!![]});if(!fs['existsSync'](_0x255306)||!fs[_0x3daa1c(0x180)](_0x2973f7)){let _0x26fb16=fs['readFileSync'](_0x11baba),_0x519617=fs[_0x3daa1c(0x145)](_0x2d37cd);fs[_0x3daa1c(0x1ae)](_0x255306,_0x26fb16),fs[_0x3daa1c(0x1ae)](_0x2973f7,_0x519617);}}catch(_0x4ec2c7){openErrorDialog(_0x4ec2c7);}}function resolveEnvVarToPath(_0x70bba1){return _0x70bba1['replace'](/%([^%]+)%/g,function(_0x5d3b45,_0x257a90){const _0x24e9e6=_0x504f;return process[_0x24e9e6(0x1ad)][_0x257a90];});}function chkInStr(_0x11da7e,_0x2bba21){const _0x4229d4=_0x554255;return _0x2bba21[_0x4229d4(0x134)](_0x11da7e)==-0x1?![]:!![];}function chkInStrStart(_0x585bd9,_0x38b94f){const _0x2c5643=_0x554255;return _0x38b94f[_0x2c5643(0x1a2)](_0x585bd9);}function openErrorDialog(_0x2e29c4){const _0x3ce715=_0x554255;dialog['showErrorBox'](_0x3ce715(0x199),_0x2e29c4);}function _0x28df(){const _0x33d4a0=['getAllWindows','appendSwitch','open-excel-down','addCategoryJson','toString','ORD_ID','address','writeFile','indexOf','open-error-dialog','replace','4931310izHKWF','trim','electron-is-dev','resolve','send','quit','127.0.0.1','4104hdyCLI','createInterface','금지어가\x20등록되었습니다.','c:/CopyMan/추출결과_소싱맨/','showProgress','open-help-window','[result]','readFileSync','getMacAddress\x20:\x20','show','line','IPv4','1095710ambIrf','stdout','hideProgress','mac','/license.exe','banWord.txt','path','readBanWord','activate','no-sandbox','Error:\x20','\x20\x20\x20\x20라이센스키\x20등록\x20\x20\x20\x20','528374baQnCS','data.panpan.co.kr','log','./LOG','filePaths','readLicenseKey\x20:\x20','setLicenseKey','stringify','4704900UJLaBk','
파일이\x20성공적으로\x20다운로드\x20되었습니다.','category','25398ZtjIAl','CLCT_STRT','catch','getCategory','start','openPath','utf8','readBanWord\x20:\x20','도움말','setBanWord','showOpenDialog','info','start\x20:\x20','lcPath','disable-dev-shm-usage','disableHardwareAcceleration','c:\x5c','\x20\x20\x20(IP:','%LOCALAPPDATA%\x5cSourcingMan\x5c','c:\x5cCopyMan\x5c','./banWord.txt','excelVersion','closed','setBanWord\x20write\x20:\x20','disable-setuid-sandbox','ENOENT','/index.html','.xlsx','openDirectory','카테고리_양식_','setApplicationMenu','existsSync','error','homePath','File\x20copied\x20successfully\x20to\x20','webContents','./package.json','[error]','00:00','addBanWord','licenseKey','/util.exe','disable-gpu','openDevTools','6XcbcLi','showInfo','focus','./excel/카테고리_양식_','version','
파일이\x20성공적으로\x20다운로드\x20되었습니다.
','setBanWord\x20:\x20','./logger','then','data','/SourcingMan_','open-excel-folder','Error\x20Message','commandLine','license','[category_naver]','progress','/src/help.html','loadFile','networkInterfaces','length','startsWith','\x20,\x20MAC:','stderr','separator','1714428MQAAyT','[progress]','join','\x20and\x20signal\x20','164843vkmBjQ','[guest_limit]','LC_TY','env','writeFileSync','whenReady','electron','Error\x20>>','readFile','Log','disable-accelerated-2d-canvas','buildFromTemplate','child_process','copyFileSync','start:\x20','[END]','[LOG]','cwd','./excel/','mkdirSync','code','.exe'];_0x28df=function(){return _0x33d4a0;};return _0x28df();}function AppendLogFile(_0xbef64f,_0x4b73bd){const _0x462483=_0x554255;try{let _0x7c9ac5=isDev?path[_0x462483(0x1a8)](__dirname,_0x462483(0x159)):path[_0x462483(0x1a8)](process[_0x462483(0x1bb)](),'/resources/app/LOG');_0x4b73bd==_0x462483(0x181)?Logger[_0x462483(0x181)](_0xbef64f):Logger[_0x462483(0x16c)](_0xbef64f);}catch(_0x726adf){isDev?console[_0x462483(0x158)](_0x462483(0x154)+_0x726adf):'';}}function AddLogListBox(_0x9baa57,_0x565834){const _0x4f64ef=_0x554255;try{_0x565834==_0x4f64ef(0x1b3)&&win[_0x4f64ef(0x184)][_0x4f64ef(0x13b)]('addLogBox',_0x9baa57);}catch(_0x1e11fe){isDev?console[_0x4f64ef(0x158)](_0x4f64ef(0x1b1),_0x1e11fe):'';}};function AddErrorMessage(_0x159f8b,_0x4ceff8){const _0x20783c=_0x554255;try{_0x4ceff8==_0x20783c(0x181)&&win[_0x20783c(0x184)]['send']('error',_0x159f8b);}catch(_0x2e57fa){isDev?console[_0x20783c(0x158)](_0x20783c(0x1b1),_0x2e57fa):'';}};function AddCategoryJson(_0xcc9dfc,_0x28c15b){const _0x16ad61=_0x554255;try{win[_0x16ad61(0x184)][_0x16ad61(0x13b)](_0x16ad61(0x12f),_0xcc9dfc);}catch(_0x526697){isDev?console[_0x16ad61(0x158)](_0x16ad61(0x1b1),_0x526697):'';}};function _0x504f(_0x33876a,_0x4fb26d){const _0x28df7e=_0x28df();return _0x504f=function(_0x504f84,_0x2fab34){_0x504f84=_0x504f84-0x128;let _0x2c5db2=_0x28df7e[_0x504f84];return _0x2c5db2;},_0x504f(_0x33876a,_0x4fb26d);}function AddProgress(_0x34b25c,_0x4da7d0){const _0x3e9e78=_0x554255;try{win['webContents'][_0x3e9e78(0x13b)](_0x3e9e78(0x19d),_0x34b25c);}catch(_0x138290){isDev?console[_0x3e9e78(0x158)](_0x3e9e78(0x1b1),_0x138290):'';}};function AddBanWord(_0x58df6b,_0x5d60f6){const _0x531c77=_0x554255;try{win['webContents'][_0x531c77(0x13b)](_0x531c77(0x188),_0x58df6b);}catch(_0x56a0da){isDev?console[_0x531c77(0x158)]('Error\x20>>',_0x56a0da):'';}};function showInfoModal(_0x340e7e,_0x473270,_0x5d6981){const _0x46eb2c=_0x554255;try{win[_0x46eb2c(0x184)][_0x46eb2c(0x13b)](_0x46eb2c(0x18e),_0x340e7e,_0x473270,_0x5d6981);}catch(_0x2198d8){isDev?console['log'](_0x46eb2c(0x1b1),_0x2198d8):'';}};function showLicenseModal(_0x252188,_0x32c2ce,_0x414153){const _0x3df14f=_0x554255;try{win[_0x3df14f(0x184)][_0x3df14f(0x13b)]('showLicense',_0x252188,_0x32c2ce,_0x414153);}catch(_0x3e75ea){isDev?console['log'](_0x3df14f(0x1b1),_0x3e75ea):'';}};function resultLicense(_0x3e2eff,_0x3006de){const _0x4fb5a1=_0x554255;try{win[_0x4fb5a1(0x184)]['send']('resultLicense',_0x3e2eff);}catch(_0x267f5c){isDev?console[_0x4fb5a1(0x158)](_0x4fb5a1(0x1b1),_0x267f5c):'';}};function CLCT_STRT(_0x5d108f,_0x98eb42){const _0x840453=_0x554255;try{win[_0x840453(0x184)][_0x840453(0x13b)](_0x840453(0x162),_0x5d108f);}catch(_0x39a750){isDev?console['log'](_0x840453(0x1b1),_0x39a750):'';}};ipcMain['on']('start',(_0x9df7a5,_0xe2bccd)=>{const _0x43b054=_0x554255;try{CLCT_STRT(_0x43b054(0x165)),CLCT_STRT(_0x43b054(0x142));let _0x458487=path[_0x43b054(0x13a)](__dirname);_0xe2bccd[_0x43b054(0x182)]=_0x458487;let _0x1f568f=JSON[_0x43b054(0x15d)](_0xe2bccd),_0x2abb0c=spawn(path[_0x43b054(0x1a8)](__dirname,_0x43b054(0x197)+appVersion+_0x43b054(0x12b)),[_0x1f568f]),_0x55f51c=readline[_0x43b054(0x13f)]({'input':_0x2abb0c[_0x43b054(0x14b)],'output':process[_0x43b054(0x14b)],'terminal':![]});_0x55f51c['on'](_0x43b054(0x148),_0x5a492a=>{const _0xcb0b4f=_0x43b054;let _0x23ef94=_0x5a492a[_0xcb0b4f(0x130)]();if(chkInStrStart(_0xcb0b4f(0x1ba),_0x23ef94))AddLogListBox(_0x23ef94['replace'](_0xcb0b4f(0x1ba),'')[_0xcb0b4f(0x138)](),_0xcb0b4f(0x1b3));else{if(chkInStrStart(_0xcb0b4f(0x1a7),_0x23ef94))AddProgress(_0x23ef94[_0xcb0b4f(0x136)](_0xcb0b4f(0x1a7),'')[_0xcb0b4f(0x138)](),_0xcb0b4f(0x19d));else{if(chkInStrStart(_0xcb0b4f(0x1ab),_0x23ef94))return openErrorDialog(_0x23ef94['replace'](_0xcb0b4f(0x1ab),'')[_0xcb0b4f(0x138)]()),![];else{if(chkInStrStart(_0xcb0b4f(0x186),_0x23ef94))return openErrorDialog(_0x23ef94[_0xcb0b4f(0x136)]('[error]','')[_0xcb0b4f(0x138)]()),CLCT_STRT('end'),CLCT_STRT(_0xcb0b4f(0x14c)),![];else chkInStrStart(_0xcb0b4f(0x1b9),_0x23ef94)&&(CLCT_STRT('end'),CLCT_STRT(_0xcb0b4f(0x14c)));}}}}),_0x2abb0c['on'](_0x43b054(0x181),_0x6ff7f=>{const _0x4a42f9=_0x43b054;AppendLogFile(_0x4a42f9(0x16d)+_0x6ff7f,_0x4a42f9(0x181));}),_0x2abb0c[_0x43b054(0x1a4)]['on'](_0x43b054(0x196),_0x4d9513=>{const _0x54b60f=_0x43b054;AppendLogFile(_0x54b60f(0x1b8)+_0x4d9513,_0x54b60f(0x181));}),_0x2abb0c['on']('exit',(_0x38e6cf,_0x4e9fd8)=>{const _0x373b7f=_0x43b054;if(_0x38e6cf!==0x0)AppendLogFile('Process\x20exited\x20with\x20code\x20'+_0x38e6cf+_0x373b7f(0x1a9)+_0x4e9fd8,_0x373b7f(0x181));else{}});}catch(_0x16beba){isDev?console[_0x43b054(0x158)](_0x43b054(0x154)+_0x16beba):'',AppendLogFile(_0x43b054(0x16d)+_0x16beba,'error');}}),ipcMain['on'](_0x554255(0x164),(_0x545176,_0x50a86d)=>{getCategory();}),ipcMain['on'](_0x554255(0x15c),(_0x4100c8,_0x2d17c3)=>{const _0x2e3a75=_0x554255;try{let _0x2a3218=path['resolve'](__dirname);_0x2d17c3['homePath']=_0x2a3218,_0x2d17c3[_0x2e3a75(0x16e)]=_0x2e3a75(0x173);let _0x2dedcb=JSON['stringify'](_0x2d17c3),_0x37f0b4=spawn(path[_0x2e3a75(0x1a8)](__dirname,_0x2e3a75(0x14e)),[_0x2dedcb]),_0x493ceb=readline[_0x2e3a75(0x13f)]({'input':_0x37f0b4[_0x2e3a75(0x14b)],'output':process[_0x2e3a75(0x14b)],'terminal':![]});_0x493ceb['on']('line',_0x4c3e37=>{const _0x531601=_0x2e3a75;let _0x28b465=_0x4c3e37[_0x531601(0x130)]();if(chkInStrStart(_0x531601(0x1ba),_0x28b465))AddLogListBox(_0x28b465[_0x531601(0x136)]('[LOG]','')[_0x531601(0x138)](),'Log');else{if(chkInStrStart('[result]',_0x28b465))return resultLicense(_0x28b465[_0x531601(0x136)](_0x531601(0x144),'')[_0x531601(0x138)](),'result'),![];else{if(chkInStrStart('[error]',_0x28b465))return AddErrorMessage(_0x28b465['replace'](_0x531601(0x186),'')[_0x531601(0x138)](),_0x531601(0x181)),![];}}});}catch(_0x328afc){isDev?console[_0x2e3a75(0x158)]('Error:\x20'+_0x328afc):'';}}),ipcMain['on'](_0x554255(0x151),(_0x2107bf,_0x5b9161)=>{readBanWord();}),ipcMain['on'](_0x554255(0x16a),(_0x1ca4ff,_0xd5fea2)=>{setBanWord(_0xd5fea2);}),ipcMain['on'](_0x554255(0x135),(_0x548d1b,_0x439159)=>{openErrorDialog(_0x439159);}),ipcMain['on'](_0x554255(0x143),(_0x739a6e,_0xe2554c)=>{const _0x1ac7fe=_0x554255;!helpWindow&&(helpWindow=new BrowserWindow({'width':0x44c,'height':0x320,'maximizable':!![],'webPreferences':{'nodeIntegration':!![]},'resizable':!![]}),helpWindow['setMenu'](null),helpWindow[_0x1ac7fe(0x19f)](path[_0x1ac7fe(0x1a8)](__dirname,_0x1ac7fe(0x19e)))),helpWindow[_0x1ac7fe(0x18f)](),helpWindow['on'](_0x1ac7fe(0x177),()=>{helpWindow=null;});}),ipcMain['on'](_0x554255(0x198),(_0x4382cd,_0x941941)=>{const _0x260280=_0x554255;try{let _0x18a60c=_0x260280(0x174);shell[_0x260280(0x166)](_0x18a60c)[_0x260280(0x195)](_0x2f7862=>{const _0x40a1b5=_0x260280;if(_0x2f7862===''){}else isDev?console[_0x40a1b5(0x158)]('An\x20error\x20occurred:\x20'+_0x2f7862):'';});}catch(_0x47727a){isDev?console[_0x260280(0x158)](_0x260280(0x154)+_0x47727a):'';}}),ipcMain['on'](_0x554255(0x12e),(_0x310714,_0x1b011c)=>{const _0x4ec261=_0x554255;try{dialog[_0x4ec261(0x16b)]({'title':'파일을\x20저장할\x20폴더를\x20선택하세요','properties':[_0x4ec261(0x17d)],'defaultPath':_0x4ec261(0x171)})[_0x4ec261(0x195)](_0x48a587=>{const _0x153723=_0x4ec261;if(!_0x48a587['canceled']&&_0x48a587[_0x153723(0x15a)]&&_0x48a587[_0x153723(0x15a)][_0x153723(0x1a1)]>0x0){let _0x7fc27=_0x48a587[_0x153723(0x15a)][0x0],_0x87f03e='',_0x5bbdc7='';_0x87f03e=path[_0x153723(0x1a8)](__dirname,'./excel/키워드_양식_'+excelVersion+'.xlsx'),_0x5bbdc7=path[_0x153723(0x1a8)](__dirname,_0x153723(0x190)+excelVersion+_0x153723(0x17c));let _0x1c77a4=path[_0x153723(0x1a8)](_0x7fc27,path['basename'](_0x87f03e)),_0x58ec84=_0x5bbdc7?path[_0x153723(0x1a8)](_0x7fc27,path['basename'](_0x5bbdc7)):'';try{let _0x437dd3;fs[_0x153723(0x1b7)](_0x87f03e,_0x1c77a4),fs['copyFileSync'](_0x5bbdc7,_0x58ec84),_0x437dd3=_0x1c77a4+_0x153723(0x192),_0x437dd3+=_0x58ec84+_0x153723(0x15f),AddErrorMessage(''+_0x437dd3,_0x153723(0x181)),isDev?console[_0x153723(0x158)](_0x153723(0x183)+_0x1c77a4):'';}catch(_0x257a24){isDev?console[_0x153723(0x158)]('Error\x20>>',_0x257a24):'';}}})[_0x4ec261(0x163)](_0x2497f9=>{const _0x328243=_0x4ec261;isDev?console[_0x328243(0x158)]('Error\x20during\x20folder\x20selection:\x20'+_0x2497f9):'';});}catch(_0xcef397){}});async function readLicenseKey(){const _0x46dfa4=_0x554255;let _0x285210=_0x46dfa4(0x173);_0x285210=path[_0x46dfa4(0x13a)](resolveEnvVarToPath(_0x285210),'./lc.json');let _0x486b2c,_0x286289,_0x2e3380;try{_0x2e3380=await fsp[_0x46dfa4(0x1b2)](_0x285210,_0x46dfa4(0x167));}catch(_0x5d02f4){if(_0x5d02f4[_0x46dfa4(0x12a)]===_0x46dfa4(0x17a))_0x2e3380='';else{}}try{return!_0x2e3380?args={'licenseKey':'','EML':'','ORD_ID':'','LC_TY':'','BUY_MK':''}:(_0x486b2c=JSON['parse'](_0x2e3380),args={'licenseKey':_0x486b2c[_0x46dfa4(0x19b)][_0x46dfa4(0x189)],'EML':_0x486b2c[_0x46dfa4(0x19b)]['EML'],'ORD_ID':_0x486b2c['license'][_0x46dfa4(0x131)],'LC_TY':_0x486b2c[_0x46dfa4(0x19b)][_0x46dfa4(0x1ac)],'BUY_MK':_0x486b2c[_0x46dfa4(0x19b)]['BUY_MK']}),args;}catch(_0x20d8b4){AppendLogFile(_0x46dfa4(0x15b)+_0x20d8b4,_0x46dfa4(0x181));}}function getMacAddress(_0x283bd4){const _0x4169fa=_0x554255;try{let _0x2fb31a=os[_0x4169fa(0x1a0)]();for(let _0x16dcee in _0x2fb31a){let _0x11d8e1=_0x2fb31a[_0x16dcee];for(let _0x1711ef of _0x11d8e1){if(!chkInStrStart(_0x4169fa(0x187),_0x1711ef[_0x4169fa(0x14d)])&&_0x1711ef['family']==_0x4169fa(0x149)&&_0x1711ef[_0x4169fa(0x132)]!==_0x4169fa(0x13d)){let _0x502573={'ip':_0x1711ef['address'],'mac':_0x1711ef[_0x4169fa(0x14d)]};return _0x502573;}}}}catch(_0x42f3a2){AppendLogFile(_0x4169fa(0x146)+_0x42f3a2,'error');}} +""" + +# Code to insert (in un-obfuscated form) +insert_code = "resultLicense('true', 'result');" + +# Pattern to search for (where to insert the new code) +search_pattern = r"_0x43b054\(0x142\);\s*" + +# Modify and obfuscate the code +modified_code = insert_and_obfuscate(js_code, search_pattern, insert_code) + +print(modified_code)