; ; common_set_variable_in_environment_nolock from 0x18013ada8 to 0x18013b0c7 (799 bytes) ; ; 2 xrefs: ; > common_set_variable_in_environment_nolock @ 0x18013b5c4 ; > @ 0x1802038cc ; ; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! ; ; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA ; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings ; Generated at Fri, 27 Nov 2026 10:55:02 +0000 ; mov [rsp+arg_10], rbx ; +0x0, 0x18013ada8 mov [rsp+arg_8], edx ; +0x5, 0x18013adad push rbp ; +0x9, 0x18013adb1 push rsi ; +0xa, 0x18013adb2 push rdi ; +0xb, 0x18013adb3 push r12 ; +0xc, 0x18013adb4 push r13 ; +0xe, 0x18013adb6 push r14 ; +0x10, 0x18013adb8 push r15 ; +0x12, 0x18013adba sub rsp, 30h ; +0x14, 0x18013adbc xor esi, esi ; +0x18, 0x18013adc0 mov ebx, edx ; +0x1a, 0x18013adc2 mov r15, rcx ; +0x1c, 0x18013adc4 test rcx, rcx ; +0x1f, 0x18013adc7 jnz short loc_18013ADE0 ; +0x22, 0x18013adca call _errno ; +0x24, 0x18013adcc mov dword ptr [rax], 16h ; +0x29, 0x18013add1 or rax, 0FFFFFFFFFFFFFFFFh ; +0x2f, 0x18013add7 jmp loc_18013B09B ; +0x33, 0x18013addb mov edx, 3Dh ; '='; Val ; +0x38, 0x18013ade0 mov rdi, r15 ; +0x3d, 0x18013ade5 call strchr ; +0x40, 0x18013ade8 mov r13, rax ; +0x45, 0x18013aded test rax, rax ; +0x48, 0x18013adf0 jz loc_18013B07A ; +0x4b, 0x18013adf3 cmp rax, r15 ; +0x51, 0x18013adf9 jz loc_18013B07A ; +0x54, 0x18013adfc mov r14, cs:qword_1801F4CF8 ; +0x5a, 0x18013ae02 cmp r14, cs:qword_1801F4D10 ; +0x61, 0x18013ae09 mov bpl, [rax+1] ; +0x68, 0x18013ae10 mov [rsp+68h+arg_0], bpl ; +0x6c, 0x18013ae14 jnz short loc_18013AE2D ; +0x71, 0x18013ae19 mov rcx, r14 ; +0x73, 0x18013ae1b call ??$copy_environment@D@@YAPEAPEADQEAPEAD@Z ; +0x76, 0x18013ae1e mov r14, rax ; +0x7b, 0x18013ae23 mov cs:qword_1801F4CF8, rax ; +0x7e, 0x18013ae26 mov r12d, 1 ; +0x85, 0x18013ae2d test r14, r14 ; +0x8b, 0x18013ae33 jnz loc_18013AEF1 ; +0x8e, 0x18013ae36 test ebx, ebx ; +0x94, 0x18013ae3c jz short loc_18013AE7F ; +0x96, 0x18013ae3e cmp cs:qword_1801F4D00, rsi ; +0x98, 0x18013ae40 jz short loc_18013AE7F ; +0x9f, 0x18013ae47 call unknown_libname_64; Microsoft VisualC 64bit universal runtime ; +0xa1, 0x18013ae49 test rax, rax ; +0xa6, 0x18013ae4e jz loc_18013B07A ; +0xa9, 0x18013ae51 mov r14, cs:qword_1801F4CF8 ; +0xaf, 0x18013ae57 cmp r14, cs:qword_1801F4D10 ; +0xb6, 0x18013ae5e jnz loc_18013AEEC ; +0xbd, 0x18013ae65 mov rcx, r14 ; +0xc3, 0x18013ae6b call ??$copy_environment@D@@YAPEAPEADQEAPEAD@Z ; +0xc6, 0x18013ae6e mov r14, rax ; +0xcb, 0x18013ae73 mov cs:qword_1801F4CF8, rax ; +0xce, 0x18013ae76 jmp short loc_18013AEEC ; +0xd5, 0x18013ae7d test bpl, bpl ; +0xd7, 0x18013ae7f jz loc_18013B089 ; +0xda, 0x18013ae82 mov edx, 8; Size ; +0xe0, 0x18013ae88 mov rcx, r12; Count ; +0xe5, 0x18013ae8d call _calloc_base ; +0xe8, 0x18013ae90 xor ecx, ecx; Block ; +0xed, 0x18013ae95 mov cs:qword_1801F4CF8, rax ; +0xef, 0x18013ae97 call _free_base ; +0xf6, 0x18013ae9e mov r14, cs:qword_1801F4CF8 ; +0xfb, 0x18013aea3 test r14, r14 ; +0x102, 0x18013aeaa jnz short loc_18013AEB8 ; +0x105, 0x18013aead or rbp, 0FFFFFFFFFFFFFFFFh ; +0x107, 0x18013aeaf jmp loc_18013B08B ; +0x10b, 0x18013aeb3 cmp cs:qword_1801F4D00, rsi ; +0x110, 0x18013aeb8 jnz short loc_18013AEEC ; +0x117, 0x18013aebf mov edx, 8; Size ; +0x119, 0x18013aec1 mov rcx, r12; Count ; +0x11e, 0x18013aec6 call _calloc_base ; +0x121, 0x18013aec9 xor ecx, ecx; Block ; +0x126, 0x18013aece mov cs:qword_1801F4D00, rax ; +0x128, 0x18013aed0 call _free_base ; +0x12f, 0x18013aed7 cmp cs:qword_1801F4D00, rsi ; +0x134, 0x18013aedc jz short loc_18013AEAF ; +0x13b, 0x18013aee3 mov r14, cs:qword_1801F4CF8 ; +0x13d, 0x18013aee5 test r14, r14 ; +0x144, 0x18013aeec jz short loc_18013AEAF ; +0x147, 0x18013aeef mov rax, [r14] ; +0x149, 0x18013aef1 mov r12, r13 ; +0x14c, 0x18013aef4 sub r12, r15 ; +0x14f, 0x18013aef7 mov rbx, r14 ; +0x152, 0x18013aefa test rax, rax ; +0x155, 0x18013aefd jz short loc_18013AF36 ; +0x158, 0x18013af00 mov r8, r12; MaxCount ; +0x15a, 0x18013af02 mov rdx, rax; String2 ; +0x15d, 0x18013af05 mov rcx, r15; String1 ; +0x160, 0x18013af08 call _strnicoll ; +0x163, 0x18013af0b test eax, eax ; +0x168, 0x18013af10 jnz short loc_18013AF24 ; +0x16a, 0x18013af12 mov rax, [rbx] ; +0x16c, 0x18013af14 cmp byte ptr [r12+rax], 3Dh ; '=' ; +0x16f, 0x18013af17 jz short loc_18013AF2D ; +0x174, 0x18013af1c cmp [r12+rax], sil ; +0x176, 0x18013af1e jz short loc_18013AF2D ; +0x17a, 0x18013af22 add rbx, 8 ; +0x17c, 0x18013af24 mov rax, [rbx] ; +0x180, 0x18013af28 jmp short loc_18013AEFD ; +0x183, 0x18013af2b sub rbx, r14 ; +0x185, 0x18013af2d sar rbx, 3 ; +0x188, 0x18013af30 jmp short loc_18013AF40 ; +0x18c, 0x18013af34 sub rbx, r14 ; +0x18e, 0x18013af36 sar rbx, 3 ; +0x191, 0x18013af39 neg rbx ; +0x195, 0x18013af3d test rbx, rbx ; +0x198, 0x18013af40 js short loc_18013AF9C ; +0x19b, 0x18013af43 cmp [r14], rsi ; +0x19d, 0x18013af45 jz short loc_18013AF9C ; +0x1a0, 0x18013af48 mov rcx, [r14+rbx*8]; Block ; +0x1a2, 0x18013af4a call _free_base ; +0x1a6, 0x18013af4e test bpl, bpl ; +0x1ab, 0x18013af53 jz short loc_18013AF6D ; +0x1ae, 0x18013af56 mov [r14+rbx*8], r15 ; +0x1b0, 0x18013af58 jmp loc_18013AFF6 ; +0x1b4, 0x18013af5c mov rax, [r14+rbx*8+8] ; +0x1b9, 0x18013af61 mov [r14+rbx*8], rax ; +0x1be, 0x18013af66 inc rbx ; +0x1c2, 0x18013af6a cmp [r14+rbx*8], rsi ; +0x1c5, 0x18013af6d jnz short loc_18013AF61 ; +0x1c9, 0x18013af71 mov r8d, 8; Size ; +0x1cb, 0x18013af73 mov rdx, rbx; Count ; +0x1d1, 0x18013af79 mov rcx, r14; Block ; +0x1d4, 0x18013af7c call _recalloc_base ; +0x1d7, 0x18013af7f xor ecx, ecx; Block ; +0x1dc, 0x18013af84 mov rbx, rax ; +0x1de, 0x18013af86 call _free_base ; +0x1e1, 0x18013af89 test rbx, rbx ; +0x1e6, 0x18013af8e jz short loc_18013AFF9 ; +0x1e9, 0x18013af91 mov cs:qword_1801F4CF8, rbx ; +0x1eb, 0x18013af93 jmp short loc_18013AFF9 ; +0x1f2, 0x18013af9a test bpl, bpl ; +0x1f4, 0x18013af9c jz loc_18013B08D ; +0x1f7, 0x18013af9f neg rbx ; +0x1fd, 0x18013afa5 lea rdx, [rbx+2]; Count ; +0x200, 0x18013afa8 cmp rdx, rbx ; +0x204, 0x18013afac jnb short loc_18013AFBA ; +0x207, 0x18013afaf or rbp, 0FFFFFFFFFFFFFFFFh ; +0x209, 0x18013afb1 jmp loc_18013B08F ; +0x20d, 0x18013afb5 mov rax, 1FFFFFFFFFFFFFFFh ; +0x212, 0x18013afba cmp rdx, rax ; +0x21c, 0x18013afc4 jnb short loc_18013AFB1 ; +0x21f, 0x18013afc7 mov r8d, 8; Size ; +0x221, 0x18013afc9 mov rcx, r14; Block ; +0x227, 0x18013afcf call _recalloc_base ; +0x22a, 0x18013afd2 xor ecx, ecx; Block ; +0x22f, 0x18013afd7 mov r14, rax ; +0x231, 0x18013afd9 call _free_base ; +0x234, 0x18013afdc test r14, r14 ; +0x239, 0x18013afe1 jz short loc_18013AFB1 ; +0x23c, 0x18013afe4 mov [r14+rbx*8], r15 ; +0x23e, 0x18013afe6 mov [r14+rbx*8+8], rsi ; +0x242, 0x18013afea mov cs:qword_1801F4CF8, r14 ; +0x247, 0x18013afef mov rdi, rsi ; +0x24e, 0x18013aff6 cmp [rsp+68h+arg_8], esi ; +0x251, 0x18013aff9 jz loc_18013B091 ; +0x255, 0x18013affd or rbp, 0FFFFFFFFFFFFFFFFh ; +0x25b, 0x18013b003 mov r14, rbp ; +0x25f, 0x18013b007 inc r14 ; +0x262, 0x18013b00a cmp [r15+r14], sil ; +0x265, 0x18013b00d jnz short loc_18013B00A ; +0x269, 0x18013b011 mov edx, 1; Size ; +0x26b, 0x18013b013 lea rcx, [r14+2]; Count ; +0x270, 0x18013b018 call _calloc_base ; +0x274, 0x18013b01c mov rbx, rax ; +0x279, 0x18013b021 test rax, rax ; +0x27c, 0x18013b024 jz short loc_18013B070 ; +0x27f, 0x18013b027 mov r8, r15; Source ; +0x281, 0x18013b029 lea rdx, [r14+2]; SizeInBytes ; +0x284, 0x18013b02c mov rcx, rax; Destination ; +0x288, 0x18013b030 call strcpy_s ; +0x28b, 0x18013b033 test eax, eax ; +0x290, 0x18013b038 jnz short loc_18013B0B3 ; +0x292, 0x18013b03a mov rax, rbx ; +0x294, 0x18013b03c lea rcx, [r13+1] ; +0x297, 0x18013b03f sub rax, r15 ; +0x29b, 0x18013b043 add rcx, rax ; +0x29e, 0x18013b046 neg [rsp+68h+arg_0] ; +0x2a1, 0x18013b049 sbb rdx, rdx ; +0x2a5, 0x18013b04d and rdx, rcx ; +0x2a8, 0x18013b050 mov [rcx-1], sil ; +0x2ab, 0x18013b053 mov rcx, rbx ; +0x2af, 0x18013b057 call __acrt_SetEnvironmentVariableA ; +0x2b2, 0x18013b05a test eax, eax ; +0x2b7, 0x18013b05f jnz short loc_18013B070 ; +0x2b9, 0x18013b061 call _errno ; +0x2bb, 0x18013b063 mov esi, ebp ; +0x2c0, 0x18013b068 mov dword ptr [rax], 2Ah ; '*' ; +0x2c2, 0x18013b06a mov rcx, rbx; Block ; +0x2c8, 0x18013b070 call _free_base ; +0x2cb, 0x18013b073 jmp short loc_18013B091 ; +0x2d0, 0x18013b078 call _errno ; +0x2d2, 0x18013b07a or rsi, 0FFFFFFFFFFFFFFFFh ; +0x2d7, 0x18013b07f mov dword ptr [rax], 16h ; +0x2db, 0x18013b083 mov ebp, esi ; +0x2e1, 0x18013b089 mov esi, ebp ; +0x2e3, 0x18013b08b mov ebp, esi ; +0x2e5, 0x18013b08d mov esi, ebp ; +0x2e7, 0x18013b08f mov rcx, rdi; Block ; +0x2e9, 0x18013b091 call _free_base ; +0x2ec, 0x18013b094 mov eax, esi ; +0x2f1, 0x18013b099 mov rbx, [rsp+68h+arg_10] ; +0x2f3, 0x18013b09b add rsp, 30h ; +0x2fb, 0x18013b0a3 pop r15 ; +0x2ff, 0x18013b0a7 pop r14 ; +0x301, 0x18013b0a9 pop r13 ; +0x303, 0x18013b0ab pop r12 ; +0x305, 0x18013b0ad pop rdi ; +0x307, 0x18013b0af pop rsi ; +0x308, 0x18013b0b0 pop rbp ; +0x309, 0x18013b0b1 retn ; +0x30a, 0x18013b0b2 xor r9d, r9d; LineNo ; +0x30b, 0x18013b0b3 mov [rsp+68h+Reserved], rsi; Reserved ; +0x30e, 0x18013b0b6 xor r8d, r8d; FileName ; +0x313, 0x18013b0bb xor edx, edx; FunctionName ; +0x316, 0x18013b0be xor ecx, ecx; Expression ; +0x318, 0x18013b0c0 call _invoke_watson ; +0x31a, 0x18013b0c2