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

Disassembly:
sub esp, 0xc8
mov eax, dword [0x70903c]
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 [0x719308]
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 0x59d036
push eax
push str.Failed_to_get_back_buffer__0x_08x_
call fcn.00587390
add esp, 8
xor al, al
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.00613e6e
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 0x59d083
push eax
push str.Failed_to_get_surface_desc__0x_08x_
call fcn.00587390
mov eax, dword [esp + 0x10]
add esp, 8
cmp eax, ebx
je 0x59d069
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.00613e6e
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.0x59d0a4.28
movzx eax, byte [eax + 0x59d510]
jmp dword [eax*4 + 0x59d508]
push ecx
push str.Unsupported_BackBuffer_Format__d_._Please_contact_Metin_2_Administrator.
jmp 0x59d0d4
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 0x59d0f3
push eax
push str.Failed_to_lock_the_surface__0x_08x_
call fcn.00587390
mov eax, dword [esp + 0x18]
add esp, 8
cmp eax, ebx
je 0x59d0ec
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor al, al
jmp 0x59d4eb
mov eax, edi
imul eax, ebp
lea eax, [eax + eax*2]
push esi
push eax
call fcn.0061278d
mov esi, eax
add esp, 4
mov dword [esp + 0x2c], esi
cmp esi, ebx
jne 0x59d13f
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.00587390
add esp, 4
xor al, al
jmp 0x59d4ea
mov edx, dword [esp + 0x34]
mov dword [esp + 0x28], edx
cmp edi, ebx
jbe 0x59d2b7
mov dword [esp + 0x24], edi
mov ecx, dword [esp + 0x38]
add ecx, 0xffffffec
mov esi, edx
cmp ecx, 5
ja case.default.0x59d165
jmp dword [ecx*4 + 0x59d518]
cmp ebp, ebx
jbe case.default.0x59d165
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 0x59d180
jmp case.default.0x59d165
cmp ebp, ebx
jbe case.default.0x59d165
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 0x59d1b0
jmp case.default.0x59d165
cmp ebp, ebx
jbe case.default.0x59d165
mov edi, ebp
jmp 0x59d1e0
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 0x59d1e0
jmp 0x59d296
cmp ebp, ebx
jbe case.default.0x59d165
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 0x59d240
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 0x59d153
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x59d2d7
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.0059cfa0
push esi
mov byte [esp + 0x17], al
call fcn.00616e52
add esp, 4
cmp byte [esp + 0x13], bl
jne 0x59d316
mov ecx, dword [esp + 0x18]
push edi
push ebp
push ecx
push str.Failed_to_save_JPEG_file.___s___d___d_
call fcn.00587390
add esp, 0x10
xor al, al
jmp 0x59d4ea
cmp byte [0x754b64], bl
je 0x59d4e8
mov edx, dword [esp + 0x18]
push 0x68df14
push edx
call fcn.00616a76
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x59d4e8
push 2
push ebx
push esi
call fcn.00618855
push esi
call fcn.0061875d
push ebx
push ebx
push esi
mov edi, eax
call fcn.00618855
add edi, 0xffffffeb
push edi
call fcn.00618f2b
push esi
push 1
mov ebp, eax
lea eax, [esp + 0xa4]
push 0x15
push eax
call fcn.006185a3
push esi
push 1
push edi
push ebp
call fcn.006185a3
add esp, 0x40
push esi
call fcn.0061705d
add esp, 4
push 0x40
lea ecx, [esp + 0x98]
push ecx
push edi
push ebp
call fcn.0058c410
mov edx, dword [esp + 0x28]
add esp, 8
push eax
push edx
call fcn.0059cf50
lea eax, [esp + 0xa4]
add esp, 0x10
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x59d3b6
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 0x6916a4
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.00616a76
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x59d4df
push esi
push 1
lea ecx, [esp + 0x84]
push 0x15
push ecx
call fcn.00618dcc
push esi
push 1
lea edx, [esp + 0x70]
push 0x23
push edx
call fcn.00618dcc
mov eax, dword [esp + 0x3c]
push esi
push 1
push eax
lea ecx, [esp + 0xc0]
push ecx
call fcn.00618dcc
push esi
push ebx
call fcn.0061b186
push esi
push 0xff
call fcn.0061b186
add esp, 0x40
push esi
push 1
push edi
push ebp
call fcn.00618dcc
push esi
call fcn.0061705d
add esp, 0x14
push ebp
call fcn.00618e4e
add esp, 4
mov al, 1
pop esi
mov ecx, dword [esp + 0xd0]
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.00613e6e
add esp, 0xc8
ret 4