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

Disassembly:
push 0xffffffffffffffff
push 0x4780c8
mov eax, dword fs:[0]
push eax
sub esp, 0x54
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4921bc]
xor eax, esp
push eax
lea eax, [esp + 0x68]
mov dword fs:[0], eax
mov edi, ecx
xor ebp, ebp
push edi
mov dword [esp + 0x74], ebp
call fcn.0040f810
add esp, 4
test al, al
je 0x40d92d
call fcn.0040fa90
test al, al
jne 0x40d92d
mov ebx, dword [esp + 0x78]
mov esi, dword [ebx]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esi, 0x2c
call edi
push eax
mov eax, dword [esi]
mov ecx, ebx
call eax
test al, al
je 0x40d912
mov eax, dword [esp + 0x7c]
mov ecx, dword [eax + 0x80]
mov edx, dword [ebx]
mov edx, dword [edx + 0x20]
push ecx
push eax
mov ecx, ebx
call edx
lea eax, [esp + 0x80]
mov dword [esp + 0x70], 0xffffffff
call fcn.0040c830
mov al, 1
jmp 0x40dd8d
call edi
lea eax, [esp + 0x80]
mov dword [esp + 0x70], 0xffffffff
call fcn.0040c830
jmp 0x40dd8b
mov ebx, dword [esp + 0x7c]
mov byte [esp + 0x70], 1
mov eax, dword [ebx + 0x60]
or eax, 0x8000000
cmp dword [edi + 0x18], 8
jb 0x40d949
mov ecx, dword [edi + 4]
jmp 0x40d94c
lea ecx, [edi + 4]
push ebp
push eax
push 2
push ebp
mov esi, 1
push esi
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [esp + 0x18], eax
jne 0x40da0e
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
mov eax, dword [esp + 0x78]
mov esi, dword [eax]
push edi
add esi, 0x2c
call ebp
mov edi, dword [esp + 0x7c]
mov edx, dword [esi]
push eax
mov ecx, edi
call edx
test al, al
je 0x40d9e8
mov ecx, dword [ebx + 0x80]
mov eax, dword [edi]
mov edx, dword [eax + 0x20]
push ecx
push ebx
mov ecx, edi
call edx
mov dword [esp + 0x70], 0xffffffff
mov esi, dword [esp + 0x84]
test esi, esi
je 0x40d9e1
lea eax, [esi + 4]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x40d9e1
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
call eax
lea ecx, [esi + 8]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x40d9e1
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
mov al, 1
jmp 0x40dd8d
mov dword [esp + 0x70], 0xffffffff
mov esi, dword [esp + 0x84]
test esi, esi
je 0x40dd8b
lea eax, [esi + 4]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jmp 0x40dd6b
cmp dword [ebx + 0x6c], esi
ja 0x40dd47
jb 0x40da22
cmp dword [ebx + 0x68], ebp
ja 0x40dd47
cmp dword [ebx + 0x84], esi
ja 0x40dd47
jb 0x40da3c
cmp dword [ebx + 0x80], ebp
ja 0x40dd47
lea eax, [esp + 0x18]
call fcn.00411b90
push 0x80000
mov dword [esp + 0x5c], vtable.GameMgr::GMBuffer_unsigned_char_.0
mov dword [esp + 0x68], ebp
call fcn.00461d22
mov edx, eax
add esp, 4
mov dword [esp + 0x60], edx
mov dword [esp + 0x5c], 0x80000
mov byte [esp + 0x70], 2
mov edi, dword [ebx + 0x80]
cmp edi, ebp
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x20], ebp
jbe 0x40dc67
jmp 0x40da90
cmp edi, 0x80000
mov ecx, 0x80000
ja 0x40da9f
mov ecx, edi
cmp edx, ebp
mov esi, dword [esp + 0x78]
mov eax, dword [esi + 0xb4]
je 0x40db3c
cmp dword [eax], 0xffffffff
je 0x40db3c
push ebp
mov dword [esp + 0x20], ebp
mov eax, dword [eax]
lea ebp, [esp + 0x20]
push ebp
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40db3c
mov eax, dword [esp + 0x1c]
test eax, eax
seta cl
test cl, cl
je 0x40db3c
mov cl, byte [esi + 0xe4]
sub edi, eax
test cl, cl
mov dword [esp + 0x30], edi
jne 0x40db3c
mov eax, dword [ebx + 0x80]
mov edx, dword [esi]
mov edx, dword [edx + 0x20]
sub eax, edi
push eax
push ebx
mov ecx, esi
call edx
cmp dword [ebx + 0x70], 0
mov ebp, dword [esp + 0x80]
mov eax, dword [esp + 0x1c]
jne 0x40db53
mov edx, dword [esp + 0x60]
push 0
lea ecx, [esp + 0x24]
push ecx
push eax
mov esi, eax
mov eax, dword [esp + 0x24]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40db3c
cmp esi, dword [esp + 0x20]
je 0x40dc22
lea ecx, [esp + 0x58]
call fcn.00404a80
lea esi, [esp + 0x18]
call fcn.004119d0
jmp 0x40d914
xor ebx, ebx
test eax, eax
mov edi, eax
mov dword [esp + 0x24], ebx
jbe 0x40dc1a
cmp dword [esp + 0x30], ebx
sete byte [esp + 0x38]
mov ecx, dword [esp + 0x78]
mov eax, dword [ecx + 0xe8]
test eax, eax
je 0x40db88
mov eax, dword [eax + 4]
cmp eax, 0xffffffff
je 0x40db88
push eax
call sub.KERNEL32.dll_Sleep
mov eax, dword [esp + 0x38]
mov esi, dword [esp + 0x60]
mov edx, dword [ebp]
mov edx, dword [edx + 4]
push eax
lea ecx, [esp + 0x28]
push ecx
push edi
lea eax, [esi + ebx]
push eax
mov ecx, ebp
call edx
test al, al
je 0x40dc31
mov eax, dword [esp + 0x24]
add ebx, eax
sub edi, eax
mov eax, dword [ebp]
mov edx, dword [eax + 0xc]
mov ecx, ebp
call edx
test eax, eax
jbe 0x40dc12
xor esi, esi
mov dword [esp + 0x28], esi
mov eax, dword [ebp]
mov edx, dword [eax + 0x14]
lea ecx, [esp + 0x28]
push ecx
mov ecx, ebp
call edx
cmp eax, esi
je 0x40dc08
mov ecx, dword [esp + 0x28]
cmp ecx, esi
jbe 0x40dc08
push 0
lea edx, [esp + 0x30]
push edx
push ecx
push eax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x3c], esi
push eax
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40dc4a
cmp esi, dword [esp + 0x2c]
jne 0x40dc4a
mov edx, dword [ebp]
mov eax, dword [edx + 0x18]
mov ecx, ebp
call eax
test edi, edi
ja 0x40db6c
mov ebx, dword [esp + 0x7c]
mov edi, dword [esp + 0x30]
test edi, edi
jbe 0x40dc6e
mov edx, dword [esp + 0x60]
xor ebp, ebp
jmp 0x40da90
push esi
call fcn.00462147
mov ecx, dword [esp + 0x1c]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40d914
mov edx, dword [esp + 0x60]
push edx
call fcn.00462147
mov eax, dword [esp + 0x1c]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40d914
mov ebp, dword [esp + 0x80]
cmp dword [ebx + 0x70], 0
je 0x40dce7
mov edx, dword [ebp]
mov eax, dword [edx + 8]
mov ecx, ebp
call eax
mov edx, dword [ebp]
mov eax, dword [edx + 0xc]
mov ecx, ebp
call eax
test eax, eax
jbe 0x40dccf
mov dword [esp + 0x34], 0
mov edx, dword [ebp]
mov edx, dword [edx + 0x14]
lea eax, [esp + 0x34]
push eax
mov ecx, ebp
call edx
test eax, eax
je 0x40dccf
mov edi, dword [esp + 0x34]
test edi, edi
jbe 0x40dccf
lea ecx, [esp + 0x18]
push ecx
lea esi, [esp + 0x40]
mov ecx, eax
mov dword [esp + 0x40], 0
call fcn.00411a30
test al, al
je 0x40db3c
mov edx, dword [ebp]
mov eax, dword [edx + 0xc]
mov ecx, ebp
call eax
test eax, eax
ja 0x40dc74
mov edx, dword [ebp]
mov eax, dword [edx + 0x18]
mov ecx, ebp
call eax
mov ecx, dword [ebx + 0x58]
mov edx, dword [ebx + 0x5c]
mov eax, dword [ebx + 0x50]
mov dword [esp + 0x40], ecx
mov ecx, dword [ebx + 0x54]
mov dword [esp + 0x44], edx
mov edx, dword [ebx + 0x48]
mov dword [esp + 0x4c], ecx
mov dword [esp + 0x48], eax
mov eax, dword [ebx + 0x4c]
lea ecx, [esp + 0x40]
push ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x54], edx
lea edx, [esp + 0x4c]
mov dword [esp + 0x58], eax
push edx
lea eax, [esp + 0x58]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
lea esi, [esp + 0x18]
call fcn.00411a60
lea ecx, [esp + 0x58]
call fcn.00404a80
call fcn.004119d0
jmp 0x40d8f7
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [esp + 0x70], 0xffffffff
mov esi, dword [esp + 0x84]
cmp esi, ebp
je 0x40dd8b
lea edx, [esi + 4]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x40dd8b
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov ecx, esi
call eax
or edx, 0xffffffff
lea ecx, [esi + 8]
lock xadd dword [ecx], edx
jne 0x40dd8b
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
xor al, al
mov ecx, dword [esp + 0x68]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x60
ret 0x10