Function at 0x408f90
Capabilities:
Encrypt data using rc4 ksa
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x124
mov eax, dword [esp + 0x12c]
mov ecx, dword [eax]
mov edx, dword [eax + 4]
push ebx
push ebp
mov ebp, dword [esp + 0x130]
mov dword [esp + 0x30], ecx
mov ecx, dword [eax + 8]
push esi
push edi
mov dword [esp + 0x40], ecx
lea esi, [eax + 0xe]
mov ecx, 0xa
lea edi, [esp + 0x108]
rep movsd dword es:[edi], dword [esi]
mov edi, dword [esp + 0x110]
mov dword [esp + 0x3c], edx
mov dx, word [eax + 0xc]
mov eax, dword [esp + 0x114]
shr eax, 0x10
mov ecx, 1
xor ebx, ebx
mov word [esp + 0x44], dx
cmp cx, ax
je 0x409086
mov edx, dword [esp + 0x10c]
cmp edx, dword [ebp + 0x30]
jne 0x40900f
mov eax, dword [ebp + 0x34]
cdq
xor eax, edx
sub eax, edx
cmp edi, eax
je 0x409086
lea esi, [ebp + 8]
call fcn.0040fa90
mov ecx, dword [esp + 0x10c]
mov edx, 0x20
mov eax, esi
call fcn.0040fb00
mov esi, edi
imul esi, dword [esp + 0x10c]
xor ecx, ecx
lea eax, [esi + 4]
mov edx, 4
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0045ffb1
add esp, 4
mov dword [ebp + 0x1c], eax
cmp eax, ebx
je 0x409086
lea ecx, [esi*4]
push ecx
add eax, 7
and eax, 0xfffffff8
push ebx
push eax
mov dword [ebp + 0x18], eax
call fcn.00463f50
add esp, 0xc
mov dword [ebp + 0x20], 0x20
mov dword [ebp + 0x28], ebx
mov dword [ebp + 0x24], ebx
mov dword [ebp + 0x5c], 0x4b5adc
mov dx, word [esp + 0x116]
movsx eax, dl
add eax, 8
cmp eax, 0x28
ja case.0x4090a4.7
movzx eax, byte [eax + 0x409da4]
jmp dword [eax*4 + 0x409d88]
push 0x400
mov dword [ebp + 4], 0xfffffff8
call fcn.0045fd36
mov esi, dword [esp + 0x140]
mov edx, dword [esp + 0x140]
mov ebx, eax
mov eax, dword [ebp + 0x34]
add esi, 0x36
mov ecx, 0x100
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x46]
lea esi, [ecx + edx]
mov ecx, dword [ebp + 0x18]
cdq
xor eax, edx
sub eax, edx
imul eax, dword [ebp + 0x30]
add esp, 4
mov dword [esp + 0x10], 0
test eax, eax
jle 0x4091d2
mov al, byte [esi]
inc esi
test al, al
jne 0x409154
movzx eax, byte [esi]
add dword [esp + 0x10], eax
xor edi, edi
test eax, eax
jle 0x409151
movzx edx, byte [ebx + 1]
mov al, byte [ebx + 2]
mov byte [esp + 0x2b], dl
movzx edx, byte [ebx]
mov byte [esp + 0x1f], dl
jmp 0x409130
movzx edx, byte [esp + 0x2b]
mov byte [ecx + 1], dl
movzx edx, byte [esp + 0x1f]
mov byte [ecx + 3], 0
mov byte [ecx + 2], al
mov byte [ecx], dl
movzx edx, byte [esi]
inc edi
add ecx, 4
cmp edi, edx
jl 0x409130
inc esi
jmp 0x4091bc
cmp al, 0xff
jne 0x409192
movzx edi, byte [esi]
add dword [esp + 0x10], edi
inc esi
test edi, edi
jle 0x4091bc
mov byte [ecx + 3], 0xff
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4 + 2]
mov byte [ecx + 2], dl
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4 + 1]
mov byte [ecx + 1], dl
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4]
mov byte [ecx], dl
dec edi
inc esi
add ecx, 4
test edi, edi
jg 0x409164
jmp 0x4091bc
inc dword [esp + 0x10]
mov byte [ecx + 3], al
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4 + 2]
mov byte [ecx + 2], dl
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4 + 1]
mov byte [ecx + 1], dl
movzx eax, byte [esi]
movzx edx, byte [ebx + eax*4]
mov byte [ecx], dl
inc esi
add ecx, 4
mov eax, dword [ebp + 0x34]
cdq
xor eax, edx
sub eax, edx
imul eax, dword [ebp + 0x30]
cmp dword [esp + 0x10], eax
jl 0x409101
push ebx
call fcn.0045fc59
add esp, 4
mov edx, dword [esp + 0x13c]
push edx
call fcn.0045fc59
add esp, 4
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x124
ret 8
mov eax, 1
mov ecx, eax
mov word [ebp + 0x74], ax
mov eax, dword [esp + 0x13c]
mov word [ebp + 0x76], cx
mov ecx, dword [esp + 0x42]
add eax, ecx
cmp edi, ebx
mov dword [ebp + 4], 0x18
mov ebp, dword [ebp + 0x18]
jge 0x40926e
jle case.0x4090a4.7
mov ecx, edi
mov edi, dword [esp + 0x10c]
cmp edi, ebx
jle 0x409264
mov esi, edi
jmp 0x409240
movzx edx, byte [eax]
mov byte [ebp], dl
movzx edx, byte [eax + 1]
inc eax
inc ebp
mov byte [ebp], dl
movzx edx, byte [eax + 1]
inc eax
inc ebp
mov byte [ebp], dl
inc ebp
mov byte [ebp], 0xff
inc eax
inc ebp
sub esi, 1
jne 0x409240
sub ecx, 1
jne 0x409232
jmp case.0x4090a4.7
movzx eax, dx
shr eax, 3
imul eax, dword [esp + 0x10c]
add eax, 3
and eax, 0xfffffffc
cmp edi, ebx
jle case.0x4090a4.7
lea esi, [edi - 1]
imul esi, eax
mov edx, eax
add esi, ecx
neg edx
add esi, dword [esp + 0x13c]
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x10c]
cmp edi, ebx
mov eax, esi
jle 0x4092d4
mov edi, edi
movzx ecx, byte [eax]
mov byte [ebp], cl
movzx ecx, byte [eax + 1]
inc eax
inc ebp
mov byte [ebp], cl
movzx ecx, byte [eax + 1]
inc eax
inc ebp
mov byte [ebp], cl
inc ebp
mov byte [ebp], 0xff
inc eax
inc ebp
sub edi, 1
jne 0x4092b0
add esi, edx
sub dword [esp + 0x18], 1
jne 0x4092a1
jmp case.0x4090a4.7
mov edx, dword [esp + 0x42]
mov eax, dword [esp + 0x13c]
mov ecx, dword [ebp + 0x18]
lea edi, [edx + eax]
mov eax, dword [ebp + 0x34]
cdq
xor eax, edx
sub eax, edx
imul eax, dword [ebp + 0x30]
lea edx, [eax + eax*2]
xor esi, esi
mov dword [ebp + 4], 0x20
mov dword [esp + 0x10], ebx
test edx, edx
jle case.0x4090a4.7
mov al, byte [edi]
inc edi
test al, al
jne 0x409349
movzx eax, byte [edi]
add dword [esp + 0x10], eax
xor edx, edx
cmp eax, ebx
jle 0x409346
jmp 0x409330
mov byte [ecx], bl
inc esi
inc ecx
cmp esi, 3
jne 0x40933e
mov byte [ecx], bl
inc ecx
xor esi, esi
movzx eax, byte [edi]
inc edx
cmp edx, eax
jl 0x409330
inc edi
jmp 0x40938e
cmp al, 0xff
jne 0x409379
movzx eax, byte [edi]
add dword [esp + 0x10], eax
inc edi
cmp eax, ebx
jle 0x40938e
lea esp, [esp]
mov dl, byte [edi]
mov byte [ecx], dl
inc esi
inc ecx
inc edi
cmp esi, 3
jne 0x409372
mov byte [ecx], 0xff
inc ecx
xor esi, esi
dec eax
cmp eax, ebx
jg 0x409360
jmp 0x40938e
mov dl, byte [edi]
inc dword [esp + 0x10]
mov byte [ecx], dl
inc esi
inc ecx
inc edi
cmp esi, 3
jne 0x40938e
mov byte [ecx], al
inc ecx
xor esi, esi
mov eax, dword [ebp + 0x34]
cdq
xor eax, edx
sub eax, edx
imul eax, dword [ebp + 0x30]
lea eax, [eax + eax*2]
cmp dword [esp + 0x10], eax
jl 0x409317
jmp case.0x4090a4.7
mov eax, dword [esp + 0x13c]
mov dword [ebp + 4], 1
mov cx, word [eax + 0x3a]
mov word [ebp + 0x74], cx
mov dx, word [eax + 0x38]
mov word [ebp + 0x76], dx
mov eax, dword [eax + 0x3e]
lea esi, [ebp + 8]
mov dword [esp + 0x20], eax
call fcn.0040fa90
movzx ecx, word [ebp + 0x74]
mov edx, dword [esp + 0x10c]
imul ecx, edi
push 0x4b5adc
push edx
mov eax, 1
call fcn.0040f9a0
mov edx, dword [esp + 0x13c]
mov ecx, dword [edx + 0x42]
mov eax, dword [ebp + 0x18]
add ecx, edx
cmp edi, ebx
mov dword [esp + 0x14], 0x42
jle 0x409447
cmp dword [esp + 0x10c], ebx
jle 0x409442
mov esi, dword [esp + 0x10c]
movzx edx, byte [ecx]
mov byte [eax], dl
movzx edx, byte [ecx + 1]
inc ecx
inc eax
mov byte [eax], dl
movzx edx, byte [ecx + 1]
inc ecx
inc eax
mov byte [eax], dl
inc eax
mov byte [eax], 0xff
inc ecx
inc eax
sub esi, 1
jne 0x409422
sub edi, 1
jne 0x409412
mov edi, 1
mov eax, edi
mov dword [esp + 0x18], edi
cmp ax, word [ebp + 0x74]
jae 0x409556
lea esp, [esp]
mov eax, dword [ebp + 0x34]
movzx ecx, word [ebp + 0x74]
cdq
xor eax, edx
sub eax, edx
cdq
idiv ecx
mov ecx, dword [ebp + 0x54]
mov edx, dword [ebp + 0x30]
mov esi, dword [esp + 0x14]
add esi, 4
mov dword [esp + 0x14], esi
mov ebx, eax
mov eax, dword [esp + 0x13c]
imul ecx, ebx
imul edx, ebx
mov esi, dword [esi + eax]
imul ecx, edi
add ecx, dword [ebp + 0x18]
add esi, eax
lea edx, [edx + edx*2]
xor eax, eax
xor edi, edi
test edx, edx
jle 0x409541
mov dl, byte [esi]
inc esi
test dl, dl
jne 0x4094db
movzx edx, byte [esi]
add eax, edx
mov dword [esp + 0x10], eax
xor eax, eax
test edx, edx
jle 0x4094d8
nop
mov byte [ecx], 0
inc edi
inc ecx
cmp edi, 3
jne 0x4094d0
mov byte [ecx], 0
inc ecx
xor edi, edi
movzx edx, byte [esi]
inc eax
cmp eax, edx
jl 0x4094c0
inc esi
jmp 0x40951f
cmp dl, 0xff
jne 0x409509
movzx edx, byte [esi]
add eax, edx
inc esi
mov dword [esp + 0x10], eax
test edx, edx
jle 0x40951f
mov edi, edi
mov al, byte [esi]
mov byte [ecx], al
inc edi
inc ecx
inc esi
cmp edi, 3
jne 0x409502
mov byte [ecx], 0xff
inc ecx
xor edi, edi
dec edx
test edx, edx
jg 0x4094f0
jmp 0x40951f
inc eax
mov dword [esp + 0x10], eax
mov al, byte [esi]
mov byte [ecx], al
inc edi
inc ecx
inc esi
cmp edi, 3
jne 0x40951f
mov byte [ecx], dl
inc ecx
xor edi, edi
mov eax, dword [ebp + 0x34]
movzx ebx, word [ebp + 0x74]
cdq
xor eax, edx
sub eax, edx
cdq
idiv ebx
imul eax, dword [ebp + 0x30]
lea edx, [eax + eax*2]
mov eax, dword [esp + 0x10]
cmp eax, edx
jl 0x4094a9
mov edi, dword [esp + 0x18]
movzx eax, word [ebp + 0x74]
inc edi
cmp edi, eax
mov dword [esp + 0x18], edi
jl 0x409460
mov eax, dword [ebp + 0x70]
test eax, eax
je 0x40956d
push eax
call fcn.0045fc59
add esp, 4
mov dword [ebp + 0x70], 0
mov esi, dword [esp + 0x20]
push esi
call fcn.0045fd36
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x140]
push esi
lea ecx, [edx + ecx + 4]
push ecx
push eax
mov dword [ebp + 0x70], eax
call fcn.00463fd0
add esp, 0x10
jmp case.0x4090a4.7
mov eax, dword [esp + 0x13c]
mov dword [ebp + 4], 2
mov dx, word [eax + 0x3a]
mov word [ebp + 0x74], dx
mov cx, word [eax + 0x38]
mov word [ebp + 0x76], cx
mov edx, dword [eax + 0x3e]
lea esi, [ebp + 8]
mov dword [esp + 0x30], edx
call fcn.0040fa90
mov esi, ebp
call fcn.00408f00
movzx eax, word [ebp + 0x76]
shl eax, 4
push eax
call fcn.0045fd36
movzx ecx, word [ebp + 0x76]
shl ecx, 4
push ecx
push ebx
push eax
mov dword [ebp + 0x6c], eax
call fcn.00463f50
movzx edx, word [ebp + 0x74]
movzx eax, word [ebp + 0x76]
add edx, eax
lea ecx, [edx*4 + 4]
push ecx
call fcn.0045fd36
xor edx, edx
add esp, 0x14
mov dword [ebp + 0x68], eax
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], 0xffffffff
mov dword [esp + 0x14], 0x42
mov dword [esp + 0x34], ebx
cmp dx, word [ebp + 0x74]
jae 0x409786
lea ecx, [ecx]
mov eax, dword [esp + 0x13c]
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx + eax]
add esi, eax
mov edx, dword [esi + 0xc]
imul edx, dword [esi + 8]
lea eax, [esi + 0xc]
lea ecx, [esi + 8]
add edx, edx
add edx, edx
push edx
mov edi, esi
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], ecx
call fcn.0045fd36
mov ecx, dword [esp + 0x38]
mov edx, dword [ebp + 0x68]
mov dword [edx + ecx*4], eax
mov eax, dword [ebp + 0x68]
mov eax, dword [eax + ecx*4]
add esi, 0x10
mov ecx, esi
movzx ecx, byte [ecx]
add esp, 4
inc esi
cmp dword [esp + 0x24], 0xffffffff
je 0x40968e
cmp ecx, dword [esp + 0x24]
je 0x409692
inc dword [esp + 0x18]
mov dword [esp + 0x24], ecx
movzx ecx, word [esp + 0x18]
mov edx, dword [edi]
shl ecx, 4
add ecx, dword [ebp + 0x6c]
mov dword [esp + 0x10], ebx
mov dword [ecx], edx
mov edx, dword [edi + 4]
mov dword [ecx + 4], edx
mov edx, dword [edi + 8]
mov dword [ecx + 8], edx
mov edx, dword [edi + 0xc]
mov edi, dword [esp + 0x20]
mov dword [ecx + 0xc], edx
mov edx, dword [esp + 0x2c]
mov edx, dword [edx]
imul edx, dword [edi]
lea edx, [edx + edx*2]
xor ecx, ecx
test edx, edx
jle 0x40976c
mov dl, byte [esi]
inc esi
mov byte [esp + 0x1f], dl
test dl, dl
jne 0x409709
movzx edx, byte [esi]
add dword [esp + 0x10], edx
xor edi, edi
cmp edx, ebx
jle 0x409706
lea esp, [esp]
mov byte [eax], bl
inc ecx
inc eax
cmp ecx, 3
jne 0x4096fe
mov byte [eax], bl
inc eax
xor ecx, ecx
movzx edx, byte [esi]
inc edi
cmp edi, edx
jl 0x4096f0
inc esi
jmp 0x409752
cmp dl, 0xff
jne 0x409739
movzx edx, byte [esi]
add dword [esp + 0x10], edx
mov edi, edx
inc esi
cmp edi, ebx
jle 0x409752
lea esp, [esp]
mov dl, byte [esi]
mov byte [eax], dl
inc ecx
inc eax
inc esi
cmp ecx, 3
jne 0x409732
mov byte [eax], 0xff
inc eax
xor ecx, ecx
dec edi
cmp edi, ebx
jg 0x409720
jmp 0x409752
mov dl, byte [esi]
inc dword [esp + 0x10]
mov byte [eax], dl
inc ecx
inc eax
inc esi
cmp ecx, 3
jne 0x409752
mov cl, byte [esp + 0x1f]
mov byte [eax], cl
inc eax
xor ecx, ecx
mov edx, dword [esp + 0x2c]
mov edx, dword [edx]
mov edi, dword [esp + 0x20]
imul edx, dword [edi]
lea edx, [edx + edx*2]
cmp dword [esp + 0x10], edx
jl 0x4096d1
mov eax, dword [esp + 0x34]
movzx ecx, word [ebp + 0x74]
add dword [esp + 0x14], 4
inc eax
cmp eax, ecx
mov dword [esp + 0x34], eax
jl 0x409630
movzx edx, word [ebp + 0x76]
xor esi, esi
dec edx
mov dword [esp + 0x20], esi
test edx, edx
jle 0x409a5f
mov edi, dword [esp + 0x34]
add edi, edi
add edi, edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], 0x10
lea ecx, [ecx]
xor eax, eax
mov ecx, vtable.CBuffer.0
mov edx, 0x20
mov dword [esp + 0xa8], ecx
mov dword [esp + 0x48], ecx
mov ecx, ebp
mov dword [esp + 0xac], ebx
mov dword [esp + 0xb0], ebx
mov dword [esp + 0xb4], ebx
mov dword [esp + 0xbc], ebx
mov dword [esp + 0xc0], edx
mov dword [esp + 0xc4], ebx
mov dword [esp + 0xc8], ebx
mov dword [esp + 0xcc], eax
mov dword [esp + 0xd0], eax
mov dword [esp + 0xd4], eax
mov dword [esp + 0xd8], eax
mov dword [esp + 0xdc], eax
mov dword [esp + 0xe0], eax
mov dword [esp + 0xe4], eax
mov dword [esp + 0xe8], eax
mov dword [esp + 0xec], eax
mov dword [esp + 0xf0], eax
mov dword [esp + 0xfc], ebx
mov dword [esp + 0x100], ebx
mov dword [esp + 0x104], ebx
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x50], ebx
mov dword [esp + 0x54], ebx
mov dword [esp + 0x5c], ebx
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], ebx
mov dword [esp + 0x68], ebx
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov dword [esp + 0x8c], eax
mov dword [esp + 0x90], eax
mov dword [esp + 0x9c], ebx
mov dword [esp + 0xa0], ebx
mov dword [esp + 0xa4], ebx
call fcn.00409e00
cmp dword [ebp + 4], 2
mov dword [esp + 0x24], eax
je 0x4098d0
xor esi, esi
jmp 0x4098e4
movzx eax, word [ebp + 0x74]
inc esi
cmp eax, esi
jg 0x4098dd
xor esi, esi
jmp 0x4098e4
mov esi, dword [ebp + 0x6c]
add esi, dword [esp + 0x18]
mov ecx, dword [esi + 8]
imul ecx, dword [esi + 0xc]
add ecx, ecx
add ecx, ecx
push ecx
call fcn.0045fd36
mov edx, dword [ebp + 0x68]
mov ecx, dword [esp + 0x28]
mov dword [edi + edx], eax
mov eax, dword [ecx + 0xc]
mov ecx, dword [ecx + 8]
mov edx, eax
neg edx
mov dword [esp + 0xd8], edx
mov dword [esp + 0xd4], ecx
add ecx, ecx
add ecx, ecx
mov edx, 1
mov word [esp + 0xdc], dx
mov edx, 0x20
mov word [esp + 0xde], dx
mov edx, ecx
imul edx, eax
add ecx, 3
mov dword [esp + 0xe4], edx
mov edx, dword [ebp + 0x68]
and ecx, 0xfffffffc
mov dword [esp + 0xf8], ecx
mov ecx, dword [edx]
mov edi, 0x28
mov dword [esp + 0xd0], edi
mov dword [esp + 0x70], edi
mov dword [esp + 0xbc], ecx
mov ecx, dword [esi + 0xc]
mov edi, ecx
neg edi
mov dword [esp + 0x78], edi
mov edi, 1
mov word [esp + 0x7c], di
mov eax, 4
mov edi, 0x20
mov word [esp + 0x7e], di
mov word [esp + 0xfc], ax
mov eax, dword [esi + 8]
mov edi, ecx
imul edi, eax
add edi, edi
add edi, edi
mov dword [esp + 0x84], edi
lea edi, [eax*4 + 3]
and edi, 0xfffffffc
mov dword [esp + 0x98], edi
mov edi, 4
mov word [esp + 0x9c], di
mov edi, dword [esp + 0x30]
mov edx, dword [edx + edi]
add esp, 4
mov dword [esp + 0x58], edx
mov edx, dword [esi + 4]
push edx
mov edx, dword [esi]
push edx
push ecx
push eax
push ebx
mov dword [esp + 0x84], eax
push ebx
lea eax, [esp + 0xc0]
lea ecx, [esp + 0x60]
mov dword [esp + 0xf4], ebx
mov dword [esp + 0xfc], ebx
mov dword [esp + 0x100], ebx
mov dword [esp + 0x104], ebx
mov dword [esp + 0x108], ebx
mov dword [esp + 0x94], ebx
mov dword [esp + 0x9c], ebx
mov dword [esp + 0xa0], ebx
mov dword [esp + 0xa4], ebx
mov dword [esp + 0xa8], ebx
call fcn.00408dc0
mov esi, dword [esp + 0x20]
movzx eax, word [ebp + 0x76]
add dword [esp + 0x18], 0x10
inc esi
add edi, 4
dec eax
cmp esi, eax
mov dword [esp + 0x20], esi
mov dword [esp + 0x2c], edi
jl 0x4097b0
mov ecx, dword [esp + 0x34]
mov edx, dword [ebp + 0x68]
add esi, ecx
mov dword [edx + esi*4], 0xffffffff
mov eax, dword [ebp + 0x70]
cmp eax, ebx
je 0x409a82
push eax
call fcn.0045fc59
add esp, 4
mov dword [ebp + 0x70], ebx
mov esi, dword [esp + 0x30]
push esi
call fcn.0045fd36
mov ecx, dword [esp + 0x140]
mov edx, dword [esp + 0x18]
push esi
add edx, ecx
push edx
push eax
mov dword [ebp + 0x70], eax
call fcn.00463fd0
movzx eax, word [ebp + 0x76]
dec eax
add esp, 0x10
test eax, eax
jle case.0x4090a4.7
mov dword [esp + 0x14], 1
mov dword [esp + 0x24], 0x10
cmp dword [esp + 0x14], 3
je 0x409bb1
xor eax, eax
mov ecx, ebp
call fcn.00409e00
cmp dword [ebp + 4], 2
mov dword [esp + 0x30], eax
je 0x409ae6
xor esi, esi
jmp 0x409afb
movzx ecx, word [ebp + 0x74]
cmp ecx, dword [esp + 0x14]
jg 0x409af4
xor esi, esi
jmp 0x409afb
mov esi, dword [ebp + 0x6c]
add esi, dword [esp + 0x24]
xor ecx, ecx
mov eax, ebp
mov dword [esp + 0x18], 0
call fcn.00409dd0
xor edx, edx
cmp dx, ax
jae 0x409bb1
mov eax, dword [ebp + 0x70]
test eax, eax
jne 0x409b22
xor ecx, ecx
jmp 0x409b2c
movzx ecx, word [esp + 0x18]
movzx ecx, word [eax + ecx*2 + 4]
mov edx, dword [esp + 0x30]
mov eax, dword [edx + 8]
mov edi, dword [esi + 4]
mov edx, dword [ebp + 0x68]
mov ebx, dword [esi]
lea eax, [eax*4 + 3]
and eax, 0xfffffffc
imul edi, eax
movzx ecx, cx
mov ecx, dword [edx + ecx*4]
mov edx, dword [esi + 8]
mov dword [esp + 0x58], ecx
add edi, dword [esp + 0x58]
mov ecx, dword [esi + 0xc]
lea ebx, [edi + ebx*4]
lea edi, [edx*4]
sub eax, edi
mov dword [esp + 0x2c], eax
test ecx, ecx
jle 0x409b94
mov dword [esp + 0x20], ecx
test edx, edx
jle 0x409b89
xor eax, eax
mov edi, ebx
mov ecx, edx
rep stosd dword es:[edi], eax
lea eax, [edx*4]
add ebx, eax
add ebx, dword [esp + 0x2c]
sub dword [esp + 0x20], 1
jne 0x409b74
mov edi, dword [esp + 0x18]
inc edi
xor ecx, ecx
mov eax, ebp
mov dword [esp + 0x18], edi
call fcn.00409dd0
movzx edx, ax
cmp edi, edx
jl 0x409b17
mov eax, dword [esp + 0x14]
movzx ecx, word [ebp + 0x76]
add dword [esp + 0x24], 0x10
inc eax
mov dword [esp + 0x14], eax
dec ecx
dec eax
cmp eax, ecx
jl 0x409ac4
jmp case.0x4090a4.7
mov eax, dword [esp + 0x13c]
mov dword [ebp + 4], 3
mov dx, word [eax + 0x3a]
mov word [ebp + 0x74], dx
mov cx, word [eax + 0x38]
mov word [ebp + 0x76], cx
mov edx, dword [eax + 0x3e]
lea esi, [ebp + 8]
mov dword [esp + 0x30], edx
call fcn.0040fa90
movzx ecx, word [ebp + 0x74]
mov eax, dword [esp + 0x10c]
imul ecx, edi
push 0x4b5adc
push eax
mov eax, 1
call fcn.0040f9a0
mov ecx, dword [ebp + 0x18]
xor edx, edx
mov dword [esp + 0x14], 0x42
mov dword [esp + 0x20], ebx
cmp dx, word [ebp + 0x74]
jae 0x409d43
jmp 0x409c40
mov edi, dword [esp + 0x13c]
test ebx, ebx
je 0x409c6b
mov eax, dword [ebp + 0x34]
movzx ecx, word [ebp + 0x74]
cdq
xor eax, edx
sub eax, edx
cdq
idiv ecx
add dword [esp + 0x14], 4
mov ecx, eax
imul ecx, dword [ebp + 0x54]
imul ecx, ebx
add ecx, dword [ebp + 0x18]
mov edx, dword [esp + 0x14]
mov esi, dword [edx + edi]
mov eax, dword [ebp + 0x34]
movzx ebx, word [ebp + 0x74]
cdq
xor eax, edx
sub eax, edx
cdq
idiv ebx
add esi, edi
xor edi, edi
mov dword [esp + 0x10], edi
imul eax, dword [ebp + 0x30]
lea eax, [eax + eax*2]
test eax, eax
jle 0x409d2e
mov al, byte [esi]
inc esi
test al, al
jne 0x409ccb
movzx eax, byte [esi]
add dword [esp + 0x10], eax
xor edx, edx
test eax, eax
jle 0x409cc8
lea esp, [esp]
mov byte [ecx], 0
inc edi
inc ecx
cmp edi, 3
jne 0x409cc0
mov byte [ecx], 0
inc ecx
xor edi, edi
movzx eax, byte [esi]
inc edx
cmp edx, eax
jl 0x409cb0
inc esi
jmp 0x409d0e
cmp al, 0xff
jne 0x409cf9
movzx eax, byte [esi]
add dword [esp + 0x10], eax
inc esi
test eax, eax
jle 0x409d0e
jmp 0x409ce0
mov dl, byte [esi]
mov byte [ecx], dl
inc edi
inc ecx
inc esi
cmp edi, 3
jne 0x409cf2
mov byte [ecx], 0xff
inc ecx
xor edi, edi
dec eax
test eax, eax
jg 0x409ce0
jmp 0x409d0e
mov dl, byte [esi]
inc dword [esp + 0x10]
mov byte [ecx], dl
inc edi
inc ecx
inc esi
cmp edi, 3
jne 0x409d0e
mov byte [ecx], al
inc ecx
xor edi, edi
mov eax, dword [ebp + 0x34]
movzx ebx, word [ebp + 0x74]
cdq
xor eax, edx
sub eax, edx
cdq
idiv ebx
imul eax, dword [ebp + 0x30]
lea eax, [eax + eax*2]
cmp dword [esp + 0x10], eax
jl 0x409c98
mov ebx, dword [esp + 0x20]
movzx edx, word [ebp + 0x74]
inc ebx
cmp ebx, edx
mov dword [esp + 0x20], ebx
jl 0x409c40
mov eax, dword [ebp + 0x70]
test eax, eax
je 0x409d5a
push eax
call fcn.0045fc59
add esp, 4
mov dword [ebp + 0x70], 0
mov esi, dword [esp + 0x30]
push esi
call fcn.0045fd36
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x140]
push esi
lea ecx, [edx + ecx + 4]
push ecx
push eax
mov dword [ebp + 0x70], eax
call fcn.00463fd0
add esp, 0x10
jmp case.0x4090a4.7