Function at 0x5049e0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x20]
sub esp, 0xcc
push ebp
mov ebp, dword [esp + 0xd8]
push edi
mov edi, dword [esp + 0xe4]
push eax
push ecx
mov ecx, dword [esp + 0xf8]
lea eax, [esp + 0x88]
push edx
mov edx, dword [esp + 0xf8]
push eax
push ecx
push edx
push ebp
push edi
call fcn.00547180
add esp, 0x20
test eax, eax
je 0x504a39
pop edi
mov eax, 1
pop ebp
add esp, 0xcc
ret
mov edi, dword [edi + 8]
mov edx, dword [ebp + 8]
mov eax, dword [esp + 0xa0]
mov ecx, dword [esp + 0x98]
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x88]
imul edi, edx
push ebx
mov ebx, dword [esp + 0x98]
push esi
mov esi, dword [esp + 0xa4]
sub eax, ecx
imul ecx, dword [esp + 0x14]
sub esi, ebx
mov ebx, dword [esp + 0x8c]
mov dword [esp + 0x2c], esi
mov dword [esp + 0x60], edx
lea edi, [edi + ebx*4]
add edi, dword [ebp + 4]
mov ebp, dword [esp + 0x9c]
lea ecx, [ecx + ebp*4]
mov ebp, dword [esp + 0xec]
add ecx, dword [ebp + 4]
cmp byte [esp + 0x88], 0
mov dword [esp + 0x10], ecx
je 0x504dea
mov ebp, esi
mov edx, esi
sar ebp, 3
mov dword [esp + 0x6c], ebp
mov ebp, dword [esp + 0x94]
and edx, 7
sub ebx, ebp
mov ebp, dword [esp + 0x60]
add ebx, edx
mov dword [esp + 0x5c], edx
lea ebx, [ebp + ebx*4]
mov dword [esp + 0x68], ebx
mov ebx, edx
sub ebx, esi
mov esi, dword [esp + 0x14]
test eax, eax
lea esi, [esi + ebx*4]
mov dword [esp + 0x64], esi
jle 0x504fac
mov dword [esp + 0x60], eax
mov ebx, 0xff
mov eax, dword [esp + 0x6c]
test eax, eax
jle 0x504d76
mov esi, dword [esp + 0xf0]
lea ebp, [ecx + 8]
shl esi, 8
mov dword [esp + 0x14], eax
jmp 0x504b1b
mov ecx, dword [esp + 0x10]
mov eax, dword [edi]
mov dword [esp + 0x4c], eax
mov edx, dword [esp + 0x4d]
and eax, ebx
and edx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov byte [esp + 0x4c], al
mov al, byte [edx + esi + 0xa2ee04]
mov edx, dword [esp + 0x4e]
mov byte [esp + 0x4d], al
and edx, ebx
mov byte [esp + 0x4f], bl
mov al, byte [edx + esi + 0xa2ee04]
lea edx, [esp + 0x4c]
push edx
mov byte [esp + 0x52], al
call fcn.0051e940
mov eax, dword [edi + 4]
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x2d]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x2c], al
mov eax, dword [esp + 0x2e]
and eax, ebx
mov byte [esp + 0x2d], dl
lea edx, [esp + 0x2c]
mov byte [esp + 0x2f], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x32], cl
lea ecx, [ebp - 4]
call fcn.0051e940
mov eax, dword [edi + 8]
mov dword [esp + 0x54], eax
mov ecx, dword [esp + 0x55]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x54], al
mov eax, dword [esp + 0x56]
and eax, ebx
mov byte [esp + 0x55], dl
lea edx, [esp + 0x54]
mov byte [esp + 0x57], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x5a], cl
mov ecx, ebp
call fcn.0051e940
mov eax, dword [edi + 0xc]
mov dword [esp + 0x44], eax
mov ecx, dword [esp + 0x45]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x44], al
mov eax, dword [esp + 0x46]
and eax, ebx
mov byte [esp + 0x45], dl
lea edx, [esp + 0x44]
mov byte [esp + 0x47], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x4a], cl
lea ecx, [ebp + 4]
call fcn.0051e940
mov eax, dword [edi + 0x10]
mov dword [esp + 0x34], eax
mov ecx, dword [esp + 0x35]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x34], al
mov eax, dword [esp + 0x36]
mov byte [esp + 0x35], dl
and eax, ebx
lea edx, [esp + 0x34]
push edx
mov byte [esp + 0x3b], bl
mov cl, byte [eax + esi + 0xa2ee04]
mov byte [esp + 0x3a], cl
lea ecx, [ebp + 8]
call fcn.0051e940
mov eax, dword [edi + 0x14]
mov dword [esp + 0x24], eax
mov ecx, dword [esp + 0x25]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x24], al
mov eax, dword [esp + 0x26]
and eax, ebx
mov byte [esp + 0x25], dl
lea edx, [esp + 0x24]
mov byte [esp + 0x27], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x2a], cl
lea ecx, [ebp + 0xc]
call fcn.0051e940
mov eax, dword [edi + 0x18]
mov dword [esp + 0x3c], eax
mov ecx, dword [esp + 0x3d]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x3c], al
mov eax, dword [esp + 0x3e]
and eax, ebx
mov byte [esp + 0x3d], dl
lea edx, [esp + 0x3c]
mov byte [esp + 0x3f], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x42], cl
lea ecx, [ebp + 0x10]
call fcn.0051e940
mov eax, dword [edi + 0x1c]
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x1d]
and eax, ebx
and ecx, ebx
mov al, byte [eax + esi + 0xa2ee04]
mov dl, byte [ecx + esi + 0xa2ee04]
mov byte [esp + 0x1c], al
mov eax, dword [esp + 0x1e]
and eax, ebx
mov byte [esp + 0x1d], dl
lea edx, [esp + 0x1c]
mov byte [esp + 0x1f], bl
mov cl, byte [eax + esi + 0xa2ee04]
push edx
mov byte [esp + 0x22], cl
lea ecx, [ebp + 0x14]
call fcn.0051e940
mov eax, dword [esp + 0x10]
add ebp, 0x20
add eax, 0x20
add edi, 0x20
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x14]
dec eax
mov dword [esp + 0x14], eax
jne 0x504b17
mov edx, dword [esp + 0x5c]
mov ecx, dword [esp + 0x10]
test edx, edx
jle 0x504dbe
mov ebp, edi
mov esi, ecx
sub ebp, ecx
mov dword [esp + 0x18], edx
mov ecx, dword [esp + 0xf0]
mov eax, dword [esi + ebp]
push ecx
lea ecx, [esp + 0x18]
mov dword [esp + 0x18], eax
call fcn.005003c0
lea edx, [esp + 0x14]
mov ecx, esi
push edx
call fcn.0051e940
mov eax, dword [esp + 0x18]
add esi, 4
dec eax
mov dword [esp + 0x18], eax
jne 0x504d84
mov edx, dword [esp + 0x5c]
mov ecx, dword [esp + 0x10]
mov ebp, dword [esp + 0x64]
mov esi, dword [esp + 0x68]
mov eax, dword [esp + 0x60]
add ecx, ebp
add edi, esi
dec eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x60], eax
jne 0x504af8
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xcc
ret
mov ebx, dword [esp + 0xc8]
imul edx, dword [esp + 0xd8]
shl ebx, 2
mov dword [esp + 0x44], ebx
mov ebx, dword [esp + 0xbc]
mov dword [esp + 0x78], ebx
mov ebx, dword [esp + 0xc0]
mov dword [esp + 0x80], ebx
mov ebx, dword [esp + 0xd0]
mov dword [esp + 0x7c], ebx
mov ebx, dword [esp + 0xc4]
mov dword [esp + 0x1c], ebx
mov ebx, dword [esp + 0xd4]
mov dword [esp + 0x84], ebx
mov ebx, dword [esp + 0xcc]
test eax, eax
mov dword [esp + 0x54], edx
mov dword [esp + 0x10], ebx
jle 0x504fac
add ecx, 2
mov dword [esp + 0x6c], eax
mov dword [esp + 0x64], ecx
mov ebx, 0xff
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x7c]
add eax, ebp
mov dword [esp + 0x10], eax
js 0x504e87
mov ebp, dword [esp + 0x60]
add edi, ebp
mov ebp, dword [esp + 0x84]
sub eax, ebp
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x78]
mov dword [esp + 0x4c], edi
test esi, esi
mov dword [esp + 0x18], eax
jle 0x504f88
mov ebp, dword [esp + 0xf0]
mov eax, ecx
shl ebp, 8
mov dword [esp + 0x68], esi
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x80]
add ecx, edx
mov dword [esp + 0x18], ecx
js 0x504ecb
mov edx, dword [esp + 0x1c]
add edi, 4
sub ecx, edx
mov dword [esp + 0x18], ecx
mov esi, dword [edi]
mov dword [esp + 0x70], esi
mov ecx, dword [esp + 0x71]
and ecx, ebx
and esi, ebx
mov cl, byte [ecx + ebp + 0xa2ee04]
mov dl, byte [esi + ebp + 0xa2ee04]
mov byte [esp + 0x71], cl
mov ecx, dword [esp + 0x72]
and ecx, ebx
movzx dx, dl
mov cl, byte [ecx + ebp + 0xa2ee04]
mov byte [esp + 0x72], cl
movzx cx, byte [eax - 2]
add ecx, edx
cmp cx, bx
jbe 0x504f0e
mov ecx, ebx
movzx dx, byte [eax - 1]
mov word [esp + 0x3c], dx
mov si, word [esp + 0x3c]
movzx dx, byte [esp + 0x71]
add esi, edx
cmp si, bx
mov dword [esp + 0x5c], esi
jbe 0x504f32
mov dword [esp + 0x5c], ebx
movzx dx, byte [eax]
mov word [esp + 0x24], dx
mov si, word [esp + 0x24]
movzx dx, byte [esp + 0x72]
add esi, edx
cmp si, bx
mov dword [esp + 0x34], esi
jbe 0x504f55
mov edx, ebx
jmp 0x504f59
mov dl, byte [esp + 0x34]
mov esi, dword [esp + 0x44]
mov byte [eax - 2], cl
mov cl, byte [esp + 0x5c]
mov byte [eax], dl
mov byte [eax - 1], cl
mov ecx, dword [esp + 0x68]
mov byte [eax + 1], bl
add edi, esi
add eax, 4
dec ecx
mov dword [esp + 0x68], ecx
jne 0x504eab
mov edx, dword [esp + 0x54]
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x4c]
mov ecx, dword [esp + 0x64]
mov ebp, dword [esp + 0x14]
lea edi, [eax + edx]
mov eax, dword [esp + 0x6c]
add ecx, ebp
dec eax
mov dword [esp + 0x64], ecx
mov dword [esp + 0x6c], eax
jne 0x504e64
pop esi
pop ebx
pop edi
xor eax, eax
pop ebp
add esp, 0xcc
ret