Function at 0x402800
Capabilities:
Terminate process

Disassembly:
sub esp, 0x1f8
push ebx
push ebp
push esi
lea eax, [esp + 0x50]
push edi
push eax
mov dword [esp + 0x58], 0x94
call dword [0x405060]
cmp dword [esp + 0x58], 5
je 0x40282b
push 0
call fcn.00402cb7
mov eax, dword [esp + 0x5c]
test eax, eax
je 0x40283f
cmp eax, 1
je 0x40283f
push 0
call fcn.00402cb7
mov dword [0x4065b8], eax
call fcn.004022a0
test eax, eax
jne 0x402853
push eax
call fcn.00402cb7
call fcn.00402480
call fcn.00402360
cmp eax, 0xffffffff
jne 0x402867
call fcn.00402480
call fcn.00402360
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x40287c
push 0
call fcn.00402cb7
call fcn.004025c0
mov ebx, eax
sub ebx, 0x80000000
call fcn.00401d80
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, 0x406140
mov ebp, ecx
mov edx, edi
or ecx, 0xffffffff
push edx
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call fcn.00401fa0
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x4028cf
push eax
call fcn.00402cb7
push 0x406124
push ebp
call fcn.00402150
mov esi, eax
add esp, 8
test esi, esi
mov dword [esp + 0x28], esi
jne 0x4028ed
push eax
call fcn.00402cb7
lea ecx, [esp + 0x38]
lea edx, [esp + 0xe8]
push ecx
lea eax, [esp + 0x40]
push edx
lea ecx, [esp + 0x1d0]
push eax
push ecx
push ebp
call fcn.00401e00
add esp, 0x14
test al, al
jne 0x40291b
push 0
call fcn.00402cb7
mov ecx, dword [esp + 0x104]
mov eax, ebx
sub eax, ecx
lea edx, [esp + 0x14]
mov dword [esp + 0x24], eax
lea eax, [esp + 0x18]
push edx
mov edx, dword [esp + 0x14]
lea ecx, [esp + 0x20]
push eax
add esi, ebx
push ecx
push edx
mov dword [esp + 0x24], 0
mov dword [esp + 0x2c], esi
mov dword [esp + 0x28], 0x2000
call fcn.00402410
add esp, 0x10
test eax, eax
je 0x402b56
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x18]
sub esi, edi
sub eax, esi
cmp eax, 4
jb 0x402b75
mov ecx, dword [esp + 0x14]
cmp eax, 0xc
mov edi, dword [esi + ecx]
jb 0x40298f
mov ebx, dword [esi + ecx + 8]
mov dword [esp + 0x20], ebx
jmp 0x402993
mov ebx, dword [esp + 0x20]
push ecx
call fcn.00402470
add esp, 4
cmp ebx, 0x12c
jb 0x4029ab
push 0
call fcn.00402cb7
lea eax, [esp + 0x14]
lea ecx, [esp + 0x18]
push eax
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x20]
push ecx
lea esi, [edi - 0x80000000]
push edx
push eax
mov dword [esp + 0x2c], esi
mov dword [esp + 0x24], 0
mov dword [esp + 0x28], 0x2000
call fcn.00402410
add esp, 0x10
test eax, eax
je 0x402b56
mov ecx, dword [esp + 0x1c]
mov eax, esi
sub eax, ecx
mov ecx, dword [esp + 0x18]
sub ecx, eax
mov dword [esp + 0x10], eax
shr ecx, 2
cmp ecx, ebx
jb 0x402b49
lea edi, [ebx*4]
push edi
call fcn.00402c16
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x402a22
push eax
call fcn.00402cb7
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push 0x406118
and ecx, 3
rep stosb byte es:[edi], al
call fcn.00401fa0
add esp, 4
test eax, eax
jne 0x402a4d
push eax
call fcn.00402cb7
mov ecx, dword [esp + 0x20]
push ecx
push ebx
push eax
call fcn.004021d0
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
mov edi, dword [esp + 0x110]
lea ecx, [esp + 0xf4]
lea ebx, [eax + edx]
mov edx, dword [esp + 0x30]
sub esi, edi
push ecx
sub esi, edx
mov edx, dword [esp + 0x38]
push edx
push ebp
add esi, ebp
call fcn.00402730
mov edi, eax
add esp, 0x18
add edi, ebp
je 0x402ac7
cmp esi, edi
je 0x402ac7
xor eax, eax
lea ecx, [esp + 0x2c]
mov dword [esp + 0x2c], eax
push ecx
mov dword [esp + 0x34], eax
mov word [esp + 0x38], ax
call fcn.00402c0b
add esp, 4
cmp eax, 1
jl 0x402b61
cmp eax, 2
jg 0x402b61
jne 0x402ac7
mov esi, edi
mov edi, dword [0x40505c]
push 4
push esi
call edi
test eax, eax
jne 0x402b49
mov eax, dword [esp + 0x20]
push 4
shl eax, 2
lea ecx, [eax + esi - 4]
push ecx
call edi
test eax, eax
jne 0x402b49
mov edi, dword [esp + 0x20]
mov dword [esp + 0x10], eax
test edi, edi
jbe 0x402b49
mov ecx, ebx
mov eax, esi
sub ecx, esi
mov ebp, dword [ecx + eax]
mov edx, dword [esp + 0x24]
sub ebp, edx
sub ebp, 0x80000000
cmp ebp, dword [eax]
je 0x402b13
inc dword [esp + 0x10]
add eax, 4
dec edi
jne 0x402afc
mov eax, dword [esp + 0x10]
test eax, eax
je 0x402b49
mov edi, dword [esp + 0x20]
mov eax, ebx
sub esi, ebx
mov ebx, dword [eax]
mov ecx, dword [esi + eax]
sub ebx, edx
sub ebx, 0x80000000
cmp ebx, ecx
je 0x402b43
lea ecx, [ecx + edx - 0x80000000]
mov dword [eax], ecx
add eax, 4
dec edi
jne 0x402b29
mov edx, dword [esp + 0x14]
push edx
call fcn.00402470
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1f8
ret
mov edx, dword [esp + 0x14]
push edx
call fcn.00402470
add esp, 4
push 0
call fcn.00402cb7
push 0
call fcn.00402cb7
nop
nop
nop
nop