Function at 0x5521f0
Capabilities:
Read file on windows
Resolve function by parsing pe exports
Write file on windows

Disassembly:
sub esp, 0xc8
mov eax, dword [0x6ac9e8]
xor eax, esp
mov dword [esp + 0xc4], eax
mov eax, dword [esp + 0xcc]
push ebx
lea edx, [esp + 8]
push edx
xor ebx, ebx
mov dword [esp + 0x10], eax
mov eax, dword [0x6bb490]
push ebx
mov dword [esp + 0x18], ecx
mov ecx, dword [eax]
push ebx
push eax
mov eax, dword [ecx + 0x40]
call eax
cmp eax, ebx
jge 0x552256
push eax
push str.Failed_to_get_back_buffer__0x_08x_
call fcn.0053cd50
add esp, 8
xor al, al
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.005c5ea5
add esp, 0xc8
ret 4
mov eax, dword [esp + 8]
mov ecx, dword [eax]
lea edx, [esp + 0x2c]
push edx
push eax
mov eax, dword [ecx + 0x20]
call eax
cmp eax, ebx
jge 0x5522a3
push eax
push str.Failed_to_get_surface_desc__0x_08x_
call fcn.0053cd50
mov eax, dword [esp + 0x10]
add esp, 8
cmp eax, ebx
je 0x552289
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor al, al
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.005c5ea5
add esp, 0xc8
ret 4
mov ecx, dword [esp + 0x2c]
push ebp
mov ebp, dword [esp + 0x48]
push edi
mov edi, dword [esp + 0x50]
lea eax, [ecx - 0x1a]
mov dword [esp + 0x1c], edi
cmp eax, 5
ja case.0x5522c4.28
movzx eax, byte [eax + 0x552730]
jmp dword [eax*4 + 0x552728]
push ecx
push str.Unsupported_BackBuffer_Format__d_._Please_contact_Metin_2_Administrator.
jmp 0x5522f4
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
push 0x8810
push ebx
lea edx, [esp + 0x34]
push edx
push eax
mov eax, dword [ecx + 0x24]
call eax
cmp eax, ebx
jge 0x552313
push eax
push str.Failed_to_lock_the_surface__0x_08x_
call fcn.0053cd50
mov eax, dword [esp + 0x18]
add esp, 8
cmp eax, ebx
je 0x55230c
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor al, al
jmp 0x55270b
mov eax, edi
imul eax, ebp
lea eax, [eax + eax*2]
push esi
push eax
call fcn.005c523d
mov esi, eax
add esp, 4
mov dword [esp + 0x2c], esi
cmp esi, ebx
jne 0x55235f
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x28]
push eax
call edx
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
push str.Failed_to_allocate_screenshot_buffer
mov dword [esp + 0x18], ebx
call fcn.0053cd50
add esp, 4
xor al, al
jmp 0x55270a
mov edx, dword [esp + 0x34]
mov dword [esp + 0x28], edx
cmp edi, ebx
jbe 0x5524d7
mov dword [esp + 0x24], edi
mov ecx, dword [esp + 0x38]
add ecx, 0xffffffec
mov esi, edx
cmp ecx, 5
ja case.default.0x552385
jmp dword [ecx*4 + 0x552738]
cmp ebp, ebx
jbe case.default.0x552385
lea ecx, [edx + 1]
mov esi, ebp
lea esp, [esp]
movzx edx, byte [ecx + 1]
mov byte [eax], dl
movzx edx, byte [ecx]
inc eax
mov byte [eax], dl
movzx edx, byte [ecx - 1]
inc eax
mov byte [eax], dl
inc eax
add ecx, 3
sub esi, 1
jne 0x5523a0
jmp case.default.0x552385
cmp ebp, ebx
jbe case.default.0x552385
lea ecx, [edx + 1]
mov esi, ebp
mov edi, edi
movzx edx, byte [ecx + 1]
mov byte [eax], dl
movzx edx, byte [ecx]
inc eax
mov byte [eax], dl
movzx edx, byte [ecx - 1]
inc eax
mov byte [eax], dl
inc eax
add ecx, 4
sub esi, 1
jne 0x5523d0
jmp case.default.0x552385
cmp ebp, ebx
jbe case.default.0x552385
mov edi, ebp
jmp 0x552400
mov ebx, dword [esi]
mov ecx, ebx
shr ecx, 0xb
and cl, 0x1f
mov edx, ebx
and bl, 0x1f
mov byte [esp + 0x13], bl
mov bl, cl
add cl, cl
add cl, cl
add cl, cl
shr edx, 5
and dl, 0x3f
shr bl, 2
or bl, cl
mov cl, dl
add dl, dl
shr cl, 2
add dl, dl
or cl, dl
mov byte [eax], bl
mov byte [eax + 1], cl
mov cl, byte [esp + 0x13]
inc eax
mov dl, cl
add cl, cl
add cl, cl
shr dl, 2
add cl, cl
inc eax
or dl, cl
mov byte [eax], dl
inc eax
add esi, 2
sub edi, 1
jne 0x552400
jmp 0x5524b6
cmp ebp, ebx
jbe case.default.0x552385
mov edi, ebp
lea esp, [esp]
mov ebx, dword [esi]
mov ecx, ebx
shr ecx, 0xa
and cl, 0x1f
mov edx, ebx
and bl, 0x1f
mov byte [esp + 0x13], bl
mov bl, cl
add cl, cl
add cl, cl
shr edx, 5
add cl, cl
and dl, 0x1f
shr bl, 2
or bl, cl
mov cl, dl
add dl, dl
add dl, dl
shr cl, 2
add dl, dl
or cl, dl
mov byte [eax], bl
mov byte [eax + 1], cl
mov cl, byte [esp + 0x13]
inc eax
mov dl, cl
add cl, cl
add cl, cl
shr dl, 2
add cl, cl
inc eax
or dl, cl
mov byte [eax], dl
inc eax
add esi, 2
sub edi, 1
jne 0x552460
mov edi, dword [esp + 0x20]
xor ebx, ebx
mov edx, dword [esp + 0x28]
add edx, dword [esp + 0x30]
sub dword [esp + 0x24], 1
mov dword [esp + 0x28], edx
jne 0x552373
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x5524f7
mov ecx, dword [eax]
mov edx, dword [ecx + 0x28]
push eax
call edx
mov eax, dword [esp + 0x14]
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [esp + 0x14], ebx
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
push edi
push ebp
push esi
push eax
call fcn.005521c0
push esi
mov byte [esp + 0x17], al
call fcn.005c6b29
add esp, 4
cmp byte [esp + 0x13], bl
jne 0x552536
mov ecx, dword [esp + 0x18]
push edi
push ebp
push ecx
push str.Failed_to_save_JPEG_file.___s___d___d_
call fcn.0053cd50
add esp, 0x10
xor al, al
jmp 0x55270a
cmp byte [0x6f6cd4], bl
je 0x552708
mov edx, dword [esp + 0x18]
push 0x62bf7c
push edx
call fcn.005c6f30
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x552708
push 2
push ebx
push esi
call fcn.005c847b
push esi
call fcn.005c8383
push ebx
push ebx
push esi
mov edi, eax
call fcn.005c847b
add edi, 0xffffffeb
push edi
call fcn.005c8d58
push esi
push 1
mov ebp, eax
lea eax, [esp + 0xa4]
push 0x15
push eax
call fcn.005c81c9
push esi
push 1
push edi
push ebp
call fcn.005c81c9
add esp, 0x40
push esi
call fcn.005c6cd4
add esp, 4
push 0x40
lea ecx, [esp + 0x98]
push ecx
push edi
push ebp
call fcn.00541df0
mov edx, dword [esp + 0x28]
add esp, 8
push eax
push edx
call fcn.00552170
lea eax, [esp + 0xa4]
add esp, 0x10
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x5525d6
sub eax, esi
inc eax
mov dword [esp + 0x1c], eax
mov byte [esp + 0x6f], al
add al, 0x23
mov byte [esp + 0x5a], al
mov eax, dword [esp + 0x18]
mov cl, 0x49
push 0x62d37c
push eax
mov byte [esp + 0x60], 0xe1
mov byte [esp + 0x61], bl
mov byte [esp + 0x63], 0x45
mov byte [esp + 0x64], 0x78
mov byte [esp + 0x65], 0x69
mov byte [esp + 0x66], 0x66
mov byte [esp + 0x67], bl
mov byte [esp + 0x68], bl
mov byte [esp + 0x69], cl
mov byte [esp + 0x6a], cl
mov byte [esp + 0x6b], 0x2a
mov byte [esp + 0x6c], bl
mov byte [esp + 0x6d], 8
mov byte [esp + 0x6e], bl
mov byte [esp + 0x6f], bl
mov byte [esp + 0x70], bl
mov byte [esp + 0x71], 1
mov byte [esp + 0x72], bl
mov byte [esp + 0x73], 0xe
mov byte [esp + 0x74], 1
mov byte [esp + 0x75], 2
mov byte [esp + 0x76], bl
mov byte [esp + 0x78], bl
mov byte [esp + 0x79], bl
mov byte [esp + 0x7a], bl
mov byte [esp + 0x7b], 0x1a
mov byte [esp + 0x7c], bl
mov byte [esp + 0x7d], bl
mov byte [esp + 0x7e], bl
mov byte [esp + 0x7f], bl
mov byte [esp + 0x80], bl
mov byte [esp + 0x81], bl
mov byte [esp + 0x82], bl
call fcn.005c6f30
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x5526ff
push esi
push 1
lea ecx, [esp + 0x84]
push 0x15
push ecx
call fcn.005c8bc0
push esi
push 1
lea edx, [esp + 0x70]
push 0x23
push edx
call fcn.005c8bc0
mov eax, dword [esp + 0x3c]
push esi
push 1
push eax
lea ecx, [esp + 0xc0]
push ecx
call fcn.005c8bc0
push esi
push ebx
call fcn.005caf72
push esi
push 0xff
call fcn.005caf72
add esp, 0x40
push esi
push 1
push edi
push ebp
call fcn.005c8bc0
push esi
call fcn.005c6cd4
add esp, 0x14
push ebp
call fcn.005c8c7b
add esp, 4
mov al, 1
pop esi
mov ecx, dword [esp + 0xd0]
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.005c5ea5
add esp, 0xc8
ret 4