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

Disassembly:
sub esp, 0xc8
mov eax, dword [0x704e7c]
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 [0x714000]
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 0x5996e6
push eax
push str.Failed_to_get_back_buffer__0x_08x_
call fcn.00584480
add esp, 8
xor al, al
pop ebx
mov ecx, dword [esp + 0xc4]
xor ecx, esp
call fcn.006108ae
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 0x599733
push eax
push str.Failed_to_get_surface_desc__0x_08x_
call fcn.00584480
mov eax, dword [esp + 0x10]
add esp, 8
cmp eax, ebx
je 0x599719
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.006108ae
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.0x599754.28
movzx eax, byte [eax + 0x599bc0]
jmp dword [eax*4 + 0x599bb8]
push ecx
push str.Unsupported_BackBuffer_Format__d_._Please_contact_Metin_2_Administrator.
jmp 0x599784
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 0x5997a3
push eax
push str.Failed_to_lock_the_surface__0x_08x_
call fcn.00584480
mov eax, dword [esp + 0x18]
add esp, 8
cmp eax, ebx
je 0x59979c
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
xor al, al
jmp 0x599b9b
mov eax, edi
imul eax, ebp
lea eax, [eax + eax*2]
push esi
push eax
call fcn.0060f23e
mov esi, eax
add esp, 4
mov dword [esp + 0x2c], esi
cmp esi, ebx
jne 0x5997ef
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.00584480
add esp, 4
xor al, al
jmp 0x599b9a
mov edx, dword [esp + 0x34]
mov dword [esp + 0x28], edx
cmp edi, ebx
jbe 0x599967
mov dword [esp + 0x24], edi
mov ecx, dword [esp + 0x38]
add ecx, 0xffffffec
mov esi, edx
cmp ecx, 5
ja case.default.0x599815
jmp dword [ecx*4 + 0x599bc8]
cmp ebp, ebx
jbe case.default.0x599815
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 0x599830
jmp case.default.0x599815
cmp ebp, ebx
jbe case.default.0x599815
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 0x599860
jmp case.default.0x599815
cmp ebp, ebx
jbe case.default.0x599815
mov edi, ebp
jmp 0x599890
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 0x599890
jmp 0x599946
cmp ebp, ebx
jbe case.default.0x599815
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 0x5998f0
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 0x599803
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x599987
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.00599650
push esi
mov byte [esp + 0x17], al
call fcn.00613489
add esp, 4
cmp byte [esp + 0x13], bl
jne 0x5999c6
mov ecx, dword [esp + 0x18]
push edi
push ebp
push ecx
push str.Failed_to_save_JPEG_file.___s___d___d_
call fcn.00584480
add esp, 0x10
xor al, al
jmp 0x599b9a
cmp byte [0x74f85c], bl
je 0x599b98
mov edx, dword [esp + 0x18]
push 0x68a264
push edx
call fcn.006138f9
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x599b98
push 2
push ebx
push esi
call fcn.006150c5
push esi
call fcn.00614fcd
push ebx
push ebx
push esi
mov edi, eax
call fcn.006150c5
add edi, 0xffffffeb
push edi
call fcn.0061596b
push esi
push 1
mov ebp, eax
lea eax, [esp + 0xa4]
push 0x15
push eax
call fcn.00614e13
push esi
push 1
push edi
push ebp
call fcn.00614e13
add esp, 0x40
push esi
call fcn.0061369d
add esp, 4
push 0x40
lea ecx, [esp + 0x98]
push ecx
push edi
push ebp
call fcn.00589490
mov edx, dword [esp + 0x28]
add esp, 8
push eax
push edx
call fcn.00599600
lea eax, [esp + 0xa4]
add esp, 0x10
lea esi, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x599a66
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 0x68da3c
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.006138f9
mov esi, eax
add esp, 8
cmp esi, ebx
je 0x599b8f
push esi
push 1
lea ecx, [esp + 0x84]
push 0x15
push ecx
call fcn.0061580c
push esi
push 1
lea edx, [esp + 0x70]
push 0x23
push edx
call fcn.0061580c
mov eax, dword [esp + 0x3c]
push esi
push 1
push eax
lea ecx, [esp + 0xc0]
push ecx
call fcn.0061580c
push esi
push ebx
call fcn.00617bc6
push esi
push 0xff
call fcn.00617bc6
add esp, 0x40
push esi
push 1
push edi
push ebp
call fcn.0061580c
push esi
call fcn.0061369d
add esp, 0x14
push ebp
call fcn.0061588e
add esp, 4
mov al, 1
pop esi
mov ecx, dword [esp + 0xd0]
pop edi
pop ebp
pop ebx
xor ecx, esp
call fcn.006108ae
add esp, 0xc8
ret 4