; ; cocos2d::CCImage::_saveImageToJPG from 0x18007eda0 to 0x18007f03a (666 bytes) ; ; 6 xrefs: ; > @ 0x180145440 ; > @ 0x180145474 ; > @ 0x18014548c ; > @ 0x1801454a0 ; > @ 0x18014cf68 ; > @ 0x1801bf07c ; ; 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 11:22:01 +0000 ; push rbp ; +0x0, 0x18007eda0 push rbx ; +0x2, 0x18007eda2 push rdi ; +0x3, 0x18007eda3 lea rbp, [rsp-1F0h] ; +0x4, 0x18007eda4 sub rsp, 2F0h ; +0xc, 0x18007edac mov rax, cs:__security_cookie ; +0x13, 0x18007edb3 xor rax, rsp ; +0x1a, 0x18007edba mov [rbp+200h+var_20], rax ; +0x1d, 0x18007edbd mov rdi, rdx ; +0x24, 0x18007edc4 mov rbx, rcx ; +0x27, 0x18007edc7 test rdx, rdx ; +0x2a, 0x18007edca jz loc_18007F033 ; +0x2d, 0x18007edcd lea rcx, [rbp+200h+var_D0] ; +0x33, 0x18007edd3 mov [rsp+300h+arg_18], r14 ; +0x3a, 0x18007edda call jpeg62_89 ; +0x42, 0x18007ede2 mov edx, 3Eh ; '>' ; +0x47, 0x18007ede7 mov [rsp+300h+var_2D0], rax ; +0x4c, 0x18007edec mov r8d, 1F8h ; +0x51, 0x18007edf1 lea rcx, [rsp+300h+var_2D0] ; +0x57, 0x18007edf7 call jpeg62_30 ; +0x5c, 0x18007edfc lea rdx, Mode; "wb" ; +0x61, 0x18007ee01 mov rcx, rdi; FileName ; +0x68, 0x18007ee08 call cs:fopen ; +0x6b, 0x18007ee0b mov r14, rax ; +0x71, 0x18007ee11 test rax, rax ; +0x74, 0x18007ee14 jz loc_18007F02E ; +0x77, 0x18007ee17 mov rdx, rax ; +0x7d, 0x18007ee1d mov [rsp+300h+arg_10], rsi ; +0x80, 0x18007ee20 lea rcx, [rsp+300h+var_2D0] ; +0x88, 0x18007ee28 call jpeg62_90 ; +0x8d, 0x18007ee2d movzx eax, word ptr [rbx+38h] ; +0x92, 0x18007ee32 lea rcx, [rsp+300h+var_2D0] ; +0x96, 0x18007ee36 mov [rsp+300h+var_2A0], eax ; +0x9b, 0x18007ee3b movzx eax, word ptr [rbx+3Ah] ; +0x9f, 0x18007ee3f mov [rsp+300h+var_29C], eax ; +0xa3, 0x18007ee43 mov [rsp+300h+var_298], 3 ; +0xa7, 0x18007ee47 mov [rsp+300h+var_294], 2 ; +0xaf, 0x18007ee4f call jpeg62_81 ; +0xb7, 0x18007ee57 mov dl, 1 ; +0xbc, 0x18007ee5c lea rcx, [rsp+300h+var_2D0] ; +0xbe, 0x18007ee5e call jpeg62_86 ; +0xc3, 0x18007ee63 cmp byte ptr [rbx+48h], 0 ; +0xc8, 0x18007ee68 movzx eax, word ptr [rbx+38h] ; +0xcc, 0x18007ee6c lea esi, [rax+rax*2] ; +0xd0, 0x18007ee70 jz loc_18007EFD4 ; +0xd3, 0x18007ee73 movzx ecx, word ptr [rbx+3Ah] ; +0xd9, 0x18007ee79 imul ecx, eax ; +0xdd, 0x18007ee7d lea ecx, [rcx+rcx*2] ; +0xe0, 0x18007ee80 movsxd rcx, ecx; Size ; +0xe3, 0x18007ee83 call sub_1800E4C6C ; +0xe6, 0x18007ee86 mov rdi, rax ; +0xeb, 0x18007ee8b test rax, rax ; +0xee, 0x18007ee8e jnz short loc_18007EEDC ; +0xf1, 0x18007ee91 lea rcx, [rsp+300h+var_2D0] ; +0xf3, 0x18007ee93 call jpeg62_49 ; +0xf8, 0x18007ee98 lea rcx, [rsp+300h+var_2D0] ; +0xfd, 0x18007ee9d call jpeg62_43 ; +0x102, 0x18007eea2 mov rcx, r14; Stream ; +0x107, 0x18007eea7 call cs:fclose ; +0x10a, 0x18007eeaa xor al, al ; +0x110, 0x18007eeb0 mov rsi, [rsp+300h+arg_10] ; +0x112, 0x18007eeb2 mov r14, [rsp+300h+arg_18] ; +0x11a, 0x18007eeba mov rcx, [rbp+200h+var_20] ; +0x122, 0x18007eec2 xor rcx, rsp; StackCookie ; +0x129, 0x18007eec9 call __security_check_cookie ; +0x12c, 0x18007eecc add rsp, 2F0h ; +0x131, 0x18007eed1 pop rdi ; +0x138, 0x18007eed8 pop rbx ; +0x139, 0x18007eed9 pop rbp ; +0x13a, 0x18007eeda retn ; +0x13b, 0x18007eedb xor r11d, r11d ; +0x13c, 0x18007eedc mov r9d, r11d ; +0x13f, 0x18007eedf cmp r11w, [rbx+3Ah] ; +0x142, 0x18007eee2 jnb loc_18007EF98 ; +0x147, 0x18007eee7 movzx ecx, word ptr [rbx+38h] ; +0x14d, 0x18007eeed mov r10d, r11d ; +0x151, 0x18007eef1 cmp r11w, cx ; +0x154, 0x18007eef4 jnb loc_18007EF88 ; +0x158, 0x18007eef8 xchg ax, ax ; +0x15e, 0x18007eefe mov rdx, [rbx+40h] ; +0x160, 0x18007ef00 movzx ecx, cx ; +0x164, 0x18007ef04 imul ecx, r9d ; +0x167, 0x18007ef07 add ecx, r10d ; +0x16b, 0x18007ef0b lea eax, ds:0[rcx*4] ; +0x16e, 0x18007ef0e movsxd r8, eax ; +0x175, 0x18007ef15 lea eax, [rcx+rcx*2] ; +0x178, 0x18007ef18 movsxd rcx, eax ; +0x17b, 0x18007ef1b movzx eax, byte ptr [r8+rdx] ; +0x17e, 0x18007ef1e mov [rcx+rdi], al ; +0x183, 0x18007ef23 movzx ecx, word ptr [rbx+38h] ; +0x186, 0x18007ef26 mov rdx, [rbx+40h] ; +0x18a, 0x18007ef2a imul ecx, r9d ; +0x18e, 0x18007ef2e add ecx, r10d ; +0x192, 0x18007ef32 lea eax, ds:0[rcx*4] ; +0x195, 0x18007ef35 movsxd r8, eax ; +0x19c, 0x18007ef3c lea eax, [rcx+rcx*2] ; +0x19f, 0x18007ef3f movsxd rcx, eax ; +0x1a2, 0x18007ef42 movzx eax, byte ptr [r8+rdx+1] ; +0x1a5, 0x18007ef45 mov [rcx+rdi+1], al ; +0x1ab, 0x18007ef4b movzx ecx, word ptr [rbx+38h] ; +0x1af, 0x18007ef4f mov rdx, [rbx+40h] ; +0x1b3, 0x18007ef53 imul ecx, r9d ; +0x1b7, 0x18007ef57 add ecx, r10d ; +0x1bb, 0x18007ef5b inc r10d ; +0x1be, 0x18007ef5e lea eax, ds:0[rcx*4] ; +0x1c1, 0x18007ef61 movsxd r8, eax ; +0x1c8, 0x18007ef68 lea eax, [rcx+rcx*2] ; +0x1cb, 0x18007ef6b movsxd rcx, eax ; +0x1ce, 0x18007ef6e movzx eax, byte ptr [r8+rdx+2] ; +0x1d1, 0x18007ef71 mov [rcx+rdi+2], al ; +0x1d7, 0x18007ef77 movzx ecx, word ptr [rbx+38h] ; +0x1db, 0x18007ef7b cmp r10d, ecx ; +0x1df, 0x18007ef7f jl loc_18007EF00 ; +0x1e2, 0x18007ef82 movzx eax, word ptr [rbx+3Ah] ; +0x1e8, 0x18007ef88 inc r9d ; +0x1ec, 0x18007ef8c cmp r9d, eax ; +0x1ef, 0x18007ef8f jl loc_18007EEF1 ; +0x1f2, 0x18007ef92 mov eax, [rbp+200h+var_1B0] ; +0x1f8, 0x18007ef98 cmp eax, [rsp+300h+var_29C] ; +0x1fb, 0x18007ef9b jnb short loc_18007EFCA ; +0x1ff, 0x18007ef9f imul eax, esi ; +0x201, 0x18007efa1 lea rdx, [rsp+300h+var_2E0] ; +0x204, 0x18007efa4 mov r8d, 1 ; +0x209, 0x18007efa9 lea rcx, [rsp+300h+var_2D0] ; +0x20f, 0x18007efaf add rax, rdi ; +0x214, 0x18007efb4 mov [rsp+300h+var_2E0], rax ; +0x217, 0x18007efb7 call jpeg62_98 ; +0x21c, 0x18007efbc mov eax, [rbp+200h+var_1B0] ; +0x221, 0x18007efc1 cmp eax, [rsp+300h+var_29C] ; +0x224, 0x18007efc4 jb short loc_18007EFA1 ; +0x228, 0x18007efc8 mov rcx, rdi; Block ; +0x22a, 0x18007efca call j_j_free_0 ; +0x22d, 0x18007efcd jmp short loc_18007F00A ; +0x232, 0x18007efd2 mov eax, [rbp+200h+var_1B0] ; +0x234, 0x18007efd4 cmp eax, [rsp+300h+var_29C] ; +0x237, 0x18007efd7 jnb short loc_18007F00A ; +0x23b, 0x18007efdb nop dword ptr [rax] ; +0x23d, 0x18007efdd imul eax, esi ; +0x240, 0x18007efe0 lea rdx, [rsp+300h+var_2E0] ; +0x243, 0x18007efe3 mov r8d, 1 ; +0x248, 0x18007efe8 lea rcx, [rsp+300h+var_2D0] ; +0x24e, 0x18007efee add rax, [rbx+40h] ; +0x253, 0x18007eff3 mov [rsp+300h+var_2E0], rax ; +0x257, 0x18007eff7 call jpeg62_98 ; +0x25c, 0x18007effc mov eax, [rbp+200h+var_1B0] ; +0x261, 0x18007f001 cmp eax, [rsp+300h+var_29C] ; +0x264, 0x18007f004 jb short loc_18007EFE0 ; +0x268, 0x18007f008 lea rcx, [rsp+300h+var_2D0] ; +0x26a, 0x18007f00a call jpeg62_49 ; +0x26f, 0x18007f00f mov rcx, r14; Stream ; +0x274, 0x18007f014 call cs:fclose ; +0x277, 0x18007f017 lea rcx, [rsp+300h+var_2D0] ; +0x27d, 0x18007f01d call jpeg62_43 ; +0x282, 0x18007f022 mov al, 1 ; +0x287, 0x18007f027 jmp loc_18007EEB2 ; +0x289, 0x18007f029 jmp loc_18007EEBA ; +0x28e, 0x18007f02e xor al, al ; +0x293, 0x18007f033 jmp loc_18007EEC2 ; +0x295, 0x18007f035