; ; cocos2d::CCImage::_saveImageToJPG from 0x18007bb90 to 0x18007be2a (666 bytes) ; ; 6 xrefs: ; > @ 0x18013c0c4 ; > @ 0x18013c0f8 ; > @ 0x18013c110 ; > @ 0x18013c124 ; > @ 0x1801438a8 ; > @ 0x1801b4da0 ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; push rbp ; +0x0, 0x18007bb90 push rbx ; +0x2, 0x18007bb92 push rdi ; +0x3, 0x18007bb93 lea rbp, [rsp-1F0h] ; +0x4, 0x18007bb94 sub rsp, 2F0h ; +0xc, 0x18007bb9c mov rax, cs:__security_cookie ; +0x13, 0x18007bba3 xor rax, rsp ; +0x1a, 0x18007bbaa mov [rbp+200h+var_20], rax ; +0x1d, 0x18007bbad mov rdi, rdx ; +0x24, 0x18007bbb4 mov rbx, rcx ; +0x27, 0x18007bbb7 test rdx, rdx ; +0x2a, 0x18007bbba jz loc_18007BE23 ; +0x2d, 0x18007bbbd lea rcx, [rbp+200h+var_D0] ; +0x33, 0x18007bbc3 mov [rsp+300h+arg_18], r14 ; +0x3a, 0x18007bbca call jpeg62_89 ; +0x42, 0x18007bbd2 mov edx, 3Eh ; '>' ; +0x47, 0x18007bbd7 mov [rsp+300h+var_2D0], rax ; +0x4c, 0x18007bbdc mov r8d, 1F8h ; +0x51, 0x18007bbe1 lea rcx, [rsp+300h+var_2D0] ; +0x57, 0x18007bbe7 call jpeg62_30 ; +0x5c, 0x18007bbec lea rdx, Mode; "wb" ; +0x61, 0x18007bbf1 mov rcx, rdi; FileName ; +0x68, 0x18007bbf8 call cs:fopen ; +0x6b, 0x18007bbfb mov r14, rax ; +0x71, 0x18007bc01 test rax, rax ; +0x74, 0x18007bc04 jz loc_18007BE1E ; +0x77, 0x18007bc07 mov rdx, rax ; +0x7d, 0x18007bc0d mov [rsp+300h+arg_10], rsi ; +0x80, 0x18007bc10 lea rcx, [rsp+300h+var_2D0] ; +0x88, 0x18007bc18 call jpeg62_90 ; +0x8d, 0x18007bc1d movzx eax, word ptr [rbx+38h] ; +0x92, 0x18007bc22 lea rcx, [rsp+300h+var_2D0] ; +0x96, 0x18007bc26 mov [rsp+300h+var_2A0], eax ; +0x9b, 0x18007bc2b movzx eax, word ptr [rbx+3Ah] ; +0x9f, 0x18007bc2f mov [rsp+300h+var_29C], eax ; +0xa3, 0x18007bc33 mov [rsp+300h+var_298], 3 ; +0xa7, 0x18007bc37 mov [rsp+300h+var_294], 2 ; +0xaf, 0x18007bc3f call jpeg62_81 ; +0xb7, 0x18007bc47 mov dl, 1 ; +0xbc, 0x18007bc4c lea rcx, [rsp+300h+var_2D0] ; +0xbe, 0x18007bc4e call jpeg62_86 ; +0xc3, 0x18007bc53 cmp byte ptr [rbx+48h], 0 ; +0xc8, 0x18007bc58 movzx eax, word ptr [rbx+38h] ; +0xcc, 0x18007bc5c lea esi, [rax+rax*2] ; +0xd0, 0x18007bc60 jz loc_18007BDC4 ; +0xd3, 0x18007bc63 movzx ecx, word ptr [rbx+3Ah] ; +0xd9, 0x18007bc69 imul ecx, eax ; +0xdd, 0x18007bc6d lea ecx, [rcx+rcx*2] ; +0xe0, 0x18007bc70 movsxd rcx, ecx; Size ; +0xe3, 0x18007bc73 call j_??2@YAPEAX_K@Z; operator new(unsigned __int64) ; +0xe6, 0x18007bc76 mov rdi, rax ; +0xeb, 0x18007bc7b test rax, rax ; +0xee, 0x18007bc7e jnz short loc_18007BCCC ; +0xf1, 0x18007bc81 lea rcx, [rsp+300h+var_2D0] ; +0xf3, 0x18007bc83 call jpeg62_49 ; +0xf8, 0x18007bc88 lea rcx, [rsp+300h+var_2D0] ; +0xfd, 0x18007bc8d call jpeg62_43 ; +0x102, 0x18007bc92 mov rcx, r14; Stream ; +0x107, 0x18007bc97 call cs:fclose ; +0x10a, 0x18007bc9a xor al, al ; +0x110, 0x18007bca0 mov rsi, [rsp+300h+arg_10] ; +0x112, 0x18007bca2 mov r14, [rsp+300h+arg_18] ; +0x11a, 0x18007bcaa mov rcx, [rbp+200h+var_20] ; +0x122, 0x18007bcb2 xor rcx, rsp; StackCookie ; +0x129, 0x18007bcb9 call __security_check_cookie ; +0x12c, 0x18007bcbc add rsp, 2F0h ; +0x131, 0x18007bcc1 pop rdi ; +0x138, 0x18007bcc8 pop rbx ; +0x139, 0x18007bcc9 pop rbp ; +0x13a, 0x18007bcca retn ; +0x13b, 0x18007bccb xor r11d, r11d ; +0x13c, 0x18007bccc mov r9d, r11d ; +0x13f, 0x18007bccf cmp r11w, [rbx+3Ah] ; +0x142, 0x18007bcd2 jnb loc_18007BD88 ; +0x147, 0x18007bcd7 movzx ecx, word ptr [rbx+38h] ; +0x14d, 0x18007bcdd mov r10d, r11d ; +0x151, 0x18007bce1 cmp r11w, cx ; +0x154, 0x18007bce4 jnb loc_18007BD78 ; +0x158, 0x18007bce8 xchg ax, ax ; +0x15e, 0x18007bcee mov rdx, [rbx+40h] ; +0x160, 0x18007bcf0 movzx ecx, cx ; +0x164, 0x18007bcf4 imul ecx, r9d ; +0x167, 0x18007bcf7 add ecx, r10d ; +0x16b, 0x18007bcfb lea eax, ds:0[rcx*4] ; +0x16e, 0x18007bcfe movsxd r8, eax ; +0x175, 0x18007bd05 lea eax, [rcx+rcx*2] ; +0x178, 0x18007bd08 movsxd rcx, eax ; +0x17b, 0x18007bd0b movzx eax, byte ptr [r8+rdx] ; +0x17e, 0x18007bd0e mov [rcx+rdi], al ; +0x183, 0x18007bd13 movzx ecx, word ptr [rbx+38h] ; +0x186, 0x18007bd16 mov rdx, [rbx+40h] ; +0x18a, 0x18007bd1a imul ecx, r9d ; +0x18e, 0x18007bd1e add ecx, r10d ; +0x192, 0x18007bd22 lea eax, ds:0[rcx*4] ; +0x195, 0x18007bd25 movsxd r8, eax ; +0x19c, 0x18007bd2c lea eax, [rcx+rcx*2] ; +0x19f, 0x18007bd2f movsxd rcx, eax ; +0x1a2, 0x18007bd32 movzx eax, byte ptr [r8+rdx+1] ; +0x1a5, 0x18007bd35 mov [rcx+rdi+1], al ; +0x1ab, 0x18007bd3b movzx ecx, word ptr [rbx+38h] ; +0x1af, 0x18007bd3f mov rdx, [rbx+40h] ; +0x1b3, 0x18007bd43 imul ecx, r9d ; +0x1b7, 0x18007bd47 add ecx, r10d ; +0x1bb, 0x18007bd4b inc r10d ; +0x1be, 0x18007bd4e lea eax, ds:0[rcx*4] ; +0x1c1, 0x18007bd51 movsxd r8, eax ; +0x1c8, 0x18007bd58 lea eax, [rcx+rcx*2] ; +0x1cb, 0x18007bd5b movsxd rcx, eax ; +0x1ce, 0x18007bd5e movzx eax, byte ptr [r8+rdx+2] ; +0x1d1, 0x18007bd61 mov [rcx+rdi+2], al ; +0x1d7, 0x18007bd67 movzx ecx, word ptr [rbx+38h] ; +0x1db, 0x18007bd6b cmp r10d, ecx ; +0x1df, 0x18007bd6f jl loc_18007BCF0 ; +0x1e2, 0x18007bd72 movzx eax, word ptr [rbx+3Ah] ; +0x1e8, 0x18007bd78 inc r9d ; +0x1ec, 0x18007bd7c cmp r9d, eax ; +0x1ef, 0x18007bd7f jl loc_18007BCE1 ; +0x1f2, 0x18007bd82 mov eax, [rbp+200h+var_1B0] ; +0x1f8, 0x18007bd88 cmp eax, [rsp+300h+var_29C] ; +0x1fb, 0x18007bd8b jnb short loc_18007BDBA ; +0x1ff, 0x18007bd8f imul eax, esi ; +0x201, 0x18007bd91 lea rdx, [rsp+300h+var_2E0] ; +0x204, 0x18007bd94 mov r8d, 1 ; +0x209, 0x18007bd99 lea rcx, [rsp+300h+var_2D0] ; +0x20f, 0x18007bd9f add rax, rdi ; +0x214, 0x18007bda4 mov [rsp+300h+var_2E0], rax ; +0x217, 0x18007bda7 call jpeg62_98 ; +0x21c, 0x18007bdac mov eax, [rbp+200h+var_1B0] ; +0x221, 0x18007bdb1 cmp eax, [rsp+300h+var_29C] ; +0x224, 0x18007bdb4 jb short loc_18007BD91 ; +0x228, 0x18007bdb8 mov rcx, rdi; Block ; +0x22a, 0x18007bdba call j_j_free_0 ; +0x22d, 0x18007bdbd jmp short loc_18007BDFA ; +0x232, 0x18007bdc2 mov eax, [rbp+200h+var_1B0] ; +0x234, 0x18007bdc4 cmp eax, [rsp+300h+var_29C] ; +0x237, 0x18007bdc7 jnb short loc_18007BDFA ; +0x23b, 0x18007bdcb nop dword ptr [rax] ; +0x23d, 0x18007bdcd imul eax, esi ; +0x240, 0x18007bdd0 lea rdx, [rsp+300h+var_2E0] ; +0x243, 0x18007bdd3 mov r8d, 1 ; +0x248, 0x18007bdd8 lea rcx, [rsp+300h+var_2D0] ; +0x24e, 0x18007bdde add rax, [rbx+40h] ; +0x253, 0x18007bde3 mov [rsp+300h+var_2E0], rax ; +0x257, 0x18007bde7 call jpeg62_98 ; +0x25c, 0x18007bdec mov eax, [rbp+200h+var_1B0] ; +0x261, 0x18007bdf1 cmp eax, [rsp+300h+var_29C] ; +0x264, 0x18007bdf4 jb short loc_18007BDD0 ; +0x268, 0x18007bdf8 lea rcx, [rsp+300h+var_2D0] ; +0x26a, 0x18007bdfa call jpeg62_49 ; +0x26f, 0x18007bdff mov rcx, r14; Stream ; +0x274, 0x18007be04 call cs:fclose ; +0x277, 0x18007be07 lea rcx, [rsp+300h+var_2D0] ; +0x27d, 0x18007be0d call jpeg62_43 ; +0x282, 0x18007be12 mov al, 1 ; +0x287, 0x18007be17 jmp loc_18007BCA2 ; +0x289, 0x18007be19 jmp loc_18007BCAA ; +0x28e, 0x18007be1e xor al, al ; +0x293, 0x18007be23 jmp loc_18007BCB2 ; +0x295, 0x18007be25