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

Disassembly:
push 0xffffffffffffffff
push 0x4c1f99
mov eax, dword fs:[0]
push eax
sub esp, 0xf8
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4ea6c4]
xor eax, esp
push eax
lea eax, [esp + 0x10c]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x124]
mov edi, dword [esp + 0x11c]
xor ebx, ebx
cmp dword [esp + 0x128], ebx
mov dword [esp + 0x114], ebx
jne 0x4218a4
mov dword [esp + 0x114], 0xffffffff
mov esi, dword [esp + 0x144]
cmp esi, ebx
je 0x42189d
lea eax, [esi + 4]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x42189d
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 0x42189d
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
xor al, al
jmp 0x421ff8
push 0x80000
mov dword [esp + 0x20], vtable.GameMgr::GMBuffer_unsigned_char_.0
mov dword [esp + 0x2c], ebx
call fcn.004ab8e2
add esp, 4
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], 0x80000
mov eax, dword [esp + 0x128]
push 1
mov byte [esp + 0x118], 1
push ebx
push ebx
lea esi, [esp + 0x50]
mov dword [esp + 0x24], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
call fcn.0040c7f0
mov esi, dword [esp + 0x134]
cmp esi, ebx
mov ecx, dword [esp + 0x130]
ja 0x42191e
cmp ecx, ebx
jbe 0x421f22
nop
cmp esi, ebx
jb 0x421929
ja 0x42191e
cmp ecx, 0x80000
jbe 0x421929
mov ecx, 0x80000
mov dword [esp + 0x50], ebx
jmp 0x42192d
mov dword [esp + 0x50], esi
cmp dword [esp + 0x24], ebx
je 0x421bf1
mov eax, dword [esp + 0x128]
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x421bf1
push ebx
lea edx, [esp + 0x1c]
push edx
push ecx
mov ecx, dword [esp + 0x30]
push ecx
push eax
mov dword [esp + 0x2c], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x421bf1
mov eax, dword [esp + 0x18]
cmp eax, ebx
seta cl
cmp cl, bl
je 0x421bf1
sub dword [esp + 0x130], eax
mov dl, byte [edi + 0x110]
sbb esi, ebx
test dl, dl
mov dword [esp + 0x134], esi
jne 0x421cd5
mov ecx, dword [ebp + 0x80]
sub ecx, dword [esp + 0x130]
mov edx, dword [ebp + 0x84]
mov eax, dword [edi]
mov eax, dword [eax + 0x24]
sbb edx, esi
push edx
push ecx
push ebp
mov ecx, edi
call eax
cmp dword [ebp + 0x70], ebx
mov ebp, dword [esp + 0x140]
jne 0x421a94
mov edx, dword [esp + 0x12c]
mov eax, dword [edx]
cmp eax, 0xffffffff
mov ecx, dword [esp + 0x18]
mov esi, ecx
je 0x4219fd
push ebx
lea edx, [esp + 0x44]
push edx
push ecx
mov ecx, dword [esp + 0x30]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4219fd
cmp esi, dword [esp + 0x40]
je 0x421bba
mov edx, 0x4cb7f8
lea eax, [esp + 0x98]
call fcn.004016b0
mov byte [esp + 0x114], 4
mov ebp, dword [edi]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x98]
push ecx
add ebp, 0x30
call esi
mov edx, dword [ebp]
push eax
mov ecx, edi
call edx
mov byte [esp + 0x114], 1
cmp dword [esp + 0xb0], 8
mov byte [esp + 0x17], al
jb 0x421a59
mov eax, dword [esp + 0x9c]
push eax
call fcn.004abbe4
add esp, 4
cmp byte [esp + 0x17], bl
jne 0x421c52
mov ebx, dword [edi]
add ebx, 0x34
call esi
mov ecx, dword [esp + 0x120]
mov edx, dword [ebx]
push eax
push ecx
push 0x10000003
mov ecx, edi
call edx
test al, al
lea ecx, [esp + 0x1c]
jne 0x421c56
call fcn.00401bb0
jmp 0x421ce2
mov eax, dword [esp + 0x18]
xor edi, edi
cmp eax, ebx
mov esi, eax
mov dword [esp + 0x2c], ebx
jbe 0x421bba
jmp 0x421ab0
mov edx, dword [esp + 0x11c]
mov eax, dword [edx + 0x114]
cmp eax, ebx
je 0x421acf
mov eax, dword [eax + 4]
cmp eax, 0xffffffff
je 0x421acf
push eax
call sub.KERNEL32.dll_Sleep
mov eax, dword [ebp]
mov edx, dword [eax + 4]
mov ecx, ebp
mov byte [esp + 0x3c], bl
call edx
xor ecx, ecx
cmp dword [esp + 0x13c], ecx
ja 0x421af8
jb 0x421af3
cmp dword [esp + 0x138], eax
ja 0x421af8
mov byte [esp + 0x3c], 1
mov ecx, dword [esp + 0x3c]
mov eax, dword [ebp]
push ecx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x30]
push edx
mov edx, dword [eax + 8]
add ecx, edi
push esi
push ecx
mov ecx, ebp
call edx
test al, al
je 0x421d00
mov eax, dword [esp + 0x2c]
add edi, eax
sub esi, eax
mov eax, dword [ebp]
mov edx, dword [eax + 0x10]
mov ecx, ebp
mov dword [esp + 0x58], edi
mov dword [esp + 0x4c], esi
call edx
test eax, eax
jbe 0x421bb2
mov dword [esp + 0x38], ebx
mov eax, dword [ebp]
mov edx, dword [eax + 0x18]
lea ecx, [esp + 0x38]
push ecx
mov ecx, ebp
call edx
cmp eax, ebx
je 0x421ba8
mov ecx, dword [esp + 0x38]
cmp ecx, ebx
jbe 0x421ba8
sub dword [esp + 0x138], ecx
mov edx, dword [esp + 0x12c]
mov edx, dword [edx]
sbb dword [esp + 0x13c], ebx
cmp edx, 0xffffffff
mov dword [esp + 0x30], ebx
mov esi, ecx
je 0x421e7b
push ebx
lea edi, [esp + 0x34]
push edi
push ecx
push eax
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x421e7b
cmp esi, dword [esp + 0x30]
jne 0x421e7b
mov edi, dword [esp + 0x58]
mov esi, dword [esp + 0x4c]
mov eax, dword [ebp]
mov edx, dword [eax + 0x1c]
mov ecx, ebp
call edx
cmp esi, ebx
ja 0x421ab0
cmp dword [esp + 0x134], ebx
ja 0x421bd0
cmp dword [esp + 0x130], ebx
jbe 0x421f29
mov esi, dword [esp + 0x134]
mov edi, dword [esp + 0x11c]
mov ebp, dword [esp + 0x124]
mov ecx, dword [esp + 0x130]
jmp 0x421910
mov edx, 0x4cb7f8
lea eax, [esp + 0xb4]
call fcn.004016b0
mov byte [esp + 0x114], 2
mov esi, dword [edi]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
lea eax, [esp + 0xb4]
push eax
add esi, 0x30
call ebp
mov edx, dword [esi]
push eax
mov ecx, edi
call edx
mov byte [esp + 0x114], 1
cmp dword [esp + 0xcc], 8
mov byte [esp + 0x17], al
jb 0x421c4c
mov eax, dword [esp + 0xb8]
push eax
call fcn.004abbe4
add esp, 4
cmp byte [esp + 0x17], bl
je 0x421c60
lea ecx, [esp + 0x1c]
call fcn.00401bb0
jmp 0x421fdf
mov edx, 0x4cb7f8
lea eax, [esp + 0xd0]
call fcn.004016b0
mov byte [esp + 0x114], 3
mov esi, dword [edi]
add esi, 0x34
call ebp
mov edx, dword [esi]
push eax
lea ecx, [esp + 0xd4]
push ecx
push 0x10000002
mov ecx, edi
call edx
lea esi, [esp + 0xd0]
mov byte [esp + 0x17], al
call fcn.00449530
lea ecx, [esp + 0x1c]
call fcn.00401bb0
lea eax, [esp + 0x140]
mov dword [esp + 0x114], 0xffffffff
call fcn.0040f030
cmp byte [esp + 0x17], bl
jne 0x421ff6
xor al, al
jmp 0x421ff8
mov eax, dword [esp + 0x24]
push eax
call fcn.004ab965
add esp, 4
lea eax, [esp + 0x140]
mov dword [esp + 0x114], 0xffffffff
call fcn.0040f030
xor al, al
jmp 0x421ff8
push ebx
push 0x4cb7f8
lea esi, [esp + 0x84]
mov dword [esp + 0x9c], 7
mov dword [esp + 0x98], ebx
mov word [esp + 0x88], bx
call fcn.00401700
mov ebp, dword [esp + 0x11c]
mov byte [esp + 0x114], 5
mov esi, dword [ebp]
lea eax, [esp + 0x7c]
push eax
add esi, 0x30
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esi]
push eax
mov ecx, ebp
call edx
mov byte [esp + 0x114], 1
cmp dword [esp + 0x94], 8
mov byte [esp + 0x17], al
jb 0x421d79
mov eax, dword [esp + 0x80]
push eax
call fcn.004abbe4
add esp, 4
cmp byte [esp + 0x17], bl
je 0x421ddd
mov ecx, dword [esp + 0x24]
push ecx
call fcn.004ab965
mov dword [esp + 0x118], 0xffffffff
mov esi, dword [esp + 0x148]
add esp, 4
cmp esi, ebx
je 0x421ff6
lea edx, [esi + 4]
or eax, 0xffffffff
lock xadd dword [edx], eax
jne 0x421ff6
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 0x421ff6
mov eax, dword [esi]
mov edx, dword [eax + 8]
mov ecx, esi
call edx
jmp 0x421ff6
mov eax, dword [esp + 0x124]
mov edx, dword [ebp]
mov edx, dword [edx + 0x38]
xor ecx, ecx
add edi, dword [eax + 0x80]
mov eax, dword [eax + 0x84]
adc eax, ecx
sub edi, dword [esp + 0x130]
mov ecx, ebp
sbb eax, dword [esp + 0x134]
add edi, dword [esp + 0x44]
adc eax, dword [esp + 0x48]
push eax
push edi
push 0x30000003
call edx
mov eax, dword [esp + 0x24]
push eax
call fcn.004ab965
mov dword [esp + 0x118], 0xffffffff
mov esi, dword [esp + 0x148]
add esp, 4
cmp esi, ebx
je 0x421cf9
lea ecx, [esi + 4]
or edx, 0xffffffff
lock xadd dword [ecx], edx
jne 0x421cf9
mov eax, dword [esi]
mov edx, dword [eax + 4]
mov ecx, esi
call edx
lea eax, [esi + 8]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
jne 0x421cf9
mov edx, dword [esi]
mov eax, dword [edx + 8]
mov ecx, esi
call eax
xor al, al
jmp 0x421ff8
mov edi, dword [esp + 0x11c]
push ebx
push 0x4cb7f8
lea esi, [esp + 0x68]
mov dword [esp + 0x80], 7
mov dword [esp + 0x7c], ebx
mov word [esp + 0x6c], bx
call fcn.00401700
mov byte [esp + 0x114], 6
mov esi, dword [edi]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0x60]
push ecx
add esi, 0x30
call ebp
mov edx, dword [esi]
push eax
mov ecx, edi
call edx
mov byte [esp + 0x114], 1
cmp dword [esp + 0x78], 8
mov byte [esp + 0x17], al
jb 0x421ee6
mov eax, dword [esp + 0x64]
push eax
call fcn.004abbe4
add esp, 4
cmp byte [esp + 0x17], bl
jne 0x421d7f
mov esi, dword [edi]
add esi, 0x34
call ebp
mov edx, dword [esi]
push eax
mov eax, dword [esp + 0x124]
push eax
push 0x10000003
mov ecx, edi
call edx
test al, al
je 0x421f18
mov eax, dword [esp + 0x24]
jmp 0x421fd6
mov ecx, dword [esp + 0x24]
push ecx
jmp 0x421cda
mov ebp, dword [esp + 0x140]
mov eax, dword [esp + 0x124]
cmp dword [eax + 0x70], ebx
je 0x421faa
mov edx, dword [ebp]
mov eax, dword [edx + 0xc]
mov ecx, ebp
call eax
mov edx, dword [ebp]
mov eax, dword [edx + 0x10]
mov ecx, ebp
call eax
test eax, eax
jbe 0x421f8b
mov dword [esp + 0x34], ebx
mov edx, dword [ebp]
mov edx, dword [edx + 0x18]
lea eax, [esp + 0x34]
push eax
mov ecx, ebp
call edx
cmp eax, ebx
je 0x421f8b
mov edi, dword [esp + 0x34]
cmp edi, ebx
jbe 0x421f8b
mov ecx, dword [esp + 0x12c]
push ecx
lea esi, [esp + 0x60]
mov ecx, eax
mov dword [esp + 0x60], ebx
call fcn.0040c750
test al, al
je 0x422014
mov edx, dword [ebp]
mov eax, dword [edx + 0x10]
mov ecx, ebp
call eax
test eax, eax
ja 0x421f35
mov eax, dword [ebp]
mov edx, dword [eax + 0x1c]
mov ecx, ebp
call edx
mov eax, dword [esp + 0x124]
mov ecx, dword [eax + 0x5c]
mov edx, dword [eax + 0x58]
push ecx
mov ecx, dword [eax + 0x54]
push edx
mov edx, dword [eax + 0x50]
push ecx
mov ecx, dword [eax + 0x4c]
push edx
mov edx, dword [eax + 0x48]
mov eax, dword [esp + 0x13c]
push ecx
push edx
call fcn.0040c870
mov eax, dword [esp + 0x24]
cmp eax, ebx
je 0x421fdf
push eax
call fcn.004ab965
add esp, 4
lea eax, [esp + 0x140]
mov dword [esp + 0x114], 0xffffffff
call fcn.0040f030
mov al, 1
mov ecx, dword [esp + 0x10c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x104
ret 0x2c
mov edx, 0x4cb7f8
lea eax, [esp + 0xec]
call fcn.004016b0
mov edi, dword [esp + 0x11c]
mov byte [esp + 0x114], 7
mov esi, dword [edi]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
lea ecx, [esp + 0xec]
push ecx
add esi, 0x30
call ebp
mov edx, dword [esi]
push eax
mov ecx, edi
call edx
lea esi, [esp + 0xec]
mov byte [esp + 0x17], al
mov byte [esp + 0x114], 1
call fcn.00449530
cmp byte [esp + 0x17], bl
jne 0x421c52
mov esi, dword [edi]
add esi, 0x34
call ebp
mov edx, dword [esi]
push eax
mov eax, dword [esp + 0x124]
push eax
push 0x10000003
mov ecx, edi
call edx
test al, al
lea ecx, [esp + 0x1c]
je 0x421a8a
call fcn.00401bb0
jmp 0x421fdf